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


Viewing file:     Compare.php (4.58 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * @package Compare
 * @author TechVillage <support@techvill.org>
 * @contributor Sakawat Hossain Rony <[sakawat.techvill@gmail.com]>
 * @created 11-01-2022
 */
namespace App\Compare;
use 
Cache;
use 
Auth;

class 
Compare
{
    
/**
     * add compare data
     *
     * @param $productId
     * @return bool|void
     */
    
public static function add($productId)
    {
        
$compare self::getCompareData();

        if (!
$compare) {
            
$compare[] = $productId;
            
self::save($compare);

            return 
true;
        } elseif (!
in_array($productId$compare)) {
            
$compare[] = $productId;
            
self::save($compare);

            return 
true;
        }
    }

    
/**
     * save compare data
     *
     * @param $compare
     * @return void
     */
    
public static function save($compare)
    {
        if (!empty(
self::userId())) {
            
Cache::put(config('cache.prefix') . '.compare.'.self::userId(), $compare30 86400);
        } else {
            
Cache::put(config('cache.prefix') . '.compare.'.getUniqueAddress(), $compare30 86400);
        }
    }

    
/**
     * getCompare data
     *
     * @return mixed
     */
    
public static function getCompareData()
    {
        return !empty(
self::userId()) ? Cache::get(config('cache.prefix') . '.compare.' self::userId()) : Cache::get(config('cache.prefix') . '.compare.' getUniqueAddress());
    }

    
/**
     * compare data in collection method
     *
     * @param $userId
     * @return CompareCollection
     */
    
public static function compareCollection($userId null)
    {
        if (
$userId != null && $userId != 0) {
            return new 
CompareCollection(Cache::get(config('cache.prefix') . '.compare.'.$userId));
        }

        return !empty(
self::userId()) ? new CompareCollection(Cache::get(config('cache.prefix') . '.compare.' self::userId())) : new CompareCollection(Cache::get(config('cache.prefix') . '.compare.' getUniqueAddress()));
    }

    
/**
     * total CompareData
     *
     * @return int
     */
    
public static function totalProduct()
    {
        
$compare self::compareCollection();
        return 
$compare->count();
    }

    
/**
     * compare data destroy
     *
     * @param $id
     * @param $action
     * @return bool
     */
    
public static function destroy($id$action 'single')
    {
        if (
$action == 'single') {
            
$compare self::getCompareData();
            
$index array_search($id$compare);
            unset(
$compare[$index]);
            
self::save($compare);
        } else {
            !empty(
self::userId()) ? Cache::forget(config('cache.prefix') . '.compare.' self::userId()) :  Cache::forget(config('cache.prefix') . '.compare.' getUniqueAddress());
        }

        return 
true;
    }

    
/**
     * compare data transfer local to user
     *
     * @return void
     */
    
public static function compareDataTransfer()
    {
        if (!empty(
self::userId()) && empty(Cache::get(config('cache.prefix') . '.compare.' self::userId()))) {

            if (!empty(
Cache::get(config('cache.prefix') . '.compare.'.getUniqueAddress()))) {
                
Cache::put(config('cache.prefix') . '.compare.' self::userId(), Cache::get(config('cache.prefix') . '.compare.' getUniqueAddress()), 30 86400);
            }

        } elseif (!empty(
self::userId()) && !empty(Cache::get(config('cache.prefix') . '.compare.' self::userId())) && !empty(Cache::get(config('cache.prefix') . '.compare.' getUniqueAddress()))) {
            
$userCompareList Cache::get(config('cache.prefix') . '.compare.'.self::userId());

            foreach (
Cache::get(config('cache.prefix') . '.compare.'.getUniqueAddress()) as $local) {
                if (!
in_array($local$userCompareList)) {
                    
self::add($local);
                }
            }

            
Cache::forget(config('cache.prefix') . '.compare.' getUniqueAddress());
            
Cache::put(config('cache.prefix') . '.compare.' getUniqueAddress(), Cache::get(config('cache.prefix') . '.compare.' self::userId()), 30 86400);
        }
    }

    
/**
     * get user id
     *
     * @return null| int $userId
     */
    
public static function userId()
    {
        
$userId null;

        if (isset(
Auth::user()->id)) {
            
$userId Auth::user()->id;
        } elseif (isset(
auth()->guard('api')->user()->id)) {
            
$userId auth()->guard('api')->user()->id;
        }

        return 
$userId;
    }
}

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