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

[  Home  ][  C0mmand  ][  Upload File  ]

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

/**
 * Model For Handling All DB Operations Related To Branches
 *
 * @author Ankit Srivastava
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class BranchManagement extends CI_Model {

    function createNewBranch(array $newBranchInfo) {
        $this->db->insert('tbl_sms_branch_master', $newBranchInfo);
        return $this->db->insert_id();
    }

    function getAllBranches() {
        $this->db->select("*,TSMA.login_name addedByAdmin,TSMU.login_name updatedByAdmin");
        $this->db->from('tbl_sms_branch_master TSBM');
        $this->db->join('tbl_city_master TCM', 'TSBM.branch_city = TCM.city_id');
        $this->db->join('tbl_states_master TSM', 'TSBM.branch_state = TSM.state_id');
        $this->db->join('login_mst TSMA', 'TSBM.branch_added_by = TSMA.login_id');
        $this->db->join('login_mst TSMU', 'TSBM.branch_updated_by = TSMU.login_id');
        $this->db->order_by("TSBM.branch_updated_on", "desc");
        return $this->db->get();
    }

    function getBranchInfoBy($branch_id) {
        $this->db->select("*,TSMA.login_name addedByAdmin,TSMU.login_name updatedByAdmin");
        $this->db->from('tbl_sms_branch_master TSBM');
        $this->db->join('tbl_city_master TCM', 'TSBM.branch_city = TCM.city_id');
        $this->db->join('tbl_states_master TSM', 'TSBM.branch_state = TSM.state_id');
        $this->db->join('login_mst TSMA', 'TSBM.branch_added_by = TSMA.login_id');
        $this->db->join('login_mst TSMU', 'TSBM.branch_updated_by = TSMU.login_id');
        $this->db->where("TSBM.branch_id", $branch_id);
        return $this->db->get();
    }

    function getAllNonDeletedBrances() {
        $this->db->select('*');
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_delete_status', "F");
        return $this->db->get();
    }

    function getAllNonDeletedActiveBrances() {
        $this->db->select('*');
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_active_status', "T");
        $this->db->where('branch_delete_status', "F");
        return $this->db->get();
    }

    function getBranchInfoByName($branch_name) {
        $this->db->select('*');
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_name', $branch_name);
        return $this->db->get();
    }

    function getBranchInfoByEmail($branch_email) {
        $this->db->select('*');
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_email', $branch_email);
        return $this->db->get();
    }

    function getBranchInfoByMobile($branch_mobile) {
        $this->db->select('*');
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_mobile_no', $branch_mobile);
        return $this->db->get();
    }

    function updateBranchInfo(array $branchUpdatedInfo) {
        $this->db->where('branch_id', $branchUpdatedInfo['branch_id']);
        return $this->db->update('tbl_sms_branch_master', $branchUpdatedInfo);
    }

    function isBranchNameSafeUpdate($branch_Id, $branch_name) {
        $this->db->select("*");
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_name', $branch_name);
        $this->db->where('branch_id != ' . $branch_Id);
        $result = $this->db->get()->result();
        if (sizeof($result)) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

    function isBranchEmailSafeUpdate($branch_Id, $branch_email) {
        $this->db->select("*");
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_email', $branch_email);
        $this->db->where('branch_id != ' . $branch_Id);
        $result = $this->db->get()->result();
        if (sizeof($result)) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

    function isBranchMobileSafeUpdate($branch_Id, $branch_mobile) {
        $this->db->select("*");
        $this->db->from('tbl_sms_branch_master');
        $this->db->where('branch_mobile_no', $branch_mobile);
        $this->db->where('branch_id != ' . $branch_Id);
        $result = $this->db->get()->result();
        if (sizeof($result)) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

}

KBHT - 2023