90 lines
2.3 KiB
PHP
Executable File
90 lines
2.3 KiB
PHP
Executable File
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class emppaydate_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 emppayListing()
|
|
{
|
|
$this->db->select('T_Emp_Pay_Data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
|
|
$this->db->from('T_Emp_Pay_Data');
|
|
$this->db->join('T_Employee_Details','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID');
|
|
$query = $this->db->get();
|
|
$result = $query->result();
|
|
return $result;
|
|
}
|
|
|
|
function deleteEmployeePay($EmpID)
|
|
{
|
|
$this->db->where('EmpID',$EmpID);
|
|
$query = $this->db->delete('T_Emp_Pay_Data');
|
|
return $query;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addNewemppay($emppay)
|
|
{
|
|
$this->db->trans_start();
|
|
$this->db->insert('T_Emp_Pay_Data', $emppay);
|
|
|
|
$paydataid = $this->db->insert_id();
|
|
|
|
$this->db->trans_complete();
|
|
|
|
return $emppay;
|
|
}
|
|
function getUserInfo($paydataid)
|
|
{
|
|
$this->db->select('T_Emp_Pay_Data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
|
|
$this->db->from('T_Emp_Pay_Data');
|
|
$this->db->join('T_Employee_Details','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID');
|
|
//$this->db->where('isDeleted', 0);
|
|
//$this->db->where('roleId !=', 1);
|
|
$this->db->where('T_Emp_Pay_Data.Pay_Data_ID', $paydataid);
|
|
$query = $this->db->get();
|
|
//print_r($query->result());
|
|
//die();
|
|
return $query->result();
|
|
}
|
|
|
|
|
|
function editemppay($emppaydatas)
|
|
{
|
|
|
|
$paydateid=$emppaydatas['Pay_Data_ID'];
|
|
//echo $paydateid;
|
|
//print_r($emppaydatas);die();
|
|
|
|
$this->db->where('Pay_Data_ID' ,$paydateid);
|
|
$this->db->update('T_Emp_Pay_Data',$emppaydatas);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
function viewemppay($emppaydata, $paydateid)
|
|
{
|
|
$this->db->where('Pay_Data_ID', $paydateid);
|
|
$this->db->update('T_Emp_Pay_Data', $emppaydata);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
}
|
|
?>
|