Пример #1
0
 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();
 }
Пример #2
0
function add_section_form()
{
    $days = array("mwf" => "M/W/F", "tth" => "T/Th");
    $buildings = array("Honlden Hall" => "Holden Hall", "Computer Science" => "Computer Science", "Electrical Engineering" => "Electrical Engineering", "Civil Engineering" => "Civil Engineering");
    $years = array();
    for ($i = CURRENT_YEAR + 1; $i > CURRENT_YEAR - 10; $i--) {
        $years[$i] = $i;
    }
    $courses = all_course_data();
    dom::h3('section-title', 'Add Section:');
    dom::push_div('section');
    dom::push_form();
    dom::textinput('section_number', 'Section Number:');
    dom::textinput('crn', 'CRN:');
    dom::textinput('capacity', 'Capacity:');
    dom::textinput('enrollment', 'Enrollment:');
    dom::textinput('room', 'Room:');
    dom::label('Building:');
    dom::dropdown('building', $buildings);
    dom::textinput('time', 'Time:');
    dom::label('Course:');
    dom::dropdown('course_id', $courses);
    dom::label('Days:');
    dom::dropdown('days', $days);
    dom::label('Semester:');
    dom::dropdown('semester', list_semesters());
    dom::label('Year:');
    dom::dropdown('year', $years);
    dom::label('Lecture Style:');
    dom::dropdown('lecture_type', array('ftf' => 'Face to face', 'dis' => 'Distance lecture'));
    dom::hidden('action', 'add_section');
    dom::submit();
    dom::pop();
    dom::pop();
}
Пример #3
0
<?php

print list_semesters();