function list_prof_past_courses_form() { $courses = all_course_data(); $instructors = all_teachers_data(); $since_year = array(); for ($i = 1; $i < 30; $i++) { $since_year[$i] = $i; } /* * currently selected values */ $current_instructor = get($_SESSION, 'instructor'); $current_n = get($_SESSION, 'n'); dom::h3('section-title', 'View Instructor\'s Teaching History'); dom::push_div('section'); dom::push_form(); dom::label('Instructor:'); dom::dropdown('instructor', $instructors, $current_instructor, true); dom::label('Past Year:'); dom::dropdown('n', $since_year, $current_n, true); dom::hidden('action', 'instructor_history'); dom::pop(); if (isset($_SESSION['instructor'])) { $teaching_history = list_teaching_history($_SESSION['instructor'], CURRENT_YEAR - $_SESSION['n']); while ($row = mysql_fetch_assoc($teaching_history)) { dom::label($row['year']); } } dom::pop(); }
function render_body() { $username = $this->get_username(); prof_course_pref_form($username); prof_load_pref_form($username); prof_special_request_form($username); $semester = CURRENT_SEMESTER; if (isset($_SESSION['semester'])) { $semester = $_SESSION['semester']; } $year = CURRENT_YEAR; if (isset($_SESSION['year'])) { $year = $_SESSION['year']; } $sections = get_sections_assigned_to($this->get_username(), $semester, $year); dom::h3('section-title', 'Assigned to me'); dom::push_div('section'); dom::push_form('prefs.php'); dom::label('semester:'); dom::dropdown('semester', list_semesters(), $semester, true); dom::label('year:'); dom::dropdown('year', list_years(), $year, true); dom::hidden('action', 'set_semester'); dom::br(); dom::pop(); dom::push_table(); dom::push_tr(); dom::th('Course Code'); dom::th('Title'); dom::th('Time'); dom::th('Days'); dom::th('Room'); dom::th('Building'); dom::th('Semester'); dom::th('Year'); dom::pop(); while ($r = mysql_fetch_assoc($sections)) { dom::push_tr(); dom::td($r['code']); dom::td($r['title']); dom::td($r['time']); dom::td($r['days']); dom::td($r['room']); dom::td($r['building']); dom::td($r['semester']); dom::td($r['year']); dom::pop(); } dom::pop(); dom::pop(); }
function render_body() { dom::h3('', 'Raw SQL'); dom::push_form('lists.php'); dom::textarea("sql"); dom::br(); dom::hidden('action', 'sql'); dom::submit(); dom::pop(); list_instructors(); list_sections(); list_books(); list_courses(); }
function render_body() { dom::h3("center", "logout successful."); }
function prof_special_request_form($username) { $courses = all_course_data(); dom::h3('section-title', 'Special Reqeusts'); dom::push_div('section'); dom::push_form(); dom::label('Course:'); dom::dropdown('course_id', $courses); dom::textinput('title', 'Title'); dom::label('Justification'); dom::textarea('justification'); dom::hidden('username', $username); dom::hidden('action', 'special_request'); dom::br(); dom::submit(); dom::pop(); dom::pop(); }
private function render_head() { /* * begin HTML rendering... */ dom::init($this); dom::push_body(); /* * this displays the last error that mySQL encountered, if any, * and displays it. else it displays the user message if any. * * This works pretty well assuming that a single query/operation is * mode per POST. */ $mysql_error = $this->get_error(); $message = $this->get_message(); if ($mysql_error) { dom::push_div('error'); dom::h3('', $mysql_error); dom::pop(); } else { if ($message) { dom::push_div('message'); dom::h3('', $message); dom::pop(); } } /* * clear message and error */ $this->set_error(null); $this->set_message(null); }