!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.17 GB of 57.97 GB (22.73%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx;

use 
PhpOffice\PhpSpreadsheet\Spreadsheet;
use 
SimpleXMLElement;

class 
WorkbookView
{
    
/**
     * @var Spreadsheet
     */
    
private $spreadsheet;

    public function 
__construct(Spreadsheet $spreadsheet)
    {
        
$this->spreadsheet $spreadsheet;
    }

    
/**
     * @param mixed $mainNS
     */
    
public function viewSettings(SimpleXMLElement $xmlWorkbook$mainNS, array $mapSheetIdbool $readDataOnly): void
    
{
        if (
$this->spreadsheet->getSheetCount() == 0) {
            
$this->spreadsheet->createSheet();
        }
        
// Default active sheet index to the first loaded worksheet from the file
        
$this->spreadsheet->setActiveSheetIndex(0);

        
$workbookView $xmlWorkbook->children($mainNS)->bookViews->workbookView;
        if (
$readDataOnly !== true && !empty($workbookView)) {
            
$workbookViewAttributes self::testSimpleXml(self::getAttributes($workbookView));
            
// active sheet index
            
$activeTab = (int) $workbookViewAttributes->activeTab// refers to old sheet index
            // keep active sheet index if sheet is still loaded, else first sheet is set as the active worksheet
            
if (isset($mapSheetId[$activeTab]) && $mapSheetId[$activeTab] !== null) {
                
$this->spreadsheet->setActiveSheetIndex($mapSheetId[$activeTab]);
            }

            
$this->horizontalScroll($workbookViewAttributes);
            
$this->verticalScroll($workbookViewAttributes);
            
$this->sheetTabs($workbookViewAttributes);
            
$this->minimized($workbookViewAttributes);
            
$this->autoFilterDateGrouping($workbookViewAttributes);
            
$this->firstSheet($workbookViewAttributes);
            
$this->visibility($workbookViewAttributes);
            
$this->tabRatio($workbookViewAttributes);
        }
    }

    
/**
     * @param mixed $value
     */
    
public static function testSimpleXml($value): SimpleXMLElement
    
{
        return (
$value instanceof SimpleXMLElement)
            ? 
$value
            
: new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><root></root>');
    }

    public static function 
getAttributes(?SimpleXMLElement $valuestring $ns ''): SimpleXMLElement
    
{
        return 
self::testSimpleXml($value === null $value $value->attributes($ns));
    }

    
/**
     * Convert an 'xsd:boolean' XML value to a PHP boolean value.
     * A valid 'xsd:boolean' XML value can be one of the following
     * four values: 'true', 'false', '1', '0'.  It is case sensitive.
     *
     * Note that just doing '(bool) $xsdBoolean' is not safe,
     * since '(bool) "false"' returns true.
     *
     * @see https://www.w3.org/TR/xmlschema11-2/#boolean
     *
     * @param string $xsdBoolean An XML string value of type 'xsd:boolean'
     *
     * @return bool  Boolean value
     */
    
private function castXsdBooleanToBool(string $xsdBoolean): bool
    
{
        if (
$xsdBoolean === 'false') {
            return 
false;
        }

        return (bool) 
$xsdBoolean;
    }

    private function 
horizontalScroll(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->showHorizontalScroll)) {
            
$showHorizontalScroll = (string) $workbookViewAttributes->showHorizontalScroll;
            
$this->spreadsheet->setShowHorizontalScroll($this->castXsdBooleanToBool($showHorizontalScroll));
        }
    }

    private function 
verticalScroll(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->showVerticalScroll)) {
            
$showVerticalScroll = (string) $workbookViewAttributes->showVerticalScroll;
            
$this->spreadsheet->setShowVerticalScroll($this->castXsdBooleanToBool($showVerticalScroll));
        }
    }

    private function 
sheetTabs(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->showSheetTabs)) {
            
$showSheetTabs = (string) $workbookViewAttributes->showSheetTabs;
            
$this->spreadsheet->setShowSheetTabs($this->castXsdBooleanToBool($showSheetTabs));
        }
    }

    private function 
minimized(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->minimized)) {
            
$minimized = (string) $workbookViewAttributes->minimized;
            
$this->spreadsheet->setMinimized($this->castXsdBooleanToBool($minimized));
        }
    }

    private function 
autoFilterDateGrouping(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->autoFilterDateGrouping)) {
            
$autoFilterDateGrouping = (string) $workbookViewAttributes->autoFilterDateGrouping;
            
$this->spreadsheet->setAutoFilterDateGrouping($this->castXsdBooleanToBool($autoFilterDateGrouping));
        }
    }

    private function 
firstSheet(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->firstSheet)) {
            
$firstSheet = (string) $workbookViewAttributes->firstSheet;
            
$this->spreadsheet->setFirstSheetIndex((int) $firstSheet);
        }
    }

    private function 
visibility(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->visibility)) {
            
$visibility = (string) $workbookViewAttributes->visibility;
            
$this->spreadsheet->setVisibility($visibility);
        }
    }

    private function 
tabRatio(SimpleXMLElement $workbookViewAttributes): void
    
{
        if (isset(
$workbookViewAttributes->tabRatio)) {
            
$tabRatio = (string) $workbookViewAttributes->tabRatio;
            
$this->spreadsheet->setTabRatio((int) $tabRatio);
        }
    }
}

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