<?php
declare(strict_types=1);
require_once __DIR__ . '/../includes/config.php';
// Legacy endpoint retained for old links. The unified attendance page handles submission securely.
$query=[];if(isset($_POST['course_id']))$query['course_id']=(int)$_POST['course_id'];if(isset($_POST['qr_token']))$query['token']=(string)$_POST['qr_token'];if(isset($_POST['attendance_code'])){$_SESSION['legacy_attendance_code']=(string)$_POST['attendance_code'];}
redirect('student/submit-attendance.php'.($query?'?'.http_build_query($query):''));
