diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php index a8a6a4d5..ae289a5c 100755 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -279,7 +279,9 @@ class Employeedetails extends BaseController $Nominee = $this->request->getPost('nomineename'); $createdby = $this->session->get('userId'); $is_management_team = $this->request->getPost('is_management_team'); + $is_management_team = ($is_management_team != '') ? '1' : '0'; $is_driver = $this->request->getPost('is_driver'); + $is_driver = ($is_driver != '') ? '1' : '0'; $TDS_Rate = $this->request->getPost('TDS_Rate'); $tds_applicable=$this->request->getPost('tds_applicable'); @@ -346,7 +348,7 @@ class Employeedetails extends BaseController 'esi_applicable' => $esi_applicable, 'pf_applicable' => $pf_applicable, 'work_location' => $work_location, - 'is_driver' => ($is_driver === null || $is_driver === '') ? 0 : $is_driver, + 'is_driver' => $is_driver, ); //print_r($Employee);die(); @@ -783,7 +785,9 @@ class Employeedetails extends BaseController $Nominee = $this->request->getPost('nomineename'); $chked = $this->request->getPost('isactive'); $is_management_team = $this->request->getPost('is_management_team'); + $is_management_team = ($is_management_team != '') ? '1' : '0'; $is_driver = $this->request->getPost('is_driver'); + $is_driver = ($is_driver != '') ? '1' : '0'; $esi_applicable = $this->request->getPost('esi_applicable'); $pf_applicable = $this->request->getPost('pf_applicable'); $work_location = $this->request->getPost('work_location'); @@ -854,7 +858,7 @@ class Employeedetails extends BaseController 'ESI' => $esino, 'NomineeDetails' => $Nominee, 'is_management_team' => $is_management_team, - 'is_driver' => ($is_driver === null || $is_driver === '') ? 0 : $is_driver, + 'is_driver' => $is_driver, 'esi_applicable' => $esi_applicable, 'pf_applicable' => $pf_applicable, 'work_location' => $work_location, diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 469b535f..5dfe7175 100755 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -149,8 +149,8 @@ class Monthlypay extends BaseController $data['sundayarray'] = $sundayarray; $data['monthdays'] = $monthdays; $data['datefordropdown'] = $current; - $data['attendance'] = $this->monthlypay_model->monthlyAttendance($current); - $data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string); + $data['attendance'] = $this-> monthlypay_model->monthlyAttendance($current); + $data['emppay'] = $this-> monthlypay_model->getEmpPayDetails($current,$string); $leavedate = $this->monthlypay_model->employeeLeaveDates($month . "-" . $year); $employeeLeaveDate = []; @@ -201,7 +201,7 @@ class Monthlypay extends BaseController $phpdata = json_decode((string)$jsondata, true); $date = $this->request->getPost('param2'); $NoofDays = $this->request->getPost('param3'); - $Month_Year = format_date($date); + $Month_Year = date('Y-m-d',strtotime($date)); $CreateBy = $this->session->get('userId'); // echo 'from COn' . $date; // print_r($phpdata);die();[Paid Leave diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php index c3d58b5c..e003788a 100755 --- a/app/Models/Monthlypay_model.php +++ b/app/Models/Monthlypay_model.php @@ -55,28 +55,6 @@ class Monthlypay_model extends Model } - function getEmpPayDetails_attendance_old($current = "", $s = "") - { - - $month_val = date('m', strtotime($current)); - $year_val = date('Y', strtotime($current)); - $date_val = cal_days_in_month(CAL_GREGORIAN, $month_val, $year_val); - //$monthyear_val = date('Y-m',strtotime($current)); - $lastdate = $year_val . '-' . $month_val . '-' . $date_val; - $builder = $this->db->table('t_employee_details') - ->select('t_employee_details.EmpID,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.is_driver') - //->join('t_emp_pay_data','t_emp_pay_data.EmpID=t_employee_details.EmpID','Left') - ->where('t_employee_details.IsActive', 1) - ->where('t_employee_details.is_driver !=', 1) - ->where('t_employee_details.DateofJoining <=', $lastdate) - ->orderBy('EmpID', 'asc'); - $query = $builder->get(); - $result = $query->getResult(); - // $last_query = $this->db->getLastQuery(); - // echo $last_query;die; - return $result; - } - function getEmpPayDetails($current = "", $s = "") { @@ -88,12 +66,9 @@ class Monthlypay_model extends Model $builder = $this->db->table('t_employee_details') ->select('t_employee_details.EmpID,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.is_driver') //->join('t_emp_pay_data','t_emp_pay_data.EmpID=t_employee_details.EmpID','Left') - ->join('t_monthly_pay_inputs as p','p.EmpID=t_employee_details.EmpID','Left') ->where('t_employee_details.IsActive', 1) ->where('t_employee_details.is_driver !=', 1) ->where('t_employee_details.DateofJoining <=', $lastdate) - ->where("p.Month_Year IS NULL OR - STR_TO_DATE(p.Month_Year, '%m-%Y') <=", $lastdate) ->orderBy('EmpID', 'asc'); $query = $builder->get(); $result = $query->getResult(); @@ -215,7 +190,7 @@ class Monthlypay_model extends Model ->where('t_employee_details.DateofJoining <= ', $lastdate) ->where('t_attendance.Month_Year', $current) ->where('t_employee_details.is_driver', 0) - ->where('t_employee_details.IsActive',1) + // ->where('t_employee_details.IsActive',1) ->orderBy('t_attendance.EmpID', 'asc'); $query = $builder->get();