dashboard
This commit is contained in:
parent
8a2dabc546
commit
0b8d429c94
@ -621,58 +621,24 @@ function dateFunctionChangeVales()
|
||||
|
||||
}
|
||||
|
||||
/*this function used to speedometer month emp performances display*/
|
||||
|
||||
function monthattendance($empID ='')
|
||||
|
||||
/*this function used to speedometer month emp performances display*/
|
||||
|
||||
function monthattendance($empID ='')
|
||||
{
|
||||
|
||||
$CUR_date = date('m');
|
||||
//echo $CUR_date;
|
||||
$date = $this->input->post('datepick');
|
||||
// echo $date;die;
|
||||
$per_month = date('m',strtotime($date));
|
||||
|
||||
if($per_month > $CUR_date and empty($empID))
|
||||
{
|
||||
|
||||
$noofdays=0;
|
||||
$workdays=0;
|
||||
$EmpID = $this->input->post('id');
|
||||
$date = $this->input->post('datepick');
|
||||
//echo $date;
|
||||
$daydate = date('Y-m',strtotime($date));
|
||||
|
||||
$dates =$daydate . '-01';
|
||||
$monthabs = $this->dahsboard_Model->attendance($EmpID, $dates);
|
||||
// print_r($monthabs);
|
||||
$TotalNoofDays = $monthabs[0]->NoofDays;
|
||||
$TotalWorkingDays = $monthabs[0]->Days_Worked;
|
||||
// print_r($TotalNoofDays);die;
|
||||
|
||||
$noofdays =$TotalNoofDays;
|
||||
$workdays =$TotalWorkingDays;
|
||||
$performances = round(($workdays / $noofdays) * 100);
|
||||
$month['CUR_month']=$noofdays;
|
||||
$month['values']=$workdays;
|
||||
$month['present_percentage']= $performances;
|
||||
|
||||
}
|
||||
|
||||
$date = date('Y-m');
|
||||
//echo $date;
|
||||
$dates = $date . '-01';
|
||||
$EmpID = '';
|
||||
if(empty($empID)){
|
||||
$EmpID = $this->input->post('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$date = date('Y-m');
|
||||
//echo $date;
|
||||
$dates = $date . '-01';
|
||||
|
||||
//$EmpID = '';
|
||||
|
||||
//if(empty($empID))
|
||||
// {
|
||||
$EmpID = $this->input->post('id');
|
||||
//}
|
||||
//else
|
||||
// {
|
||||
//$EmpID = $empID;
|
||||
//}
|
||||
$EmpID = $empID;
|
||||
}
|
||||
// echo $EmpID;die;
|
||||
$monthabs = $this->dahsboard_Model->attendance($EmpID, $dates);
|
||||
$persent_month = date('t');//current month of days 31
|
||||
@ -693,7 +659,6 @@ function monthattendance($empID ='')
|
||||
$CURMONTH = date('m');
|
||||
|
||||
$datejoin = $this->dahsboard_Model->joindate($EmpID);
|
||||
// print_r($datejoin);die;
|
||||
$DateofJoiningInString = $datejoin[0]->DateofJoining;
|
||||
$DateofJoining = date_create($DateofJoiningInString);
|
||||
$doj_month = date_format($DateofJoining, "n");
|
||||
@ -716,14 +681,11 @@ function monthattendance($empID ='')
|
||||
{
|
||||
if ($weeks == $key)
|
||||
{
|
||||
|
||||
//print_r($key);
|
||||
if ($value != 0)
|
||||
{
|
||||
// echo $value;
|
||||
//echo $value;
|
||||
$values[] = $value;
|
||||
// $totalwhhours=$values;
|
||||
//echo $values;
|
||||
|
||||
|
||||
}
|
||||
//echo $values;
|
||||
@ -746,56 +708,54 @@ function monthattendance($empID ='')
|
||||
}
|
||||
}
|
||||
|
||||
$totalwhhours = array_sum($values);
|
||||
//echo $totalwhhours;
|
||||
|
||||
$totalothour = array_sum($otvalues);
|
||||
//$totalwhhour = sizeof($values);
|
||||
$totalwhhours = array_sum($values);
|
||||
|
||||
|
||||
$totalwhhour = $totalwhhours/8;
|
||||
$totalwhhour = $totalwhhours/8;
|
||||
//echo $totalwhhour;
|
||||
if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
|
||||
{
|
||||
//echo $doj_day;
|
||||
$month['CUR_month'] = $CURDATE - $doj_day + 1;
|
||||
$data['CUR_month'] = $CURDATE - $doj_day + 1;
|
||||
//print_r($month);
|
||||
}
|
||||
else
|
||||
{
|
||||
$month['CUR_month'] = $date;
|
||||
$data['CUR_month'] = $date;
|
||||
}
|
||||
|
||||
if ($totalwhhour != 0)
|
||||
{
|
||||
|
||||
|
||||
$year = date('Y');
|
||||
$current_month = date('m');
|
||||
|
||||
$month['values'] = $totalwhhour;
|
||||
$data['values'] = $totalwhhour;
|
||||
//$data['salaryInCurrentday'] = round($salaryInCurrentday);
|
||||
$month['present_percentage'] = round(($totalwhhour / $month['CUR_month']) * 100);
|
||||
$data['present_percentage'] = round(($totalwhhour / $month['CUR_month']) * 100);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
$month['values'] = 0;
|
||||
$data['values'] = 0;
|
||||
//$data['salaryInCurrentday'] = 0;
|
||||
$month['present_percentage'] = 0;
|
||||
$data['present_percentage'] = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(empty($empID)){
|
||||
echo json_encode($month);
|
||||
echo json_encode( $data);
|
||||
}
|
||||
else{
|
||||
return $month;
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*this function used to speedometer year emp performances display*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user