attendances emp-sorting issues fixed
This commit is contained in:
parent
1b4b56b43b
commit
7adfc70427
@ -31,33 +31,21 @@ class monthlypay_model extends CI_Model
|
|||||||
function getEmpPayDetails($current="",$s="")
|
function getEmpPayDetails($current="",$s="")
|
||||||
{
|
{
|
||||||
|
|
||||||
// $this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
|
|
||||||
// $this->db->from('T_Employee_Details');
|
|
||||||
// //$this->db->join('T_Emp_Pay_Data','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID','Left');
|
|
||||||
// $this->db->where('T_Employee_Details.IsActive',1);
|
|
||||||
// $this->db->order_by('EmpID','asc');
|
|
||||||
// $query = $this->db->get();
|
|
||||||
// $result = $query->result();
|
|
||||||
|
|
||||||
// return $result;
|
|
||||||
$month_val = date('m',strtotime($current));
|
$month_val = date('m',strtotime($current));
|
||||||
$year_val = date('Y',strtotime($current));
|
$year_val = date('Y',strtotime($current));
|
||||||
$date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
|
$date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
|
||||||
//$monthyear_val = date('Y-m',strtotime($current));
|
//$monthyear_val = date('Y-m',strtotime($current));
|
||||||
$lastdate = $year_val.'-'.$month_val.'-'.$date_val;
|
$lastdate = $year_val.'-'.$month_val.'-'.$date_val;
|
||||||
|
$this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
|
||||||
|
$this->db->from('T_Employee_Details');
|
||||||
|
//$this->db->join('T_Emp_Pay_Data','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID','Left');
|
||||||
|
$this->db->where('T_Employee_Details.IsActive',1);
|
||||||
|
$this->db->where('T_Employee_Details.DateofJoining <=',$lastdate);
|
||||||
|
$this->db->order_by('EmpID','asc');
|
||||||
|
$query = $this->db->get();
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
|
||||||
$sql = "select Emp.EmpID, Emp.FirstName,Emp.LastName,Emp.DateofJoining,Emp.IsActive
|
|
||||||
from T_Employee_Details as Emp
|
|
||||||
where Emp.DateofJoining <= ?
|
|
||||||
and Emp.IsActive = 1
|
|
||||||
order by Emp.EmpID
|
|
||||||
asc ";
|
|
||||||
$query = $this->db->query($sql,array($lastdate));
|
|
||||||
|
|
||||||
$result = $query->result();
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,37 +128,23 @@ class monthlypay_model extends CI_Model
|
|||||||
function monthlyAttendance($current="")
|
function monthlyAttendance($current="")
|
||||||
{
|
{
|
||||||
|
|
||||||
// $this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
|
$month_val = date('m',strtotime($current));
|
||||||
// $this->db->from('T_Attendance');
|
|
||||||
// $this->db->join('T_Employee_Details','T_Attendance.EmpID=T_Employee_Details.EmpID');
|
|
||||||
// $this->db->order_by('T_Attendance.EmpID', 'asc');
|
|
||||||
// $this->db->where('Month_Year',$current);
|
|
||||||
// $this->db->where('T_Employee_Details.IsActive',1);
|
|
||||||
|
|
||||||
// $query = $this->db->get();
|
|
||||||
|
|
||||||
// $result = $query->result();
|
|
||||||
|
|
||||||
// return $result;
|
|
||||||
$month_val = date('m',strtotime($current));
|
|
||||||
$year_val = date('Y',strtotime($current));
|
$year_val = date('Y',strtotime($current));
|
||||||
|
$date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
|
||||||
$sql = "select Emp.DateofJoining, Emp.FirstName,Emp.LastName,Att.*
|
|
||||||
from T_Attendance as Att
|
$this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
|
||||||
join T_Employee_Details as Emp
|
$this->db->from('T_Attendance');
|
||||||
on Emp.EmpID = Att.EmpID
|
$this->db->join('T_Employee_Details','T_Attendance.EmpID=T_Employee_Details.EmpID');
|
||||||
where year(Emp.DateofJoining) <= year(?)
|
// $this->db->where('year(T_Employee_Details.DateofJoining) <= ',$year_val);
|
||||||
and month(Emp.DateofJoining) <= month(?)
|
// $this->db->where('month(T_Employee_Details.DateofJoining) <= ',$month_val);
|
||||||
and Emp.IsActive = 1
|
$this->db->where('Month_Year',$current);
|
||||||
and Att.Month_Year = ?
|
$this->db->where('T_Employee_Details.IsActive',1);
|
||||||
order by Att.EmpID
|
$this->db->order_by('T_Attendance.EmpID', 'asc');
|
||||||
asc ";
|
$query = $this->db->get();
|
||||||
|
|
||||||
$query = $this->db->query($sql,array($current,$current,$current));
|
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
return $result;
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
function saveMonthlyData_model($data)
|
function saveMonthlyData_model($data)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user