protected function delete() { global $db; $params = array(); if ($this->method == "POST") { if (sizeof($this->args) == 2) { $type = $this->args[0]; $main_arg = $this->args[1]; if (is_numeric($main_arg)) { if ($type == "subject") { $params["sid"] = $main_arg; return delete_subject($db, $params); } else { if ($type == "topic") { $params["tid"] = $main_arg; return delete_topic($db, $params); } else { if ($type == "section") { $params["section_id"] = $main_arg; return delete_section($db, $params); } else { if ($type == "example") { $params["eid"] = $main_arg; return delete_example($db, $params); } else { return "No such object exists in the database!"; } } } } } else { return "The associated id needs to be a numerical value!"; } } else { return "This requires two parameters: the object type and associated id!"; } } else { return "This only accepts POST requests!"; } }
header("Location:loginstaff.php"); } if (!isset($_SESSION['year'])) { session_regenerate_id(true); session_write_close(); header("Location:quarterstaff.php"); } if (isset($_POST['course'])) { $_SESSION['course'] = $_POST['course']; } if (isset($_POST['remove'])) { //set this course to 'deleted' set_section('deleted', $_SESSION['course'], $_SESSION['dept'], $_POST['section'], $_SESSION['year'], $_SESSION['season']); } if (isset($_POST['delete'])) { delete_section($_SESSION['course'], $_SESSION['dept'], $_POST['section'], $_SESSION['year'], $_SESSION['season']); } if (isset($_POST['add'])) { //set this course to 'added' set_section('added', $_SESSION['course'], $_SESSION['dept'], $_POST['section'], $_SESSION['year'], $_SESSION['season']); } if (isset($_POST['new'])) { //add this new section. //if we have discussion and lab, let's input that. if (isset($_POST['day1']) && isset($_POST['day2'])) { new_section($_POST['crn'], $_SESSION['dept'], $_SESSION['course'], $_POST['addingsection'], $_SESSION['year'], $_SESSION['season'], $_POST['day'], $_POST['lecturestart'], $_POST['lectureend'], $_POST['day1'], $_POST['discstart'], $_POST['discend'], $_POST['day2'], $_POST['labstart'], $_POST['labend']); } else { if (isset($_POST['day1'])) { new_section($_POST['crn'], $_SESSION['dept'], $_SESSION['course'], $_POST['addingsection'], $_SESSION['year'], $_SESSION['season'], $_POST['day'], $_POST['lecturestart'], $_POST['lectureend'], $_POST['day1'], $_POST['discstart'], $_POST['discend']); } else { if (isset($_POST['day2'])) {