コード例 #1
0
 protected function newtime()
 {
     $class = $_GET['uid'];
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/timetable_settings_class.php';
         $sett = new TimetableSettings($objPDO);
         $slots = $sett->getAllSlots();
         if (!isset($slots)) {
             $num_slots = 0;
         } else {
             $num_slots = count($slots);
         }
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_teacher_subject_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/timetable_class.php';
         $rel = new SectionTeacherSubjectRelations($objPDO);
         $teasubrel = $rel->getByClass($class);
         $subjects = array();
         for ($i = 0; $i < count($teasubrel); $i++) {
             $subjects[$teasubrel[$i]['subject_id']] = Subject::getSubjectName($teasubrel[$i]['subject_id']);
         }
         $tt = new Timetable($objPDO);
         $timetable = $tt->getBySection($class);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/section_timetable.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }