81 lines
2.4 KiB
PHP
Executable File
81 lines
2.4 KiB
PHP
Executable File
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class monthlypay_model extends CI_Model
|
|
{
|
|
|
|
/**
|
|
* This function is used to get the user listing count
|
|
* @param string $searchText : This is optional search text
|
|
* @param number $page : This is pagination offset
|
|
* @param number $segment : This is pagination limit
|
|
* @return array $result : This is result
|
|
*/
|
|
function monthlyListing()
|
|
{
|
|
$this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
|
|
$this->db->from('T_Monthly_Pay_Inputs');
|
|
$this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID');
|
|
|
|
$this->db->order_by("Month_Year", "desc");
|
|
$query = $this->db->get();
|
|
|
|
$result = $query->result();
|
|
return $result;
|
|
}
|
|
|
|
|
|
|
|
function addNewmonthlisting($m_list)
|
|
{
|
|
$this->db->trans_start();
|
|
$this->db->insert('T_Monthly_Pay_Inputs', $asset);
|
|
|
|
$Asset_Code = $this->db->insert_id();
|
|
|
|
$this->db->trans_complete();
|
|
|
|
return $m_list;
|
|
}
|
|
function getUserInfo($EmpID,$month_year)
|
|
{
|
|
$this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
|
|
$this->db->from('T_Monthly_Pay_Inputs');
|
|
$this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID');
|
|
//$this->db->where('isDeleted', 0);
|
|
//$this->db->where('roleId !=', 1);
|
|
$this->db->where('T_Monthly_Pay_Inputs.EmpID', $EmpID);
|
|
$this->db->where('T_Monthly_Pay_Inputs.Month_Year', $month_year);
|
|
$query = $this->db->get();
|
|
|
|
return $query->result();
|
|
}
|
|
|
|
|
|
function editmonth($monthdata, $EmpID)
|
|
{
|
|
$monthyear=$monthdata['Month_Year'];
|
|
|
|
|
|
//$this->db->where('EmpID',$employeeid);
|
|
$this->db->where('EmpID' ,$EmpID);
|
|
//$this->db->where('Month_Year' ,$EmpID);
|
|
$this->db->where('Month_Year',$monthyear);
|
|
$this->db->update('T_Monthly_Pay_Inputs',$monthdata);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
function viewmonth($monthdata, $employeeid)
|
|
{
|
|
$this->db->order_by('Month_Year');
|
|
$this->db->where('EmpID', $employeeid);
|
|
$this->db->update('T_Monthly_Pay_Inputs', $monthdata);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
}
|
|
?>
|