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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/   drwxr-xr-x
Free 13.16 GB of 57.97 GB (22.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef;

use 
PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
use 
PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use 
PhpOffice\PhpSpreadsheet\Calculation\LookupRef;

class 
Lookup
{
    use 
ArrayEnabled;

    
/**
     * LOOKUP
     * The LOOKUP function searches for value either from a one-row or one-column range or from an array.
     *
     * @param mixed $lookupValue The value that you want to match in lookup_array
     * @param mixed $lookupVector The range of cells being searched
     * @param null|mixed $resultVector The column from which the matching value must be returned
     *
     * @return mixed The value of the found cell
     */
    
public static function lookup($lookupValue$lookupVector$resultVector null)
    {
        if (
is_array($lookupValue)) {
            return 
self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1$lookupValue$lookupVector$resultVector);
        }

        if (!
is_array($lookupVector)) {
            return 
ExcelError::NA();
        }
        
$hasResultVector = isset($resultVector);
        
$lookupRows self::rowCount($lookupVector);
        
$lookupColumns self::columnCount($lookupVector);
        
// we correctly orient our results
        
if (($lookupRows === && $lookupColumns 1) || (!$hasResultVector && $lookupRows === && $lookupColumns !== 2)) {
            
$lookupVector LookupRef\Matrix::transpose($lookupVector);
            
$lookupRows self::rowCount($lookupVector);
            
$lookupColumns self::columnCount($lookupVector);
        }

        
$resultVector self::verifyResultVector($resultVector ?? $lookupVector);

        if (
$lookupRows === && !$hasResultVector) {
            
$resultVector array_pop($lookupVector);
            
$lookupVector array_shift($lookupVector);
        }

        if (
$lookupColumns !== 2) {
            
$lookupVector self::verifyLookupValues($lookupVector$resultVector);
        }

        return 
VLookup::lookup($lookupValue$lookupVector2);
    }

    private static function 
verifyLookupValues(array $lookupVector, array $resultVector): array
    {
        foreach (
$lookupVector as &$value) {
            if (
is_array($value)) {
                
$k array_keys($value);
                
$key1 $key2 array_shift($k);
                ++
$key2;
                
$dataValue1 $value[$key1];
            } else {
                
$key1 0;
                
$key2 1;
                
$dataValue1 $value;
            }

            
$dataValue2 array_shift($resultVector);
            if (
is_array($dataValue2)) {
                
$dataValue2 array_shift($dataValue2);
            }
            
$value = [$key1 => $dataValue1$key2 => $dataValue2];
        }
        unset(
$value);

        return 
$lookupVector;
    }

    private static function 
verifyResultVector(array $resultVector): array
    {
        
$resultRows self::rowCount($resultVector);
        
$resultColumns self::columnCount($resultVector);

        
// we correctly orient our results
        
if ($resultRows === && $resultColumns 1) {
            
$resultVector LookupRef\Matrix::transpose($resultVector);
        }

        return 
$resultVector;
    }

    private static function 
rowCount(array $dataArray): int
    
{
        return 
count($dataArray);
    }

    private static function 
columnCount(array $dataArray): int
    
{
        
$rowKeys array_keys($dataArray);
        
$row array_shift($rowKeys);

        return 
count($dataArray[$row]);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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