!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/dokan/script/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/   drwxrwxrwx
Free 13.1 GB of 57.97 GB (22.6%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PageSetup.php (4.81 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace PhpOffice\PhpSpreadsheet\Reader\Gnumeric;

use 
PhpOffice\PhpSpreadsheet\Spreadsheet;
use 
PhpOffice\PhpSpreadsheet\Worksheet\PageMargins;
use 
PhpOffice\PhpSpreadsheet\Worksheet\PageSetup as WorksheetPageSetup;
use 
SimpleXMLElement;

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

    
/**
     * @var string
     */
    
private $gnm;

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

    public function 
printInformation(SimpleXMLElement $sheet): self
    
{
        if (isset(
$sheet->PrintInformation)) {
            
$printInformation $sheet->PrintInformation[0];
            
$scale = (string) $printInformation->Scale->attributes()['percentage'];
            
$pageOrder = (string) $printInformation->order;
            
$orientation = (string) $printInformation->orientation;
            
$horizontalCentered = (string) $printInformation->hcenter->attributes()['value'];
            
$verticalCentered = (string) $printInformation->vcenter->attributes()['value'];

            
$this->spreadsheet->getActiveSheet()->getPageSetup()
                ->
setPageOrder($pageOrder === 'r_then_d' WorksheetPageSetup::PAGEORDER_OVER_THEN_DOWN WorksheetPageSetup::PAGEORDER_DOWN_THEN_OVER)
                ->
setScale((int) $scale)
                ->
setOrientation($orientation ?? WorksheetPageSetup::ORIENTATION_DEFAULT)
                ->
setHorizontalCentered((bool) $horizontalCentered)
                ->
setVerticalCentered((bool) $verticalCentered);
        }

        return 
$this;
    }

    public function 
sheetMargins(SimpleXMLElement $sheet): self
    
{
        if (isset(
$sheet->PrintInformation$sheet->PrintInformation->Margins)) {
            
$marginSet = [
                
// Default Settings
                
'top' => 0.75,
                
'header' => 0.3,
                
'left' => 0.7,
                
'right' => 0.7,
                
'bottom' => 0.75,
                
'footer' => 0.3,
            ];

            
$marginSet $this->buildMarginSet($sheet$marginSet);
            
$this->adjustMargins($marginSet);
        }

        return 
$this;
    }

    private function 
buildMarginSet(SimpleXMLElement $sheet, array $marginSet): array
    {
        foreach (
$sheet->PrintInformation->Margins->children($this->gnmtrue) as $key => $margin) {
            
$marginAttributes $margin->attributes();
            
$marginSize = ($marginAttributes['Points']) ?? 72//    Default is 72pt
            // Convert value in points to inches
            
$marginSize PageMargins::fromPoints((float) $marginSize);
            
$marginSet[$key] = $marginSize;
        }

        return 
$marginSet;
    }

    private function 
adjustMargins(array $marginSet): void
    
{
        foreach (
$marginSet as $key => $marginSize) {
            
// Gnumeric is quirky in the way it displays the header/footer values:
            //    header is actually the sum of top and header; footer is actually the sum of bottom and footer
            //    then top is actually the header value, and bottom is actually the footer value
            
switch ($key) {
                case 
'left':
                case 
'right':
                    
$this->sheetMargin($key$marginSize);

                    break;
                case 
'top':
                    
$this->sheetMargin($key$marginSet['header'] ?? 0);

                    break;
                case 
'bottom':
                    
$this->sheetMargin($key$marginSet['footer'] ?? 0);

                    break;
                case 
'header':
                    
$this->sheetMargin($key, ($marginSet['top'] ?? 0) - $marginSize);

                    break;
                case 
'footer':
                    
$this->sheetMargin($key, ($marginSet['bottom'] ?? 0) - $marginSize);

                    break;
            }
        }
    }

    private function 
sheetMargin(string $keyfloat $marginSize): void
    
{
        switch (
$key) {
            case 
'top':
                
$this->spreadsheet->getActiveSheet()->getPageMargins()->setTop($marginSize);

                break;
            case 
'bottom':
                
$this->spreadsheet->getActiveSheet()->getPageMargins()->setBottom($marginSize);

                break;
            case 
'left':
                
$this->spreadsheet->getActiveSheet()->getPageMargins()->setLeft($marginSize);

                break;
            case 
'right':
                
$this->spreadsheet->getActiveSheet()->getPageMargins()->setRight($marginSize);

                break;
            case 
'header':
                
$this->spreadsheet->getActiveSheet()->getPageMargins()->setHeader($marginSize);

                break;
            case 
'footer':
                
$this->spreadsheet->getActiveSheet()->getPageMargins()->setFooter($marginSize);

                break;
        }
    }
}

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