?
Current Path : /home1/savoy/www/savoyglobal.net/ccnerp/application/controllers/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoyglobal.net/ccnerp/application/controllers/examination.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Examination extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('mastermodel'); $this->load->model('studentmodel'); $this->load->model('examinationmodel'); $this->load->helper('to_pdf'); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if ($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } function viewinexaminationsearch($modelfunction, $page, $pagenum) { $output = $this->examinationmodel->$modelfunction($pagenum); $data['viewinfo'] = $output['results']; $this->load->view('examination/' . $page . '', $data); } function addinexamination($modelfunction, $page) { $data = array(); $postdata = $this->get_post_values(); $data = $this->examinationmodel->$modelfunction($postdata); $this->viewinexaminationsearch($data['resfunction'], $page, $_SESSION['pagenum']); $this->load->view('message', $data); } function edit_page($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Permission Denied"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['id'] = $id; $this->load->view('examination/' . $page, $data); } } function single_page($id, $table, $field, $page, $return_page = '') { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 0); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Permission Denied"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['id'] = $id; $this->load->view('examination/' . $page, $data); } } function edit_grade_level($id) { $data['grade'] = $this->mastermodel->get_data_srow('exam_grade_level', $id, 'gradelevel_id'); $this->load->view('examination/edit_grade_level', $data); } function get_examination_subject($class_name_id, $date) { $class_room_id = $this->mastermodel->get_single_field_value('class_name', 'class_room_id', 'class_name_id', $class_name_id); $sub = $this->mastermodel->get_data('subject', $class_room_id, 'class_room_id'); $student = $this->studentmodel->get_student_class_allocation_details($class_name_id, $this->mastermodel->convertdateformat($date)); $data = array(); $data['subject'] = $sub; $data['std'] = $student; $data['class_name_id'] = $class_name_id; $data['date'] = $date; $data['sub_count'] = count($sub); $this->load->view('examination/student_evaluation_marks', $data); } function delete_subject($subject_id) { $num = $this->mastermodel->get_num_rows('evaluation_student', 'evaluation_subject_id', $subject_id); if ($num > 0) echo 0; else { $this->mastermodel->deletedata('subject', $subject_id, 'subject_id'); echo 1; } } function generate_report_card($modelfunction, $page) { $data = array(); $postdata = $this->get_post_values(); $data = $this->examinationmodel->$modelfunction($postdata); $data['postdata'] = $postdata; $data['company'] = $this->mastermodel->get_data_srow('nursery', '1', 'nursery_id'); $title = $postdata['title']; $page = 'pdf' . $page; if (!empty($data['result'])) { $html = $this->load->view('examination/' . $page, $data, TRUE); pdf_create($html, $title); } else { redirect('master/index/' . $_SESSION['current_mode'] . '/11'); } } function loadExamDetails($student_id, $academic_year_id) { $data = array(); $data['student_id'] = $student_id; $data['academic_year_id'] = $academic_year_id; $output = $this->examinationmodel->getExamDetails($student_id, $academic_year_id); $data['exam_details'] = $output['result']; $data['subject_list'] = $output['subject']; $data['student_sem_details'] = $this->examinationmodel->getStudentSemDetails($student_id, $academic_year_id); $data['effort'] = $this->mastermodel->getdatas('effort_behavior', 'effort_behavior_id'); $data['student_effort'] = $this->mastermodel->get_data_dual('student_effort_details', $student_id, 'student_id', $academic_year_id, 'academic_year_id'); $this->load->view('examination/loadexamdetails', $data); } }