From 10fa80b1d1a2b856340a784b188db4130a5f14d4 Mon Sep 17 00:00:00 2001 From: velz2020 Date: Mon, 13 Nov 2017 16:10:54 +0530 Subject: [PATCH] ATTENDANCE ISSUES FIXED --- application/controllers/monthlypay.php | 4 ++-- application/models/payroll_model.php | 2 +- application/views/attendance.php | 14 ++++++++------ application/views/monthlypayinputs.php | 2 +- application/views/publicholidays.php | 14 ++++++++------ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/application/controllers/monthlypay.php b/application/controllers/monthlypay.php index 87722165..49faab27 100755 --- a/application/controllers/monthlypay.php +++ b/application/controllers/monthlypay.php @@ -64,7 +64,7 @@ class monthlypay extends BaseController $hname = $d->Holiday_Name; - $hdate = $d->Date; + $hdate = date_format(date_create($d->Date),'Y-m-d'); $tostore = array('H_Name'=>$hname,'H_Date'=>$hdate); $isExist = $this->monthlypay_model->checkHoliday($hdate); @@ -178,7 +178,7 @@ class monthlypay extends BaseController $res = $this->monthlypay_model->saveAttendance($monthattendance,$Month_Year,$EmpID); - echo $res; +// echo $res; $total = $total + $res; // die(); } diff --git a/application/models/payroll_model.php b/application/models/payroll_model.php index 7fed0613..342665ca 100755 --- a/application/models/payroll_model.php +++ b/application/models/payroll_model.php @@ -226,7 +226,7 @@ class Payroll_model extends CI_Model // echo $source.'-'.$year1.'-'.$year2; $this->db->distinct(); - $this->db->select('Pay.EmpID,Emp.FirstName as FName ,Emp.LastName as Lname,sum(Loan_Amount) as Loan_Amount,sum(Paid_Amount) as Paid_Amount'); + $this->db->select('Pay.EmpID,Emp.FirstName as FName ,Emp.LastName as Lname,sum(loan.Loan_Amount) as Loan_Amount,sum(loan.Paid_Amount) as Paid_Amount'); $this->db->from('T_Emp_Pay_Data Pay'); $this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID'); $this->db->join('T_Loan_Master loan', 'Pay.EmpID = loan.EmpID'); diff --git a/application/views/attendance.php b/application/views/attendance.php index 0af86b06..496eaf0a 100644 --- a/application/views/attendance.php +++ b/application/views/attendance.php @@ -203,7 +203,7 @@ $attendance = array_merge($attendance,$emppay); echo form_input($data);?>
- +
@@ -313,7 +313,7 @@ $attendance = array_merge($attendance,$emppay); S.NO Employee ID - Employee Name + Employee Name - - EmpID;?> - FirstName.'-'.$a->LastName;?> + + EmpID;?> + FirstName.'-'.$a->LastName;?> ; + var publicholidays = ; + var totaldays = ; totaldays = (totaldays * 2)+3; //console.log(totaldays); @@ -712,7 +714,7 @@ function myFunction(p,i,v) document.getElementById(totalhrsid).innerHTML = parseFloat(totalworkingHrs).toFixed(2);// == ''?0:parseFloat(totalworkingHrs)); document.getElementById(totalothrsid).innerHTML = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs)); document.getElementById(paidleaveid).innerHTML = parseFloat(paidleave).toFixed(2); - document.getElementById(daysworkedid).innerHTML = parseFloat((totalworkingHrs/8)+4).toFixed(2); + document.getElementById(daysworkedid).innerHTML = parseFloat((totalworkingHrs/8)+sundays+publicholidays).toFixed(2); document.getElementById(absentid).innerHTML = parseFloat(absent).toFixed(2); } diff --git a/application/views/monthlypayinputs.php b/application/views/monthlypayinputs.php index 28635c4c..616bfeeb 100755 --- a/application/views/monthlypayinputs.php +++ b/application/views/monthlypayinputs.php @@ -329,7 +329,7 @@ $('html').bind('keypress', function(e) if(data) { $('#content').loader('hide'); - alert(data); +// alert(data); var trHTML=""; var obj =JSON.parse(data); var temparray = []; diff --git a/application/views/publicholidays.php b/application/views/publicholidays.php index 270810d1..34142c04 100644 --- a/application/views/publicholidays.php +++ b/application/views/publicholidays.php @@ -17,7 +17,7 @@ $(function() { $("#hdate").datepicker({ - dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true,yearRange: '-100:+0' + dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); }); $('html').bind('keypress', function(e) @@ -99,14 +99,15 @@ $('html').bind('keypress', function(e) { $index++; - - ?> + $date = date_create($day->H_Date); + $date = date_format($date,'d-m-Y'); + ?> - H_Name)){echo $day->H_Name;}else{echo "NO DATA";}?> - H_Date)){echo $day->H_Date;}else{echo "NO DATA";}?> + H_Name)){echo $day->H_Name;}else{echo "NO DATA";}?> + @@ -157,7 +158,7 @@ $('html').bind('keypress', function(e)