D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
jnclnmuac
/
public_html
/
cas
/
application
/
controllers
/
admin
/
Filename :
CourseAndSubCourse.php
back
Copy
<?php /** * Controller For Handling All Requests Related To Courses And Sub-Courses * * @author Softpro India Pvt. Ltd. */ class CourseAndSubCourse extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->model('admin/UCSMappingManagement'); } public function getEntryTypesOfGivenCourseSessionAndBranch() { $branch_id = $_POST['branch_id']; $course_id = $_POST['course_id']; $session_id = $_POST['session_id']; $query = $this->UCSMappingManagement->getEntryTypesInfoBy($branch_id, $session_id, $course_id); $allEntryTypeList = $query->result(); if (sizeof($allEntryTypeList)) { $subCourseType = ""; $options = "<option value=''>All</option>"; for ($i = 0; $i < (sizeof($allEntryTypeList)); $i++) { $subCourseType = ($i == 0)?"Lateral Entry":"Regular"; if ($allEntryTypeList[$i]->ucs_rg_le_active_status == 'T') { $options .= "<option value=" . $allEntryTypeList[$i]->ucs_map_id . ">" . $subCourseType . "</option>"; } else { $options .= "<option value=" . $allEntryTypeList[$i]->ucs_map_id . " disabled>" . $subCourseType . " (This Entry Type Is Not Allowed In The Selected Course/Session)</option>"; } } $responseData = array( 'csrfName' => $this->security->get_csrf_token_name(), 'csrfHash' => $this->security->get_csrf_hash(), 'entryTypeList' => $options ); } else { $options = "<option value=''>No Entry Type Available</option>"; $responseData = array( 'csrfName' => $this->security->get_csrf_token_name(), 'csrfHash' => $this->security->get_csrf_hash(), 'entryTypeList' => $options ); } echo json_encode($responseData); } }