<?php
include 'db_connection.php';
session_start();

// Check if student is logged in
if (!isset($_SESSION['student_id'])) {
    header("Location: login.php");
    exit();
}

$student_id = $_SESSION['student_id'];

// Mark notifications as read
$sql_update_notifications = "UPDATE notifications SET unread_count = 0 WHERE user_id = ?";
$stmt_update_notifications = $conn->prepare($sql_update_notifications);
$stmt_update_notifications->bind_param("i", $student_id);
$stmt_update_notifications->execute();
$stmt_update_notifications->close();

$conn->close();
?>
