protected function teasubrel()
 {
     $class = $_GET['uid'];
     global $objPDO;
     $subject = array();
     include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_relations_class.php';
     $sec = new SubjectRelations($objPDO);
     include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
     include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
     $subject_array = array();
     $teacher_id = array();
     $teacher = array();
     $subject = $sec->getByClassId($class);
     for ($i = 0; $i < count($subject); $i++) {
         $subject_array[$subject[$i]] = Subject::getSubjectName($subject[$i]);
         if ($val = $this->getteasubrel($class, $subject[$i])) {
             $teacher_id[$subject[$i]] = $val;
             $teacher_profile = new Teacher($objPDO, $teacher_id[$subject[$i]]);
             $teacher[$teacher_id[$subject[$i]]] = $teacher_profile->getName($teacher_id[$subject[$i]]);
         }
     }
     include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/teacher_relation_template.php';
 }
Exemplo n.º 2
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');
     }
 }
Exemplo n.º 3
0
 public function searchBySubject($subject)
 {
     $subject_id = Subject::getSubjectNameLike($subject);
     $strQuery = "SELECT * FROM `" . $this->strTableName . "` WHERE `subject_id`='" . $subject_id . "' ;";
     $objStatement = $this->objPDO->prepare($strQuery);
     $objStatement->execute();
     $search_res = array();
     while ($arRow = $objStatement->fetch(PDO::FETCH_ASSOC)) {
         $sub_name = Subject::getSubjectName($arRow['subject_id']);
         $arRow['subject_id'] = $sub_name;
         $search_res[] = $arRow;
     }
     return $search_res;
 }