<!-- teacher_availability.php -->
<!DOCTYPE html>
<html>
<head>
    <title>Teacher Availability</title>
</head>
<body>
     <?php include 'header.php'; ?>
    <h2>Set Teacher Availability</h2>
    <form action="process_availability.php" method="post">
        <label for="teacher_id">Select Teacher:</label>
        <select name="teacher_id" id="teacher_id">
            <?php
            // Fetch teachers from the database
            include 'db_connection.php';
            $result = $conn->query("SELECT teacher_id, name FROM teachers");
            while ($row = $result->fetch_assoc()) {
                echo "<option value='{$row['teacher_id']}'>{$row['name']}</option>";
            }
            ?>
        </select><br><br>

        <label for="days">Select Days:</label><br>
        <input type="checkbox" name="days[]" value="Monday"> Monday<br>
        <input type="checkbox" name="days[]" value="Tuesday"> Tuesday<br>
        <input type="checkbox" name="days[]" value="Wednesday"> Wednesday<br>
        <input type="checkbox" name="days[]" value="Thursday"> Thursday<br>
        <input type="checkbox" name="days[]" value="Friday"> Friday<br><br>

        <label for="time_slots">Select Time Slots:</label><br>
        <input type="time" name="start_time"> to <input type="time" name="end_time"><br><br>

        <button type="submit">Submit</button>
    </form>
</body>
</html>
