<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Panel</title>
    <link rel="stylesheet" type="text/css" href="css/adminstyles.css"> <!-- Link to your CSS file -->
<style>
/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

/* Container for Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: #007bff;
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 20px;
}

.sidebar ul li a {
    color: white;
    text-decoration: none;
    padding: 10px;
    display: block;
    background-color: #0056b3;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sidebar ul li a:hover {
    background-color: #003d7a;
}

/* Main Content Styles */
.main-content {
    flex-grow: 1;
    background-color: white;
    padding: 20px;
}

.main-content h1 {
    font-size: 28px;
    color: #333;
}

.main-content p {
    font-size: 18px;
    color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main-content {
        width: 100%;
    }
}

</style>
</head>
<body>
    <div class="container">
        <!-- Sidebar -->
        <div class="sidebar">
            <h2>Admin Menu</h2>
            <ul>
                <li><a href="?page=add_student">Add Student</a></li>
				<li><a href="?page=edit_student">Edit Student Information</a></li>
                <li><a href="?page=update_question">Upload Question</a></li>
				<li><a href="?page=delete_question">Delete Question</a></li>
				<li><a href="?page=set_table">Assign Question to Class</a></li>
                <li><a href="?page=score_sheet">Score Sheets</a></li>
				<li><a href="?page=score_sheet2">EED -Score Sheets</a></li>
				 <li><a href="?page=grant_access">Authorise</a></li>
				 <li><a href="?page=set_time">Set Examination Duration</a></li>


            </ul>
        </div>

        <!-- Main Content -->
        <div class="main-content">
            <h1>Admin Panel</h1>
            <hr>
			            <div class="content">
                <?php
                if (isset($_GET['page'])) {
                    $page = $_GET['page'];
                    $allowed_pages = ['add_student', 'update_question', 'score_sheet', 'score_sheet2', 'grant_access', 'set_table', 'edit_student', 'delete_question', 'set_time' ];

                    if (in_array($page, $allowed_pages)) {
                        include($page . '.php');
                    } else {
                        echo "<p>Page not found.</p>";
                    }
                } else {
                    echo "<p>Welcome to the Admin Panel. Please select an action from the left menu.</p>";
                }
                ?>
            </div>

        </div>
    </div>
</body>
</html>
