require 'config.php'; if ($_SERVER['REQUEST_METHOD'] != "POST") { header("HTTP/1.1 405 Method Not Allowed"); header("Allow: POST"); die(""); } Authentication::require_login(); include DIR_LIB . 'helpers/ui.php'; include DIR_LIB . 'helpers/timetable.php'; $clash = false; $d_o_w = array(1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday", 7 => "Sunday"); if (isset($_POST['do_alloc'])) { if (!empty(TimetableLesson::get($where = array('id' => $_POST['lesson_id'])))) { $palloc = new TimetablePeriodAllocation(); $palloc->setAttendingUserId(Authentication::get_user()); $palloc->setLessonId($_POST['lesson_id']); $palloc->save(); header("Location: //" . APP_ROOT_URL . 'timetable.php'); die; } } ?> <head> <?php head(); ?> </head> <body>