protected function subjectreportlist() { global $user; global $objPDO; $student = new student($objPDO, $user->getuserId()); $headMenu = array("username" => $student->getName()); if (($user->checkAdmin() == true || $student->checkTeacher()) && isset($_POST['exam_id']) && isset($_POST['section']) && isset($_POST['subject'])) { $role = $student->getacctType(); include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php'; include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/examination_section_subject_class.php'; include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/marks_splitup_class.php'; include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php'; include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/exam_marks_class.php'; $rel = new ExaminationSectionSubject($objPDO); $exam_id = $_POST['exam_id']; $section_id = $_POST['section']; $subject_id = $_POST['subject']; $rel->setExaminationId($exam_id); $rel->setSectionId($section_id); $rel->setSubjectId($subject_id); $id = $rel->getIDByElems(); $mark = new ExamMarks($objPDO); $mark_list = $mark->getByExamSubjectId($id); $rel->setID($id); $rel->load(); $total_marks = $rel->getTotalMarks(); $sec = new StudentSection($objPDO); $student = array(); $student = $sec->getBySectionId($section_id); $students = array(); $stupro = new StudentProfile($objPDO); $roll_numbers = array(); foreach ($student as $key => $value) { $stupro->setID($value['student_id']); $stupro->load(); $students[$value['student_id']] = $stupro->getName(); $roll_numbers[$value['student_id']] = $stupro->getRollNo(); } $split = new MarksSplitup($objPDO); $split_ups = $split->getByExamSubjectId($id); include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/section_subject_report_view.php'; } else { header('Location:http://localhost/cloud'); } }
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'); } }
protected function sectionview() { global $user; global $objPDO; $student = new Student($objPDO, $user->getuserId()); if ($student->checkStudent()) { include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php'; include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php'; $role = $student->getacctType(); $stu_pro = new StudentProfile($objPDO); $stu_pro->loadByUserId($student->getID()); $sec = new StudentSection($objPDO); $class = $sec->getByStudentId($stu_pro->getID()); } else { $class = $_GET['uid']; } $student = new student($objPDO, $user->getuserId()); $headMenu = array("username" => $student->getName()); if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) { 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); $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/section_timetable_view_template.php'; } else { header('Location:http://localhost/cloud'); } }