Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.159
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
sifaris /
app /
Http /
Controllers /
Admin /
[ HOME SHELL ]
Name
Size
Permission
Action
Spatie
[ DIR ]
drwxrwxr-x
AccessController.php
2.48
KB
-rw-rw-r--
AddressController.php
3.29
KB
-rw-rw-r--
AdminUserController.php
8.74
KB
-rw-rw-r--
AppUserController.php
8.02
KB
-rw-rw-r--
CategoryController.php
3.02
KB
-rw-rw-r--
DashboardController.php
8.02
KB
-rw-rw-r--
FiscalController.php
1.28
KB
-rw-rw-r--
GeneralController.php
682
B
-rw-rw-r--
LoginController.php
2.28
KB
-rw-rw-r--
OfficeController.php
1.35
KB
-rw-rw-r--
PriorityController.php
2.15
KB
-rw-rw-r--
ReportController.php
21.01
KB
-rw-rw-r--
SifarisFormController.php
1.43
KB
-rw-rw-r--
SifarisRecordController.php
26.6
KB
-rw-rw-r--
StatusController.php
2.25
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : DashboardController.php
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\Office; use App\Services\SifarisRecordService; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\DB; class DashboardController extends Controller { private $service; public function __construct(SifarisRecordService $service) { $this->service = $service; } //get dashboard data public function dashboard() { $office = office(); $with = [ 'office' => $office ]; //get stats for today //this office, today $today_status = $this->get_sifaris_count_by_status($office->id, adDate()); $with['own_today_status'] = $today_status; //this office, today, free $today_status_free = $this->get_sifaris_count_by_status($office->id, adDate(), 'free'); $with['own_today_status_free'] = $today_status_free; //this office, today, paid $today_status_paid = $this->get_sifaris_count_by_status($office->id, adDate(), 'paid'); $with['own_today_status_paid'] = $today_status_paid; //get stats for all time //this office, all time $all_time_status = $this->get_sifaris_count_by_status($office->id); $with['own_all_time_status'] = $all_time_status; //this office, all time, free $all_time_status_free = $this->get_sifaris_count_by_status($office->id, null, 'free'); $with['own_all_time_status_free'] = $all_time_status_free; //this office, all time, paid $all_time_status_paid = $this->get_sifaris_count_by_status($office->id, null, 'paid'); $with['own_all_time_status_paid'] = $all_time_status_paid; $with['latest_sifaris'] = $this->get_latest_sifaris(); //get stats for fiscal //this office, fiscal $fiscal_status = $this->get_sifaris_count_by_status($office->id, null); $with['own_fiscal_status'] = $fiscal_status; //this office, fiscal, free $fiscal_status_free = $this->get_sifaris_count_by_status($office->id, null, 'free'); $with['own_fiscal_status_free'] = $fiscal_status_free; //this office, fiscal, paid $fiscal_status_paid = $this->get_sifaris_count_by_status($office->id, null, 'paid'); $with['own_fiscal_status_paid'] = $fiscal_status_paid; $offices = $this->get_offices($office); $with['offices'] = $offices; $with['ward_wise_count_and_revenue'] = $this->get_wardwise_count_and_revenue($offices, bsDate()); return view('admin.dashboard.dashboard')->with($with); } private function get_sifaris_count_by_status($office_id = null, $date_ad = null, $fee_type = null, $fiscal_id = null) { $params = []; if ($office_id) { $params['office_id'] = $office_id; } if ($date_ad) { $params['date_ad'] = $date_ad; } $query = 'SELECT COUNT(*) AS total_count, category_details.name FROM sifaris_records INNER JOIN sifaris_forms ON sifaris_forms.id=sifaris_records.form_id INNER JOIN categories ON categories.id=sifaris_records.status_id INNER JOIN category_details ON category_details.category_id=categories.id'; $query .= ' WHERE 1=1 '; if ($office_id) { $query .= ' AND office_id=:office_id '; } else { $query .= ' INNER JOIN offices ON sifaris_records.office_id=offices.id '; $query .= ' offices.is_head_office=false '; } if ($date_ad) { $query .= ' AND date_ad=:date_ad '; } if ($fee_type) { if ($fee_type == 'paid') $query .= ' AND sifaris_forms.fee > 0 '; else if ($fee_type == 'free') $query .= ' AND sifaris_forms.fee = 0 '; } $query .= ' GROUP BY category_details.name'; $status_wise_records_count = DB::select($query, $params); $total_sifaris_count = 0; foreach ($status_wise_records_count as $item) { $total_sifaris_count += $item->total_count; } return [$total_sifaris_count, $status_wise_records_count]; } private function get_latest_sifaris() { $filter['office_id'] = officeId(); $data = $this->service->list($filter); $records = $data['records']->items(); return $records; } private function get_wardwise_count_and_revenue(Collection $offices, $date_bs = null) { // dd($offices); $params = []; if ($date_bs) { $params['date_ad'] = adDate($date_bs); } $query = 'SELECT COUNT(*) AS total_count, SUM(sifaris_receipts.fee) as total_fee, count(if(sifaris_receipts.fee=0,1,NULL) ) AS free_count, count(if(sifaris_receipts.fee>0,1,NULL) ) AS paid_count, offices.id AS office_id,offices.name from sifaris_receipts INNER JOIN sifaris_records on sifaris_receipts.id = sifaris_records.receipt_id INNER JOIN offices ON sifaris_records.office_id=offices.id INNER JOIN sifaris_forms ON sifaris_forms.id=sifaris_records.form_id INNER JOIN categories ON categories.id=sifaris_records.status_id INNER JOIN category_details ON category_details.category_id=categories.id where 1=1 '; if ($date_bs) { $query .= 'AND sifaris_receipts.date_ad=:date_ad '; } $query .= ' GROUP BY offices.id,offices.name;'; // DB::enableQueryLog(); $records = DB::select($query, $params); // dd(DB::getQueryLog()); $subjects = [ [ 'name' => 'जम्मा सिफारिस', 'name_en' => 'Total Sifaris', 'code' => 'total', 'office_data' => [] ], [ 'name' => 'नि:शुल्क सिफारिस', 'name_en' => 'Free Sifaris', 'code' => 'free', 'office_data' => [] ], [ 'name' => 'सशुल्क सिफारिस', 'name_en' => 'Paid Sifaris', 'code' => 'paid', 'office_data' => [] ], [ 'name' => 'जम्मा राजश्व (रु.)', 'name_en' => 'Total Revenue (Rs.)', 'code' => 'revenue', 'office_data' => [] ] ]; foreach ($offices as $o) { foreach ($subjects as $key=>$s) { $subjects[$key]['office_data'][] = [ 'office_id' => $o->id, 'office_name' => $o->name, 'total_count' => 0 ]; } } // dd(collect($subjects)); // dd($subjects); // dd($offices); foreach ($subjects as $key=>$s) { foreach ($records as $item) { foreach ($s['office_data'] as $key_f=>$o) { if ($item->office_id == $o['office_id']) { if ($s['code'] == 'total') $subjects[$key]['office_data'][$key_f]['total_count'] += $item->total_count; if ($s['code'] == 'free') $subjects[$key]['office_data'][$key_f]['total_count'] += $item->free_count; if ($s['code'] == 'paid') $subjects[$key]['office_data'][$key_f]['total_count'] += $item->paid_count; if ($s['code'] == 'revenue') $subjects[$key]['office_data'][$key_f]['total_count'] += $item->total_fee; } } } } // dd($subjects); return $subjects; } private function get_offices($office) { $query = Office::active(); if ($office->is_head_office) { return $query->get(); } else { return $query->where('id', $office->id)->get(); } } public function media() { return view('admin.media_manager'); } }
Close