📂 File Browser

applications
🌙 Dark Mode
🎯 Quick Launch:

📁 Directories

📁 assets/ 🔓 Open
📁 data/ 🔓 Open
📁 includes/ 🔓 Open

📄 Files

🐘 apply.php
▶ Open 📄 View Source
🐘 create-forum.php
▶ Open 📄 View Source
🐘 dashboard.php
▶ Open 📄 View Source
🐘 index.php
▶ Open 📄 View Source
🐘 login.php
▶ Open 📄 View Source
🐘 logout.php
▶ Open 📄 View Source
🐘 manage-admins.php
▶ Open 📄 View Source
🐘 my-applications.php
▶ Open 📄 View Source
🐘 oauth-callback.php
▶ Open 📄 View Source
🐘 profile.php
▶ Open 📄 View Source
🐘 register.php
▶ Open 📄 View Source

📄 Source: my-applications.php

<?php
require_once 'includes/config.php';
require_once 'includes/db.php';
require_once 'includes/auth.php';
require_once 'includes/functions.php';

requireLogin();

$user = getCurrentUser();
$submissions = getUserSubmissions($user['id']);

$statusFilter = $_GET['status'] ?? 'all';
if ($statusFilter !== 'all') {
    $submissions = array_filter($submissions, function($sub) use ($statusFilter) {
        return $sub['status'] === $statusFilter;
    });
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Applications - <?php echo SITE_NAME; ?></title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="assets/style.css">
    <style>
        .filter-bar {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }
        .filter-btn {
            padding: 0.4rem 1rem;
            border-radius: 2rem;
            border: 2px solid var(--border-color);
            background: transparent;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.2s;
        }
        .filter-btn:hover {
            background: var(--option-bg);
        }
        .filter-btn.active {
            background: var(--info);
            color: white;
            border-color: var(--info);
        }
        .app-card {
            background: var(--bg-card);
            border-radius: 1rem;
            padding: 1.5rem;
            margin-bottom: 1rem;
            border: 1px solid var(--border-color);
        }
        .app-card .app-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .app-card .app-title {
            font-weight: 600;
            font-size: 1.1rem;
        }
        .app-card .app-meta {
            color: var(--text-secondary);
            font-size: 0.85rem;
            margin-top: 0.3rem;
        }
        .app-card .app-answers {
            margin-top: 1rem;
            background: var(--code-bg);
            padding: 1rem;
            border-radius: 0.5rem;
        }
        .app-card .app-answer {
            padding: 0.3rem 0;
            border-bottom: 1px solid var(--border-color);
        }
        .app-card .app-answer:last-child {
            border-bottom: none;
        }
        .status-badge {
            padding: 0.2rem 0.8rem;
            border-radius: 2rem;
            font-size: 0.8rem;
            display: inline-block;
        }
        .status-pending { background: var(--warning); color: white; }
        .status-approved { background: var(--success); color: white; }
        .status-rejected { background: var(--error); color: white; }
        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
        }
        .empty-state .icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }
    </style>
</head>
<body>
    <div class="theme-switcher">
        <button class="theme-btn" data-theme="light" title="Light mode">☀️</button>
        <button class="theme-btn" data-theme="dark" title="Dark mode">🌙</button>
    </div>

    <div class="container">
        <header class="header">
            <div class="header-top">
                <h1>📄 My Applications</h1>
                <a href="index.php" class="back-link">← Back</a>
            </div>
            <p class="subhead">Track all your submitted applications</p>
        </header>

        <div class="filter-bar">
            <a href="?status=all" class="filter-btn <?php echo $statusFilter === 'all' ? 'active' : ''; ?>">All</a>
            <a href="?status=pending" class="filter-btn <?php echo $statusFilter === 'pending' ? 'active' : ''; ?>">⏳ Pending</a>
            <a href="?status=approved" class="filter-btn <?php echo $statusFilter === 'approved' ? 'active' : ''; ?>">✅ Approved</a>
            <a href="?status=rejected" class="filter-btn <?php echo $statusFilter === 'rejected' ? 'active' : ''; ?>">❌ Rejected</a>
        </div>

        <?php if (empty($submissions)): ?>
            <div class="empty-state">
                <div class="icon">📭</div>
                <h3>No Applications Found</h3>
                <p style="color: var(--text-secondary);">You haven't submitted any applications yet.</p>
                <a href="index.php" class="btn-primary" style="margin-top: 1rem; display: inline-block;">Browse Forums</a>
            </div>
        <?php else: ?>
            <?php foreach ($submissions as $sub): ?>
                <div class="app-card">
                    <div class="app-header">
                        <div>
                            <div class="app-title">📋 <?php echo htmlspecialchars($sub['forum_title']); ?></div>
                            <div class="app-meta">
                                Submitted: <?php echo timeAgo($sub['submitted_at']); ?>
                            </div>
                        </div>
                        <span class="status-badge status-<?php echo $sub['status']; ?>">
                            <?php echo getStatusBadge($sub['status'])['label']; ?>
                        </span>
                    </div>

                    <?php if (!empty($sub['note'])): ?>
                        <div style="margin-top: 0.5rem; padding: 0.5rem 1rem; background: var(--code-bg); border-radius: 0.5rem; font-size: 0.9rem;">
                            <strong>📝 Staff Note:</strong> <?php echo htmlspecialchars($sub['note']); ?>
                        </div>
                    <?php endif; ?>

                    <div class="app-answers">
                        <?php foreach ($sub['answers'] as $answer): ?>
                            <div class="app-answer">
                                <strong><?php echo htmlspecialchars($answer['question']); ?></strong>
                                <br>
                                <span style="color: var(--text-secondary);"><?php echo htmlspecialchars($answer['answer'] ?: '(No answer)'); ?></span>
                            </div>
                        <?php endforeach; ?>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>

        <footer class="footer">
            <p>📄 <?php echo count($submissions); ?> applications total</p>
        </footer>
    </div>

    <script src="assets/script.js"></script>
</body>
</html>
← Back