コード例 #1
0
 protected function report()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         $role = $student->getacctType();
         $sid = NULL;
         if ($student->checkStudent()) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             $sid = $student->getID();
         } else {
             if (isset($_GET['uid'])) {
                 $sid = $_GET['uid'];
             }
         }
         if ($sid) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/attendence_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php';
             $stu = new StudentProfile($objPDO);
             $stu->loadByUserId($sid);
             $roll_number = $stu->getRollNo();
             $name = $stu->getName();
             $section = new StudentSection($objPDO);
             $section_id = $section->getByStudentId($sid);
             $sec = new Section($objPDO, $section_id);
             $section_name = $sec->getCode();
             $att = new Attendence($objPDO);
             $total_days = $att->getBySectionId($section_id);
             $attendance = $att->getByStudentId($stu->getID());
             $present = 0;
             $absent = 0;
             foreach ($attendance as $key => $value) {
                 if ($value['presence'] == 1) {
                     $present++;
                 } else {
                     if ($value['presence'] == 0) {
                         $absent++;
                     }
                 }
             }
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/report_view.php';
         } else {
             echo 'error';
         }
     } else {
         header('Location:http://localhost/cloud');
     }
 }
コード例 #2
0
 protected function teacherview()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher()) {
         if ($user->checkAdmin()) {
             $teacher = $_GET['uid'];
         } else {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php';
             $teacherProfile = new Teacher($objPDO);
             $teacherProfile->loadByUserId($student->getID());
             $teacher = $teacherProfile->getID();
         }
         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/timetable_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php';
         $tt = new Timetable($objPDO);
         $sec = new Section($objPDO);
         $timetable = $tt->getByTeacherId($teacher);
         $subject = $tt->getTeacherSubject($teacher);
         $section = $sec->getSectionArray();
         $total = 0;
         $count = array();
         foreach ($timetable as $key => $value) {
             $total++;
             if (array_key_exists($value, $count)) {
                 $count[$value]++;
             } else {
                 $count[$value] = 1;
             }
         }
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/teacher_timetable_view_template.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
コード例 #3
0
 protected function view()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true) {
         require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php';
         require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
         $teacherProfile = new Teacher($objPDO);
         $subject = new Subject($objPDO);
         $teacherProfile->loadByUserId($_GET['uid']);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/viewemployee.php';
     } else {
         if ($student->checkTeacher() == true) {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
             $teacherProfile = new Teacher($objPDO);
             $subject = new Subject($objPDO);
             $teacherProfile->loadByUserId($student->getID());
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/employee_profile.php';
         } else {
             header('Location:http://localhost/cloud');
         }
     }
 }
コード例 #4
0
 protected function view()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher()) {
         $role = $student->getacctType();
         require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
         require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/parent_class.php';
         $studentProfile = new StudentProfile($objPDO);
         $parent = new StudentParent($objPDO);
         $parent->loadByStudentId($_GET['uid']);
         $studentProfile->loadByUserId($_GET['uid']);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/viewstudent.php';
     } else {
         if ($student->checkStudent()) {
             $role = $student->getacctType();
             require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/parent_class.php';
             $studentProfile = new StudentProfile($objPDO);
             $parent = new StudentParent($objPDO);
             $student_id = $student->getID();
             $parent->loadByStudentId($student_id);
             $studentProfile->loadByUserId($student_id);
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/viewstudent.php';
         } else {
             header('Location:http://localhost/cloud');
         }
     }
 }