dashboard and permissionslip

This commit is contained in:
venbatechnologies 2017-12-19 15:54:03 +05:30
parent a100e816b8
commit a2caf723a8
5 changed files with 1300 additions and 594 deletions

View File

@ -81,6 +81,7 @@ class user extends BaseController
$data['capitalbal'] = $this->dahsboard_Model->capitalbal();
/* HR DASHBOARD Controller Start*/
$data['totemp'] = $this->dahsboard_Model->totemp();
$data['totloan'] = $this->dahsboard_Model->totloan();
$data['totpay'] = $this->dahsboard_Model->totpay();
@ -90,12 +91,13 @@ class user extends BaseController
/* yesterday absent list count in employee*/
$dates = date('Y-m');
$date = $dates . '-01';
// echo $date;
$dat = date('d', strtotime("-1 days"));
//echo $date;
$WH = 'WH' . date('j', strtotime("-1 days"));
//echo($WH);die;
//echo($WH);
$yesterday = $this->dahsboard_Model->attyesterday($WH, $date);
//print_r($yesterday);die;
$values = 0;
@ -108,6 +110,7 @@ foreach ($yesterday as $weekda => $value) {
}
// echo $values;
$data['values'] = $values;
/*Today absent list count in employee*/
@ -133,8 +136,224 @@ foreach ($yesterday as $weekda => $value) {
}
// print_r($values);die;
$data['today'] = $values;
//print_r($data['today']);die;
// function todayEmployeeSalaylist()
//{
$date = date('Y-m');
//echo $date; die;
$date = $date . '-01';
$dat = date('d');
//echo $dat; die;
$WH = 'WH' . date('j');
$OT = 'OT' . date('j');
$CUR_month = date('t');
// echo $CUR_month; die;
$toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
//$EmpID = $toDayEmployee[0]->EmpID;
// print_r($toDayEmployee); die;
$EmpID = 0;
$employeeSalary = 0;
foreach ($toDayEmployee as $value) {
$values = 0;
$totalothour = 0;
if ($value[$WH] != 0) {
$totalothour = $value[$OT];
//echo $totalothour;die;
$values = 1;
//print_r($values); die;
$Empid = $value['EmpID'];
// echo $Empid; die;
$totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
//print_r($totalEmployeePersent);die;
$HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
$Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
$totalsalary = $totalEmployeePersent[0]->TotalSalary;
$dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
$Food_Allowances = $dayFoodAmt * $values;
$daySalary = $Basic_Pay / $CUR_month;
/**per day salary working hour**/
//echo $daySalary.'<br/>';
$onehoursSalary = $daySalary / 8;
/**one hour salay ot calculation**/
if ($totalothour != 0) /** if ot not equal zero **/ {
$totSalayOT = $totalothour * $onehoursSalary;
} else {
$totSalayOT = 0;
}
$currentDaySalary = $daySalary * $values;
/** current day salary working days calculation**/
$dayHra = $HRA_Amount / $CUR_month;
/** per day hra amount **/
//echo $dayHra.'<br/>';
$currentDayHra = $dayHra * $values;
/** total working days hra calculations**/
// echo $currentDayHra.'<br/>';
$currentDatePF = $currentDaySalary + $currentDayHra;
/** current date pf calculation**/
if ($totalsalary <= 20000) {
$esiAmount = $currentDatePF * 1.75 / 100;
/** esiamount not elgiable for 20000 **/
} else {
$esiAmount = 0;
}
$pfAmount = $currentDaySalary * 12 / 100;
/** pf amount per day**/
//echo $totalothour;die;
$salaryInCurrentday = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
$employeeSalary += round($salaryInCurrentday);
}
}
//$salaryInCurrentday++;
$data['employeeSalary'] = $employeeSalary;
// }
// function monthTodayEmployeeSalaylist()
// {
$date = date('Y-m');
//echo $date; die;
$date = $date . '-01';
$dat = date('d');
// $currentdaydates =date('d');
$working = array();
$overtime = array();
for ($i = 1; $i <= $dat; $i++) //echo $dat; die;
{
$Working [] = 'WH' . $i;
$overtime [] = 'OT' . $i;
$CUR_month = date('t');
// echo $CUR_month; die;
}
//print_r($WH);die;
$WH = implode(",", $Working);
$OT = implode(",", $overtime);
$salarycurrentdate = array();
$toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
//$EmpID = $toDayEmployee[0]->EmpID;
//
// print_r($toDayEmployee); die;
$employeeSalary = 0;
// for($i=1;$i<=$dat;$i++)
// {
$totalSalary = 0;
$working = explode(",",$WH);
$overtime = explode(",", $OT);
foreach ($toDayEmployee as $value) {
$values = 0;
foreach ($working as $work) {
// foreach ($overtime as $extra) {
if ($value[$work] != 0 || $value['OT'.substr($work, 2)] != 0) {
$totalothour = $value['OT'.substr($work, 2)];
//echo $totalothour;
$values = 1;
//print_r($values); die;
$Empid = $value['EmpID'];
//echo $Empid;
$totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
//print_r($totalEmployeePersent);
$HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
$Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
$totalsalary = $totalEmployeePersent[0]->TotalSalary;
$dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
$Food_Allowances = $dayFoodAmt * $values;
$daySalary = $Basic_Pay / $CUR_month;
/**per day salary working hour**/
//echo $daySalary.'<br/>';
$onehoursSalary = $daySalary / 8;
/**one hour salay ot calculation**/
if ($totalothour != 0) /** if ot not equal zero **/ {
$totSalayOT = $totalothour * $onehoursSalary;
} else {
$totSalayOT = 0;
}
$currentDaySalary = $daySalary * $values;
/** current day salary working days calculation**/
$dayHra = $HRA_Amount / $CUR_month;
/** per day hra amount **/
//echo $dayHra.'<br/>';
$currentDayHra = $dayHra * $values;
/** total working days hra calculations**/
// echo $currentDayHra.'<br/>';
$currentDatePF = $currentDaySalary + $currentDayHra;
/** current date pf calculation**/
if ($totalsalary <= 20000) {
$esiAmount = $currentDatePF * 1.75 / 100;
/** esiamount not elgiable for 20000 **/
} else {
$esiAmount = 0;
}
$pfAmount = $currentDaySalary * 12 / 100;
/** pf amount per day**/
//echo $totalothour;die;
$salaryInCurrentday = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
$totalSalarys = $totalSalary + $salaryInCurrentday;
$totalSalary =round($totalSalarys);
// $salarycurrentdate[] = $salaryInCurrentday;;
}
// }
//print_r($salarycurrentdate);
// $currentmonthsalary = array_sum($salarycurrentdate);
// $totalSalary = $totalSalary + $salarycurrentdate;
// $salaryInCurrentday++;
// echo $totalSalary;
//print_r($currentmonthsalary);
}
}
$data['totalSalary']= $totalSalary;
//}
@ -144,103 +363,372 @@ $data['today'] = $values;
function attendancemonth()
// function attendancemonth()
// {
// // $EmpID='';
// $date = date('Y-m');
// //echo $date;
// $dates = $date.'-01';
// $EmpID= $this->input->post('id');
// //echo $dates; die;
// //echo $weekabs;die;
// $monthabs = $this->dahsboard_Model->attendance($EmpID,$dates);
// //print_r($data['monthabs']);
// //$todate = $this->input->get('todate');
// $persent_month = date('t');
// //$current_month_day = cal_days_in_month(CAL_GREGORIAN,$persent_month,$year);
// //$current_month_day;die;
// $values=0;
// $otvalues = array();
// $CUR_month = date('t');
// //die();
// $weekdays = array();
// $otHours = array();
// $date = date('d');
// //echo $date; die;
// for($i=1;$i<=$persent_month;$i++)
// {
// //if($date > 0 ){
// $weekdays[] = 'WH'.$i;
// $otHours[] ='OT'.$i;
// //print_r($weekdays);
// }
// //print_r($weekdays);die;
// foreach ($monthabs as $weekda ) {
// //print_r($weekda);
// foreach ($weekda as $key => $value) {
// //print_r($key);die;
// //print_r($value);
// foreach ($weekdays as $weeks) {
// //print_r($weeks);
// //print_r($key);
// if($weeks == $key)
// {
// if($value != 0){
// //echo $values;
// $values++;
// // echo $values;
// }
// }
// }
// foreach($otHours as $ot){
// if($ot == $key){
// if($value != 0){
// $otvalues []= $value;
// // echo $otvalue;
// }
// //echo $otvalues;
// }
// }
// }
// }
// //echo $values;die;
// $totalothour = array_sum($otvalues);
// if($values !=0){
// $currentDateSalary=$this->dahsboard_Model->daysalary($EmpID,$dates);
// $HRA_Amount = $currentDateSalary[0]->HRA_Amount;
// $Basic_Pay = $currentDateSalary[0]->Basic_Pay;
// $totalsalary = $currentDateSalary[0]->TotalSalary;
// $dayFoodAmt = $currentDateSalary[0]->Food_Allowances;
// $Food_Allowances =$dayFoodAmt * $values;
// $daySalary=$Basic_Pay/$CUR_month; /**per day salary working hour**/
// //echo $daySalary.'<br/>';
// $onehoursSalary =$daySalary/8; /**one hour salay ot calculation**/
// if($totalothour !=0){ /** if ot not equal zero **/
// $totSalayOT=$totalothour*$onehoursSalary;
// }else{
// $totSalayOT = 0;
// }
// $currentDaySalary=$daySalary*$values; /** current day salary working days calculation**/
// $
// $dayHra =$HRA_Amount/$CUR_month; /** per day hra amount **/
// //echo $dayHra.'<br/>';
// $currentDayHra =$dayHra * $values; /** total working days hra calculations**/
// // echo $currentDayHra.'<br/>';
// $currentDatePF =$currentDaySalary+$currentDayHra; /** current date pf calculation**/
// if($totalsalary <= 20000){
// $esiAmount = $currentDatePF *1.75/100; /** esiamount not elgiable for 20000 **/
// }else{
// $esiAmount = 0;
// }
// $pfAmount = $currentDaySalary *12/100; /** pf amount per day**/
// //echo $totalothour;die;
// $salaryInCurrentday=$currentDaySalary+$totSalayOT+ $currentDayHra +$Food_Allowances;
// //echo $salaryInCurrentday;die;
// $year = date('Y');
// $current_month = date('m');
// //echo $current_month;die;
// //$current_month_days = cal_days_in_month(CAL_GREGORIAN,$current_month,$year);
// //echo $current_month_days;die;
// //echo $CUR_month;// echo $current_month;die;
// // $total_days_percentage = ($values/$date);
// //print_r($total_days_percentage);die;
// $data['values'] = $values;
// $data['$salaryInCurrentday'] =$salaryInCurrentday;
// //$data['otvalues'] = $otvalues;
// //print_r($data['otvalues']);die;
// $data['present_percentage'] = round(($values/$date)*100);
// $data['CUR_month'] = $date;
// echo json_encode($data);
// }else{
// $data['CUR_month'] = $date;
// $data['values'] = 0;
// $data['$salaryInCurrentday'] = 0;
// //$data = 0;
// echo json_encode($data);
// }
// }
// function todayEmployeeSalaylist()
// {
// $date = date('Y-m');
// //echo $date; die;
// $date = $date . '-01';
// $dat = date('d');
// //echo $dat; die;
// $WH = 'WH' . date('j');
// $OT = 'OT' . date('j');
// $CUR_month = date('t');
// // echo $CUR_month; die;
// $toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
// //$EmpID = $toDayEmployee[0]->EmpID;
// // print_r($toDayEmployee); die;
// $EmpID = 0;
// $employeeSalary = 0;
// foreach ($toDayEmployee as $value) {
// $values = 0;
// $totalothour = 0;
// if ($value[$WH] != 0) {
// $totalothour = $value[$OT];
// //echo $totalothour;die;
// $values = 1;
// //print_r($values); die;
// $Empid = $value['EmpID'];
// // echo $Empid; die;
// $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
// //print_r($totalEmployeePersent);die;
// $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
// $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
// $totalsalary = $totalEmployeePersent[0]->TotalSalary;
// $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
// $Food_Allowances = $dayFoodAmt * $values;
// $daySalary = $Basic_Pay / $CUR_month;
// /**per day salary working hour**/
// //echo $daySalary.'<br/>';
// $onehoursSalary = $daySalary / 8;
// /**one hour salay ot calculation**/
// if ($totalothour != 0) /** if ot not equal zero **/ {
// $totSalayOT = $totalothour * $onehoursSalary;
// } else {
// $totSalayOT = 0;
// }
// $currentDaySalary = $daySalary * $values;
// /** current day salary working days calculation**/
// $dayHra = $HRA_Amount / $CUR_month;
// /** per day hra amount **/
// //echo $dayHra.'<br/>';
// $currentDayHra = $dayHra * $values;
// /** total working days hra calculations**/
// // echo $currentDayHra.'<br/>';
// $currentDatePF = $currentDaySalary + $currentDayHra;
// /** current date pf calculation**/
// if ($totalsalary <= 20000) {
// $esiAmount = $currentDatePF * 1.75 / 100;
// /** esiamount not elgiable for 20000 **/
// } else {
// $esiAmount = 0;
// }
// $pfAmount = $currentDaySalary * 12 / 100;
// /** pf amount per day**/
// //echo $totalothour;die;
// $salaryInCurrentday = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
// $employeeSalary += round($salaryInCurrentday);
// }
// }
// //$salaryInCurrentday++;
// echo $employeeSalary;
// die;
// }
// function monthTodayEmployeeSalaylist()
// {
// $date = date('Y-m');
// //echo $date; die;
// $date = $date . '-01';
// $dat = date('d');
// // $currentdaydates =date('d');
// $working = array();
// $overtime = array();
// for ($i = 1; $i <= $dat; $i++) //echo $dat; die;
// {
// $Working [] = 'WH' . $i;
// $overtime [] = 'OT' . $i;
// $CUR_month = date('t');
// // echo $CUR_month; die;
// }
// //print_r($WH);die;
// $WH = implode(",", $Working);
// $OT = implode(",", $overtime);
// $salarycurrentdate = array();
// $toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
// //$EmpID = $toDayEmployee[0]->EmpID;
// //
// // print_r($toDayEmployee); die;
// $employeeSalary = 0;
// // for($i=1;$i<=$dat;$i++)
// // {
// $totalSalary = 0;
// $working = explode(",",$WH);
// $overtime = explode(",", $OT);
// foreach ($toDayEmployee as $value) {
// $values = 0;
// foreach ($working as $work) {
// // foreach ($overtime as $extra) {
// if ($value[$work] != 0 || $value['OT'.substr($work, 2)] != 0) {
// $totalothour = $value['OT'.substr($work, 2)];
// //echo $totalothour;
// $values = 1;
// //print_r($values); die;
// $Empid = $value['EmpID'];
// //echo $Empid;
// $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
// //print_r($totalEmployeePersent);
// $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
// $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
// $totalsalary = $totalEmployeePersent[0]->TotalSalary;
// $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
// $Food_Allowances = $dayFoodAmt * $values;
// $daySalary = $Basic_Pay / $CUR_month;
// /**per day salary working hour**/
// //echo $daySalary.'<br/>';
// $onehoursSalary = $daySalary / 8;
// /**one hour salay ot calculation**/
// if ($totalothour != 0) /** if ot not equal zero **/ {
// $totSalayOT = $totalothour * $onehoursSalary;
// } else {
// $totSalayOT = 0;
// }
// $currentDaySalary = $daySalary * $values;
// /** current day salary working days calculation**/
// $dayHra = $HRA_Amount / $CUR_month;
// /** per day hra amount **/
// //echo $dayHra.'<br/>';
// $currentDayHra = $dayHra * $values;
// /** total working days hra calculations**/
// // echo $currentDayHra.'<br/>';
// $currentDatePF = $currentDaySalary + $currentDayHra;
// /** current date pf calculation**/
// if ($totalsalary <= 20000) {
// $esiAmount = $currentDatePF * 1.75 / 100;
// /** esiamount not elgiable for 20000 **/
// } else {
// $esiAmount = 0;
// }
// $pfAmount = $currentDaySalary * 12 / 100;
// /** pf amount per day**/
// //echo $totalothour;die;
// $salaryInCurrentday = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
// $totalSalary = $totalSalary + $salaryInCurrentday;
// // $salarycurrentdate[] = $salaryInCurrentday;;
// }
// // }
// //print_r($salarycurrentdate);
// // $currentmonthsalary = array_sum($salarycurrentdate);
// // $totalSalary = $totalSalary + $salarycurrentdate;
// // $salaryInCurrentday++;
// // echo $totalSalary;
// //print_r($currentmonthsalary);
// }
// }
// echo $totalSalary;
// }
public function getFinancialStartDate()
{
// $EmpID='';
$date = date('Y-m');
//echo $date;
$dates = $date.'-01';
$EmpID= $this->input->post('id');
//echo $dates;
//echo $weekabs;die;
$monthabs = $this->dahsboard_Model->attendance($EmpID,$dates);
//print_r($data['monthabs']);
//$todate = $this->input->get('todate');
$persent_month = date('t');
//$current_month_day = cal_days_in_month(CAL_GREGORIAN,$persent_month,$year);
//$current_month_day;die;
$values=0;
//die();
$weekdays = array();
$date = date('d');
//echo $date;
for($i=1;$i<=$persent_month;$i++)
{
//if($date > 0 ){
$weekdays[] = 'WH'.$i;
//print_r($weekdays);
}
//print_r($weekdays);die;
foreach ($monthabs as $weekda ) {
//print_r($weekda);
foreach ($weekda as $key => $value) {
//print_r($key);die;
//print_r($value);
foreach ($weekdays as $weeks) {
//print_r($weeks);
//print_r($key);
if($weeks == $key)
{
if($value != 0){
// echo $value;
$values++;
// echo $values;
}
}
}
}
}
//echo $values;die;
//print_r($week);
$year = date('Y');
$current_month = date('m');
//echo $current_month;die;
//$current_month_days = cal_days_in_month(CAL_GREGORIAN,$current_month,$year);
//echo $current_month_days;die;
$CUR_month = date('t');
//echo $current_month;die;
// $total_days_percentage = ($values/$date);
//print_r($total_days_percentage);die;
$data['values'] = $values;
$data['present_percentage'] = round(($values/$date)*100);
$data['CUR_month'] = $date;
echo json_encode($data);
}
public function getFinancialStartDate() {
$CURMONTH = date('n');
$CURYEAR = date('Y');
$FINYEAR = 0;
@ -255,7 +743,8 @@ public function getFinancialStartDate() {
return $result;
}
public function getFinancialEndDate() {
public function getFinancialEndDate()
{
$CURMONTH = date('n');
$CURYEAR = date('Y');
$FINYEAR = 0;
@ -286,7 +775,6 @@ $datejoin=$this->dahsboard_Model->joindate($EmpID);
$DateofJoining = date_create($DateofJoiningInString);
$finStart = $this->getFinancialStartDate();
$finEnd = $this->getFinancialEndDate();
@ -306,10 +794,8 @@ $doj_day= date_format($DateofJoining,"j");
$joinedMonthWorkingDayCount = $joinedMonthDaysCount - $doj_day;
$joinedMonthDays = 0;
for($j=$doj_day;$j<=$joinedMonthDaysCount;$j++)
{
for ($j = $doj_day; $j <= $joinedMonthDaysCount; $j++) {
$weekdays[] = 'WH' . $j;
}
foreach ($JoinedMonthAttendance as $day) {
@ -317,8 +803,7 @@ $weekdays[] = 'WH'.$j;
foreach ($day as $key => $value) {
foreach ($weekdays as $weeks) {
if($weeks == $key)
{
if ($weeks == $key) {
if ($value != 0) {
$joinedMonthDays++;
@ -329,11 +814,10 @@ $weekdays[] = 'WH'.$j;
}
}
$result = $this->dahsboard_Model->attendanceyear($EmpID, $JoinedMonth + 1);
$yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
@ -349,8 +833,7 @@ $date = date('d');
$Work = array_sum($weekdays);
for($j=1;$j<=$date;$j++)
{
for ($j = 1; $j <= $date; $j++) {
$weekdays[] = 'WH' . $j;
}
foreach ($yearabs as $day) {
@ -358,8 +841,7 @@ $weekdays[] = 'WH'.$j;
foreach ($day as $key => $value) {
foreach ($weekdays as $weeks) {
if($weeks == $key)
{
if ($weeks == $key) {
if ($value != 0) {
$values++;
@ -378,8 +860,6 @@ $weekdays[] = 'WH'.$j;
//echo $TotalNoofDays.'-'.$DaysWorked;
$final_res = round(($DaysWorked / $TotalNoofDays) * 100);
// echo "------";
//echo $final_res;exit();
@ -394,7 +874,7 @@ $weekdays[] = 'WH'.$j;
// }
echo json_encode($data);
//echo json_encode($data);
} else {
@ -413,8 +893,7 @@ $date = date('d');
$Work = array_sum($weekdays);
for($j=1;$j<=$date;$j++)
{
for ($j = 1; $j <= $date; $j++) {
$weekdays[] = 'WH' . $j;
}
foreach ($yearabs as $day) {
@ -422,8 +901,7 @@ $weekdays[] = 'WH'.$j;
foreach ($day as $key => $value) {
foreach ($weekdays as $weeks) {
if($weeks == $key)
{
if ($weeks == $key) {
if ($value != 0) {
$values++;
@ -441,8 +919,6 @@ $weekdays[] = 'WH'.$j;
//echo $TotalNoofDays.'-'.$DaysWorked;
$final_res = round(($DaysWorked / $TotalNoofDays) * 100);
// echo "------";
//echo $final_res;exit();
@ -457,9 +933,163 @@ $weekdays[] = 'WH'.$j;
// }
//echo json_encode($data);
}
/**month part start**/
$date = date('Y-m');
//echo $date;
$dates = $date . '-01';
$EmpID = $this->input->post('id');
//echo $dates; die;
//echo $weekabs;die;
$monthabs = $this->dahsboard_Model->attendance($EmpID, $dates);
//print_r($data['monthabs']);
//$todate = $this->input->get('todate');
$persent_month = date('t');
//$current_month_day = cal_days_in_month(CAL_GREGORIAN,$persent_month,$year);
//$current_month_day;die;
$values = 0;
$otvalues = array();
$CUR_month = date('t');
//die();
$weekdays = array();
$otHours = array();
$date = date('d');
//echo $date; die;
for ($i = 1; $i <= $persent_month; $i++) {
//if($date > 0 ){
$weekdays[] = 'WH' . $i;
$otHours[] = 'OT' . $i;
//print_r($weekdays);
}
//print_r($weekdays);die;
foreach ($monthabs as $weekda) {
//print_r($weekda);
foreach ($weekda as $key => $value) {
//print_r($key);die;
//print_r($value);
foreach ($weekdays as $weeks) {
//print_r($weeks);
//print_r($key);
if ($weeks == $key) {
if ($value != 0) {
//echo $values;
$values++;
// echo $values;
}
}
}
foreach ($otHours as $ot) {
if ($ot == $key) {
if ($value != 0) {
$otvalues [] = $value;
// echo $otvalue;
}
//echo $otvalues;
}
}
}
}
//echo $values;die;
$totalothour = array_sum($otvalues);
if ($values != 0) {
$currentDateSalary = $this->dahsboard_Model->daysalary($EmpID, $dates);
$HRA_Amount = $currentDateSalary[0]->HRA_Amount;
$Basic_Pay = $currentDateSalary[0]->Basic_Pay;
$totalsalary = $currentDateSalary[0]->TotalSalary;
$dayFoodAmt = $currentDateSalary[0]->Food_Allowances;
$Food_Allowances = $dayFoodAmt * $values;
$daySalary = $Basic_Pay / $CUR_month;
/**per day salary working hour**/
//echo $daySalary.'<br/>';
$onehoursSalary = $daySalary / 8;
/**one hour salay ot calculation**/
if ($totalothour != 0) {
/** if ot not equal zero **/
$totSalayOT = $totalothour * $onehoursSalary;
} else {
$totSalayOT = 0;
}
$currentDaySalary = $daySalary * $values;
/** current day salary working days calculation**/
$dayHra = $HRA_Amount / $CUR_month;
/** per day hra amount **/
//echo $dayHra.'<br/>';
$currentDayHra = $dayHra * $values;
/** total working days hra calculations**/
// echo $currentDayHra.'<br/>';
$currentDatePF = $currentDaySalary + $currentDayHra;
/** current date pf calculation**/
if ($totalsalary <= 20000) {
$esiAmount = $currentDatePF * 1.75 / 100;
/** esiamount not elgiable for 20000 **/
} else {
$esiAmount = 0;
}
$pfAmount = $currentDaySalary * 12 / 100;
/** pf amount per day**/
//echo $totalothour;die;
$salaryInCurrentday = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
//echo $salaryInCurrentday;die;
$year = date('Y');
$current_month = date('m');
//echo $current_month;die;
//$current_month_days = cal_days_in_month(CAL_GREGORIAN,$current_month,$year);
//echo $current_month_days;die;
//echo $CUR_month;// echo $current_month;die;
// $total_days_percentage = ($values/$date);
//print_r($total_days_percentage);die;
$data['values'] = $values;
$data['salaryInCurrentday'] = round($salaryInCurrentday);
//$data['otvalues'] = $otvalues;
//print_r($data['otvalues']);die;
$data['present_percentage'] = round(($values / $date) * 100);
$data['CUR_month'] = $date;
} else {
$data['CUR_month'] = $date;
$data['values'] = 0;
$data['salaryInCurrentday'] = 0;
$data['present_percentage'] = round(($values / $date) * 100);
//echo json_encode($data);
}
/**month part end**/
echo json_encode($data);
}
}
/****************HR DASHBOART Controller END **************************************/
/**
* This function is used to load the user list
*/

View File

@ -4,6 +4,7 @@ class dahsboard_Model extends CI_Model
{
/* HR DASHBOART Model START*/
function totemp()
{
@ -55,15 +56,27 @@ $sql="select EmpID,CONCAT(FirstName,' ',LastName) as name FROM T_Employee_Detai
function attyesterday($WH,$date)
{
//echo 'model' . $WH.'-'.$date;
$sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ;
$query = $this->db->query($sql,array($date));
// print_r($query->result());
//echo count($query->result());
return $query->result_array();
}
function dayAllPersentEmpSalary($WH,$OT,$date)
{
//echo $EmpID.'-'.$dates;
$sql="select ".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)";
$sql="select EmpID,".$WH.",".$OT." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)";
$query = $this->db->query($sql,array($date));
//return
return $query->result_array();
}
function attendance($EmpID,$dates)
{
//echo $EmpID.'-'.$dates;
@ -105,6 +118,16 @@ where att.Month_Year = ? and att.EmpID = ?;";
}
function persentEmployeeDetails($EmpID){
//join T_Attendance att on att.EmpID = pay.EmpID
$sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
$query = $this->db->query($sql,array($EmpID));
return $query->result();
}
function attendanceyear($EmpID,$MONTH)
{
@ -112,20 +135,28 @@ where att.Month_Year = ? and att.EmpID = ?;";
// $sql="select Att.EmpID,Att.Month_Year,Att.*,NoofDays,Days_Worked,emp.DateofJoining from T_Attendance Att
// join T_Employee_Details as emp on emp.EmpID = Att.EmpID
// where Att.Month_Year between ? and ? and Att.EmpID = ?";
// else
// (YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 )
$sql = 'select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance where
case
when (month(Month_Year) >=4) then
(YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 )
else
(YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 )
end and EmpID = ? and month(Month_Year) != month(current_date());';
$query= $this->db->query($sql,array($MONTH, $MONTH, $EmpID));
$query= $this->db->query($sql,array($MONTH, $EmpID));
return $query->result();
}
/* HR DASHBOARD Model END*/
function totalpurchaseorder(){

View File

@ -58,6 +58,13 @@ if(!empty($EmpCount))
<?php
}
?>
<!-- HR Start part to-->
<style>
.small-box .icon {
top: 0px !important;
}
</style>
<?php
if($DEPCode == HR)
{
@ -71,12 +78,13 @@ if(!empty($EmpCount))
<section class="content">
<!-- Info boxes -->
<center>
<!-- Small boxes (Stat box) -->
<div class="row">
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="info-box" style="min-height: 79px;">
<span class="info-box-icon bg-aqua" style="height: 79px;padding:16px;"><i class="fa fa-users"></i></span>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<a href="#" class="small-box-footer"><p> <strong>TOTAL NO OF EMPLOYEES</strong> </p> </a>
<div class="inner">
<?php
if(!empty($totemp))
{
@ -84,25 +92,28 @@ if(!empty($EmpCount))
{
?>
<h3><?php echo $req->totemp;?></h3>
<p>&nbsp;</p>
<div class="info-box-content">
<span class="info-box-text" style="color:#00c0ef;text-align:center;" ><strong>TOTAL NO OF EMPLOYEES</strong></span>
<span class="info-box-number" style="color:black;text-align:center;"><?php echo $req->totemp;?></span>
</div>
<?php
}
}
?>
<!-- /.info-box-content -->
</div>
<div class="icon">
<i class="ion ion-android-contacts"></i>
</div>
<a href="#" class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<a target= "_blank" href="<?php echo base_url(); ?>loanreports"" class="small-box-footer"> <p> <strong>TOTAL LOAN</strong></p> </a>
<div class="inner">
<div class="col-md-4 col-sm-4 col-xs-12">
<a href="<?php echo base_url(); ?>loanreports">
<div class="info-box" style="min-height: 79px;">
<div class="col-md-6">
<?php if(!empty($totloan))
{
foreach($totloan as $req_p){
@ -110,16 +121,28 @@ if(!empty($EmpCount))
?>
<span class="info-box-text" style="color:#dd4b39;text-align:center;"><strong>TOTAL LOAN</strong></span>
<span class="info-box-number" style="color:black;text-align:center;"><i class="fa fa-rupee"></i><?php echo $req_p->totloan;?></span>
<h3> <i class="fa fa-rupee"></i><?php echo $req_p->totloan;?> </h3>
<p>&nbsp;</p>
<?php
}
}
?>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
<a href="#" class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<div class="col-md-6">
<!-- small box -->
<div class="small-box bg-yellow">
<a target="_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer"> <p> <strong>LOAN TO BE RECOVERED</strong> </p> </a>
<div class="inner">
<?php if(!empty($totrec))
{
foreach($totrec as $ordervalue)
@ -127,73 +150,60 @@ if(!empty($EmpCount))
{
?>
<span class="info-box-text" style="color:#00a65a; text-align:center;"><strong>LOAN TO BE RECOVERED</strong></span>
<span class="info-box-number" style="color:black; text-align:center;"><strong> <i class="fa fa-rupee"></i><?php echo $ordervalue->totrec;?></strong></span>
<h3> <i class="fa fa-rupee"></i><?php echo $ordervalue->totrec;?> </h3>
<p>&nbsp;</p>
<?php
}
}
?>
</div>
<div class="icon">
<!-- /.info-box-content -->
<i class="ion ion-calculator"></i>
</div>
</a>
<!-- /.info-box -->
</div>
<div class="col-md-4 col-sm-4 col-xs-12" style="text-align:center">
<div class="info-box" style="min-height: 79px;">
<div class ="col-md-12">
<span class="info-box-text" style="color:block;"><strong>TOTAL EMPLOYEES ABSENT</strong></span>
</div>
<div class="col-md-6 col-sm-6">
<div class="col-md-12 col-sm-12 col-xs-12"><b>YESTERDAY</b></div>
<div class="col-md-12 col-sm-12 col-xs-12" style="padding:0px;">
<!-- <a href="#"> -->
<div style="padding: 5px 10px;">
<span class="info-box-number" style="color:black;"><?php echo $values;?></span>
</div>
<!-- </a> -->
<!-- /.info-box -->
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="col-md-12 col-sm-12 col-xs-12"><b>TODAY </b></div>
<!-- /.col -->
<div class="col-md-12 col-sm-12 col-xs-12" style="padding:0px;">
<div style="padding: 5px 10px;">
<span class="info-box-number" style="color:black;"><?php echo $today;?></span>
<a class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<a href="#" class="small-box-footer"> <p> <strong>TOTAL EMPLOYEES ABSENT</strong> </p></a>
<div class="inner">
<h3> <?php echo $today;?></h3>
<p>TODAY</p>
</div>
<div class="icon">
<i class="ion ion-android-calendar"></i>
</div>
<!-- /.info-box-content -->
<a href="#" class="small-box-footer">YESTERDAY :<?php echo $values;?> </a>
</div>
</div>
<div class="row">
<!-- ./col -->
</div>
<!-- /.row -->
</center>
<div class="col-md-9" style="padding:0px;">
<!-- Emp performance box -->
<div class="box box-info">
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse" style="margin-right: 5px;">
<i class="fa fa-minus"></i></button>
</div>
<!-- /. tools -->
<div class="col-md-6 col-sm-6">
<h3 class="box-title">
<div class="col-md-8 col-sm-8">
<div style="width: 80% !important">
<?php
$options = array("0"=>'Select Employee');
//print_r( $options);
@ -208,42 +218,42 @@ if(!empty($EmpCount))
endforeach;
}
echo form_dropdown('emp', $options,set_value('emp'),'id="emp"' ,'required="true"' ,'class="form-control select2');
echo form_dropdown('emp', $options,set_value('emp'),'id="emp"' ,'class="form-control select2');
?>
</h3>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="box-body">
<div class="row">
<div class="col-md-6 col-sm-6" style="padding:0px;">
<div class="col-md-7 col-sm-7">
<div id="chart_div"></div>
</div>
<div class="col-md-6 col-sm-6">
<br><br><br>
<div class="info-box" style="min-height: 111px;">
<div class="col-md-12 col-sm-12">
<label>
<div class="col-md-5 col-sm-5">
<br>
<div class="pad box-pane-right bg-green">
<div class="description-block margin-bottom">
<h3 id="totaldays"><b>0</b></h3>
<h5 class="description-header">Working Days</h5>
No of Days Working
</label>
<div id="totaldays"><b>0</b></div>
</div>
<div class="col-md-12 col-sm-12">
<label>
<!-- /.description-block -->
<div class="description-block margin-bottom">
<h3 id="worked"><b>0</b></h3>
<h5 class="description-header">Days Present</h5>
No of Days Present
</label>
<div id="worked"><b>0</b></div>
</div>
<!-- /.description-block -->
</div>
</div>
</div>
</div>
<script type="text/javascript">
google.charts.load('current', {'packages':['gauge']});
google.charts.setOnLoadCallback(drawChart);
@ -252,7 +262,7 @@ if(!empty($EmpCount))
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['year', 0]
['Year', 0]
]);
@ -317,71 +327,101 @@ if(!empty($EmpCount))
});
</script>
<!------ Month------>
<div class="col-md-6 col-sm-6">
<div class="col-md-6 col-sm-6" style="padding:0px;">
<div class="col-md-8 col-sm-8">
<div style="width: 80% !important">
<?php
$options = array("0"=>'Select Employee');
//print_r( $options);
if(!empty($emplist))
{
foreach ($emplist as $SID):
$options[$SID->EmpID] = $SID->name.' '.' - '.' '.$SID->EmpID;
endforeach;
}
echo form_dropdown('employee', $options,set_value('employee'),'id="employee"' ,'required="true"' ,'class="form-control select2');
?>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="col-md-7 col-sm-7">
<div id="chart_divs"></div>
</div>
<div class="col-md-6 col-sm-6">
<br><br><br>
<div class="info-box" style="min-height: 111px;">
<div class="col-md-12 col-sm-12">
<label>
<div class="col-md-5 col-sm-5">
<br>
<div class="pad box-pane-right bg-red">
<div class="description-block margin-bottom">
<h3 id="total_days"><b>0</b></h3>
<h5 class="description-header">Working Days</h5>
No of Days Working
</label>
<div id="total_days"><b>0</b></div>
</div>
<div class="col-md-12 col-sm-12">
<label>
<!-- /.description-block -->
<div class="description-block margin-bottom">
<h3 id="present"><b>0</b></h3>
<h5 class="description-header">Days Present</h5>
No of Days Present
</label>
<div id="present"><b>0</b></div>
</div>
<!-- /.description-block -->
<!-- <div class="description-block" style="margin:12px !important;">
<h5 class="description-header">Salary Upto Today</h5>
<i class="fa fa-rupee"></i> <h4 id="salaryInCurrentday"><b> 0.00</b></h4>
</div> -->
<!-- /.description-block -->
</div>
</div>
</div>
</div>
<!-- /end of new box -->
<!-- /.info-box -->
</div>
</center>
</div>
</div>
</div>
<!-- /.box-body-->
<div class="col-md-3" style="padding-right: 0px;">
<!-- Emp performance box -->
<div class="box box-info">
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse" style="margin-right: 5px;">
<i class="fa fa-minus"></i></button>
</div>
<!-- /. tools -->
<h3 class="box-title">
Salary Cost
</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="col-md-12 col-sm-12">
<br>
<div class="pad box-pane-right bg-yellow">
<div class="description-block margin-bottom">
<h3 id=""><i class="fa fa-rupee"></i><b><?php echo $employeeSalary;?></b></h3>
<h5 class="description-header">Today</h5>
</div>
<!-- /.description-block -->
<div class="description-block margin-bottom">
<h3 id=""><i class="fa fa-rupee"></i><b><?php echo $totalSalary;?></b></h3>
<h5 class="description-header">This Month</h5>
</div>
<!-- /.description-block -->
</div>
</div>
</div>
<!-- /.info-box -->
</div>
</div>
<!-- /.box-body-->
</div>
<!-- /.End Of performance box -->
</div>
</div>
</div>
<!-- /.box -->
</section>
</div>
<?php
@ -395,7 +435,7 @@ if(!empty($EmpCount))
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['month', 0]
['Month', 0]
]);
@ -408,9 +448,9 @@ if(!empty($EmpCount))
};
var chart = new google.visualization.Gauge(document.getElementById('chart_divs'));
chart.draw(data, options);
$('#employee').change(function() {
$('#emp').change(function() {
// alert();
var id = $('#employee').val();
var id = $('#emp').val();
$("#monthabs").val('');
if(id != '-1')
@ -421,7 +461,7 @@ $("#monthabs").val('');
data:{id:id},
dataType: 'json',
type:"POST",
url:"<?php echo base_url();?>user/attendancemonth",
url:"<?php echo base_url();?>user/attendanceyear",
success:function(json) {
console.log(json);
@ -429,6 +469,7 @@ $("#monthabs").val('');
//alert(json.MatDetail);
$("#present").text(json.values);
$("#total_days").text(json.CUR_month);
$("#salaryInCurrentday").text(json.salaryInCurrentday);
@ -460,6 +501,10 @@ $("#monthabs").val('');
</script>
<!-- \\\\\\\\\\\\\\\ HR END of the part ////////////////////////-->
<!-- Dashboard for admin-->
<?php
if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT)

View File

@ -474,7 +474,7 @@ $(function() {
<li class="treeview">
<a href="<?php echo base_url(); ?>permissionlist">
<i class="fa fa-user-circle "></i>
<span>Permission List</span>
<span>Permission Slip</span>
</a>
</li>
</ul>

View File

@ -18,7 +18,7 @@ span.highlight {
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<CENTER><h3 class="box-title">Siddharth Industries - Permission Listing</h3></CENTER>
<CENTER><h3 class="box-title">Siddharth Industries - Employee Permission Slip Listing</h3></CENTER>
</div><!-- /.box-header -->
<!-- <?php if($DraftCount > 0 ) {?><p>
@ -28,7 +28,7 @@ span.highlight {
<div class="col-md-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<a class="btn btn-primary" onclick="Test()" href="<?php echo base_url(); ?>permission">PERMISSION FORM</a>
<a class="btn btn-primary" onclick="Test()" href="<?php echo base_url(); ?>permission">PERMISSION SLIP</a>
</div>
</div>