/** * Fetches Batch Id of a Student, * Member_id must be set before calling this function * @return int the Batch_id of student */ public function fetchBatchId() { $member_id = $this->getMember_id(true); $student_class_object = new Acad_Model_StudentClass(); $student_class_object->setMember_id($member_id); $batch_identifier_class_id = $student_class_object->fetchBatchIdentifierClassId(); $class_object = new Acad_Model_Class(); $class_object->setClass_id($batch_identifier_class_id); $class_object->fetchInfo(); $batch_id = $class_object->getBatch_id(); return $batch_id; }
/** * Fetches information about a class on the basis of Class_id * * @param int $class_id */ private function findClassInfo($class_id) { $class = new Acad_Model_Class(); $class->setClass_id($class_id); $info = $class->fetchInfo(); if ($info instanceof Acad_Model_Class) { $class_info = array(); $class_info['class_id'] = $info->getClass_id(); $class_info['batch_id'] = $info->getBatch_id(); $class_info['semester_id'] = $info->getSemester_id(); $class_info['semester_type'] = $info->getSemester_type(); $class_info['semester_duration'] = $info->getSemester_duration(); $class_info['handled_by_dept'] = $info->getHandled_by_dept(); $class_info['start_date'] = $info->getStart_date(); $class_info['completion_date'] = $info->getCompletion_date(); $class_info['is_active'] = $info->getIs_active(); return $class_info; } else { return false; } }
private function generateReport($member_id) { $class_ids = $this->getAllClassIds($member_id); $member_data = array(); for ($i = 1; $i < 9; $i++) { $member_data['SEMESTER ' . $i] = '----'; } $member_data['TENTH BOARD'] = '----'; $member_data['TENTH MARKS'] = '----'; $member_data['TENTH YEAR'] = '----'; $member_data['TWELFTH BOARD'] = '----'; $member_data['TWELFTH MARKS'] = '----'; $member_data['TWELFTH YEAR'] = '----'; $member_data['AIEEE RANK'] = '----'; $member_data['LEET RANK'] = '----'; if (is_array($class_ids)) { $class_backlog_count = array(); foreach ($class_ids as $class_id) { $cnt = $this->getSemesterBackLogCount($member_id, $class_id); $class_backlog_count[$class_id]['backlogs'] = $cnt; } foreach ($class_backlog_count as $class_id => $array) { $cls = new Acad_Model_Class(); $cls->setClass_id($class_id); $cls_inf = $cls->fetchInfo(); if ($cls_inf instanceof Acad_Model_Class) { $semester_id = $cls->getSemester_id(); } if ($class_backlog_count[$class_id]['backlogs'] == 0) { unset($class_backlog_count[$class_id]['backlogs']); $student = new Acad_Model_Member_Student(); $student->setMember_id($member_id); $dmc_info_id = $student->fetchLatestDmcInfoId($class_id); if (!empty($dmc_info_id)) { $dmc_info = new Acad_Model_Course_DmcInfo(); $dmc_info->setDmc_info_id($dmc_info_id); $info = $dmc_info->fetchInfo(); if ($info instanceof Acad_Model_Course_DmcInfo) { $total_marks = $info->getMax_marks(); $marks_obtained = $info->getMarks_obtained(); } $percentage = 100 * ($marks_obtained / $total_marks); $percentage = round($percentage, 2); $member_data['SEMESTER ' . $semester_id] = $percentage . ' % '; } } else { $member_data['SEMESTER ' . $semester_id] = $class_backlog_count[$class_id]['backlogs']; } } foreach ($member_data as $k => $value) { if (empty($value)) { $member_data[$k] = '----'; } } $matric_data = $this->fetchMatricData($member_id); $member_data['TENTH BOARD'] = $matric_data['board']; $member_data['TENTH MARKS'] = $matric_data['marks_obtained']; $member_data['TENTH YEAR'] = $matric_data['passing_year']; $twelfth_data = $this->fetchTwelfthData($member_id); $member_data['TWELFTH BOARD'] = $twelfth_data['board']; $member_data['TWELFTH MARKS'] = $twelfth_data['marks_obtained']; $member_data['TWELFTH YEAR'] = $twelfth_data['passing_year']; $aieee_data = $this->fetchCompetitiveExamData('AIEEE', $member_id); if (empty($aieee_data['all_india_rank'])) { $member_data['AIEEE RANK'] = '----'; } else { $member_data['AIEEE RANK'] = $aieee_data['all_india_rank']; } $leet_data = $this->fetchCompetitiveExamData('LEET', $member_id); if (empty($leet_data['all_india_rank'])) { $member_data['LEET RANK'] = '----'; } else { $member_data['LEET RANK'] = $leet_data['all_india_rank']; } return $member_data; } }