<!-- process_availability.php -->
<?php
include 'db_connection.php';

$teacher_id = $_POST['teacher_id'];
$days = $_POST['days'];
$start_time = $_POST['start_time'];
$end_time = $_POST['end_time'];

foreach ($days as $day) {
    $sql = "INSERT INTO teacher_schedules (teacher_id, day, start_time, end_time)
            VALUES ('$teacher_id', '$day', '$start_time', '$end_time')";
    $conn->query($sql);
}

echo "Availability set successfully.";
?>
