<?php
// Scan the current directory
$dir = '.';
$files = scandir($dir);

// Filter out files, only include directories (apps)
$apps = array_filter($files, function($file) use ($dir) {
    return is_dir($dir . '/' . $file) && $file != '.' && $file != '..';
});
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Available Apps</title>
    <style>
        body {
            background-color: #0D1B2A;
            color: #E0E1DD;
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 40px 20px;
        }
        h1 {
            text-align: center;
            color: #E0E1DD;
        }
        .app-list {
            list-style-type: none;
            padding: 0;
        }
        .app-list li {
            background-color: #1B263B;
            margin: 10px 0;
            padding: 15px;
            border-radius: 5px;
            text-align: center;
        }
        .app-list li a {
            color: #E0E1DD;
            text-decoration: none;
            font-size: 18px;
        }
        .app-list li a:hover {
            color: #A9BCD0;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Available Apps</h1>
        <ul class="app-list">
            <?php foreach ($apps as $app): ?>
                <li><a href="/toolntoy/<?php echo htmlspecialchars($app); ?>/"><?php echo htmlspecialchars(ucfirst($app)); ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
</body>
</html>
