D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
cas
/
application
/
models
/
admin
/
Filename :
HolidayManagement.php
back
Copy
<?php /** * Model Class For Handling All DB Operations Related To Holidays * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class HolidayManagement extends CI_Model { function createNewHoliday(array $newHolidayInfo) { $this->db->insert_batch('holiday_calender_mst', $newHolidayInfo); return $this->db->insert_id(); } function getAllHolidays() { $this->db->select("*," . "CONCAT(TPRFLA.tprfl_firstname,' ',TPRFLA.tprfl_lastname) addedByAdmin," . "CONCAT(TPRFLU.tprfl_firstname,' ',TPRFLU.tprfl_lastname) updatedByAdmin"); $this->db->from("holiday_calender_mst HCM"); $this->db->join('tbl_session_master TSM', 'HCM.session_id = TSM.session_id'); $this->db->join('tbl_staff_members TSMA', 'HCM.hc_added_by = TSMA.smember_id'); $this->db->join('tbl_profile TPRFLA', 'TSMA.smember_id = TPRFLA.tprfl_id'); $this->db->join('tbl_staff_members TSMU', 'HCM.hc_updated_by = TSMU.smember_id'); $this->db->join('tbl_profile TPRFLU', 'TSMU.smember_id = TPRFLU.tprfl_id'); $this->db->order_by("HCM.hc_date", "ASC"); return $this->db->get(); } function getHolidayByNameAndDate($hc_name,$hc_date) { $this->db->select('*'); $this->db->from('holiday_calender_mst'); $this->db->where('hc_name', $hc_name); $this->db->where('hc_date', $hc_date); return $this->db->get(); } function deleteHolidays($hc_id) { $this->db->where("hc_id", $hc_id); return $this->db->delete("holiday_calender_mst"); } }