diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index be11d5aa..c794b782 100755
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -124,6 +124,7 @@ $routes->get('employeedetails/ViewEmployee', 'Employeedetails::ViewEmployee');
$routes->get('employeedetails/downloadEmployeeDetails', 'Employeedetails::downloadEmployeeDetails');
$routes->post('employeedetails/UpdateEmployee', 'Employeedetails::UpdateEmployee');
$routes->get('exportemployee', 'Employeedetails::exportemployee');
+$routes->post('employeeHistory', 'Employeedetails::employeeHistory');
$routes->post('employeeEmailExist', 'Employeedetails::CheckEmail');
@@ -199,6 +200,7 @@ $routes->post('monthlypay/deletePublicHoliday', 'Monthlypay::deletePublicHoliday
$routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm');
$routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm');
$routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm');
+$routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1');
$routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails');
$routes->get('emppaydate/addemppaydate', 'Emppaydate::addemppaydate');
diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php
index ef53544e..8847a3f7 100755
--- a/app/Controllers/Employeedetails.php
+++ b/app/Controllers/Employeedetails.php
@@ -64,6 +64,12 @@ class Employeedetails extends BaseController
$this->loadViews("employeeListing", $this->global, $data, NULL);
}
+ function employeeHistory()
+ {
+ $Emp = $this->request->getPost('emp');
+ $result = $this->employeedetails_model->employeeHistory($Emp);
+ return $this->response->setJSON($result);
+ }
/*
Validation for Gender status Dropdown
*/
@@ -757,7 +763,7 @@ class Employeedetails extends BaseController
$ValidTill = $this->request->getPost('ValidTill');
$addinfo = $this->request->getPost('addinfo');
$driverlicense = $this->request->getPost('driverlicense');
-
+ $reason = $this->request->getPost('reason');
// dd($driverlicense);
@@ -851,7 +857,8 @@ class Employeedetails extends BaseController
'is_driver' => $is_driver,
'esi_applicable' => $esi_applicable,
'pf_applicable' => $pf_applicable,
- 'work_location' => $work_location
+ 'work_location' => $work_location,
+ 'reason' => $reason
);
//print_r($Employee);die();
$result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId);
diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php
index cbc05ff5..b25cd126 100755
--- a/app/Controllers/Monthlypay.php
+++ b/app/Controllers/Monthlypay.php
@@ -990,6 +990,22 @@ class Monthlypay extends BaseController
}
+ public function leaveApplicationPDF($leave_application_id){
+
+
+ $data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm($leave_application_id);
+ $data['company_info'] = $this->monthlypay_model->getCompanyInformation();
+
+ $html = view('leaveApplicationPDF', $data);
+ // echo $html;die;
+ $mpdf = new Mpdf();
+ $mpdf->WriteHTML($html);
+
+ $fName = $data['leave_info'][0]['emp_id'].'-LeaveApplicationForm.pdf';
+ return $mpdf->Output($fName, "D");
+
+ }
+
public function overTimeDetails()
{
$current = $this->request->getPost('monthyear') ? $this->request->getPost('monthyear') :date("m-Y");
diff --git a/app/Models/Employeedetails_model.php b/app/Models/Employeedetails_model.php
index 46dac337..2ad3d0e7 100755
--- a/app/Models/Employeedetails_model.php
+++ b/app/Models/Employeedetails_model.php
@@ -27,6 +27,18 @@ class Employeedetails_model extends Model
return $result;
}
+ public function employeeHistory($emp)
+ {
+ $builder = $this->db->table('t_employee_history as h')
+ ->select('h.old_value,h.new_value,h.column_name,DATE_FORMAT(h.created_at, "%d-%m-%Y") AS indian_date, DATE_FORMAT(h.created_at, "%h:%i:%s %p") AS indian_time, CONCAT_WS(" ", ed.FirstName, ed.LastName) AS updater_name')
+ ->join('tbl_users as u', 'u.userId = h.updated_by', 'left')
+ ->join('t_employee_details as ed', 'ed on u.EmpID = ed.EmpID', 'left')
+ ->where('h.empcode ', $emp)
+ ->orderBy('h.created_at', 'asc');
+ $query = $builder->get();
+ $result = $query->getResult();
+ return $result;
+ }
function getUserRoles()
{
diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php
index 50f42d6c..9f93e424 100755
--- a/app/Models/Monthlypay_model.php
+++ b/app/Models/Monthlypay_model.php
@@ -518,19 +518,23 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
$query = $this->db->query($sql);
return $query->getResult();
}
- public function getheringleaveApplicationForm(){
- $sql = "select leavetable.* ,Dep.DepartmentName as department,Emp.Designation as designation,
- CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS employeeFullName ,
- CONCAT_WS(' ', Emp2.FirstName, Emp2.LastName) AS creatorFullName
- from t_employee_leave_application_form as leavetable
- left join tbl_users as user on user.userId = leavetable.created_by
- left join t_employee_details as Emp2 on Emp2.EmpID = user.EmpID
- left join t_employee_details as Emp on Emp.EmpID = leavetable.emp_id
- left join t_departmentdetails as Dep on Emp.Departmentcode = Dep.DEPCode
- where leavetable.isactive = 1";
- $query = $this->db->query($sql);
+ public function getheringleaveApplicationForm($leave_id = null ){
+
+ $builder = $this->db->table("t_employee_leave_application_form as leavetable")
+ ->select("leavetable.* ,Dep.DepartmentName as department,Emp.Designation as designation")
+ ->select("CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS employeeFullName")
+ ->select("CONCAT_WS(' ', Emp2.FirstName, Emp2.LastName) AS creatorFullName")
+ ->join("tbl_users as user", "user.userId = leavetable.created_by", "left")
+ ->join("t_employee_details as Emp", "Emp.EmpID = leavetable.emp_id", "left")
+ ->join("t_employee_details as Emp2", "Emp2.EmpID = user.EmpID", "left")
+ ->join("t_departmentdetails as Dep", "Emp.Departmentcode = Dep.DEPCode", "left");
+ if (!empty($leave_id)) {
+ $builder->where('leavetable.leave_application_id', $leave_id);
+ }
+ $builder->where('leavetable.isactive', 1);
+ $query = $builder->get();
return $query->getResultArray();
- }
+ }
public function getheringemployeeinformation(){
$builder = $this->db->table("t_employee_details as Emp")
->select("Emp.EmpID,Emp.Designation,Emp.Departmentcode,Dep.DEPCode,Emp.Designation,Emp.Departmentcode,Dep.DEPCode,Dep.DepartmentName as DepartmentNamee,Dep.DepartmentName as DepartmentName")
@@ -542,6 +546,16 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
$result = $query->getResult();
return $result;
+ }
+ function getCompanyInformation()
+ {
+
+ $subQuery = "select CompanyName,replace(Address,'
','') as Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode
+ from t_company_details ";
+
+ $query = $this->db->query($subQuery);
+ return $query->getResult();
+
}
public function saveleaveApplicationForm($data,$id){
if ($id == 0) {
diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php
index e2368f60..0aa07060 100755
--- a/app/Views/addEmployeenew.php
+++ b/app/Views/addEmployeenew.php
@@ -554,7 +554,7 @@
-
+
@@ -732,7 +732,7 @@
-
+
-
+
-
-
-
- name="isactive" value="1">
-
-
@@ -402,7 +395,7 @@ if (!empty($EmpDetails)) {
-
+
+
+
+
+ name="isactive" value="1" onchange="handleCheckboxChange()">
+
+
+
+
+
+
+
+
-
+
@@ -167,7 +173,7 @@
-
+
@@ -175,7 +181,7 @@
-
+
@@ -183,7 +189,7 @@
-
+
@@ -200,11 +206,11 @@
-
+
-
-
+
diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php
index 12ca5569..4c298956 100755
--- a/app/Views/employeeListing.php
+++ b/app/Views/employeeListing.php
@@ -142,7 +142,10 @@
-
+
+
+
+
FirstName; ?> |
@@ -169,6 +172,44 @@
+
+
\ No newline at end of file
diff --git a/app/Views/leaveApplicationPDF.php b/app/Views/leaveApplicationPDF.php
new file mode 100644
index 00000000..1df89db2
--- /dev/null
+++ b/app/Views/leaveApplicationPDF.php
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+ CompanyName)) ? $company_info[0]->CompanyName : "-";
+ $CompanyAddress = (!empty($company_info) && !empty($company_info[0]->Address)) ? $company_info[0]->Address : "-";
+ $address = preg_replace('/SURVEY\s*:\s*[^,]+,/', '', $CompanyAddress);
+ $leave_application_id = (!empty($leave_info) && !empty($leave_info[0]['leave_application_id'])) ? $leave_info[0]['leave_application_id'] : "-";
+ $emp_name = (!empty($leave_info) && !empty($leave_info[0]['employeeFullName'])) ? $leave_info[0]['employeeFullName'] : "-";
+ $emp_id = (!empty($leave_info) && !empty($leave_info[0]['emp_id'])) ? $leave_info[0]['emp_id'] : "-";
+ $department = (!empty($leave_info) && !empty($leave_info[0]['department'])) ? $leave_info[0]['department'] : "-";
+ $designation = (!empty($leave_info) && !empty($leave_info[0]['designation'])) ? $leave_info[0]['designation'] : "-";
+ $start_date = (!empty($leave_info) && !empty($leave_info[0]['start_date'])) ? get_date_time_dynamical_format('Y-m-d','d-m-Y',$leave_info[0]['start_date']) : "-";
+ $end_date = (!empty($leave_info) && !empty($leave_info[0]['end_date'])) ? get_date_time_dynamical_format('Y-m-d','d-m-Y',$leave_info[0]['end_date']) : "-";
+ $no_of_days = (!empty($leave_info) && !empty($leave_info[0]['no_of_days'])) ? $leave_info[0]['no_of_days'] : "-";
+ $reason = (!empty($leave_info) && !empty($leave_info[0]['reason'])) ? $leave_info[0]['reason'] : "-";
+ $status = (!empty($leave_info) && !empty($leave_info[0]['status'])) ? $leave_info[0]['status'] : "-";
+
+ ?>
+
+
+
+
+
+ |
+
+ ' . _htmlsc($CompanyAddress) . '';
+ } ?>
+ |
+
+
+
+
+ | Leave Application Form |
+
+
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+
+
+ |
+
+
+
+ | From Date |
+ To Date |
+ No's Days |
+
+
+ |
+ |
+ |
+
+
+ |
+
+
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+
+
+
+ Employee Signatory
+ |
+
+ Authorized Signatory
+ |
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Views/overTimeDetails.php b/app/Views/overTimeDetails.php
index 5374c0bb..75fef304 100755
--- a/app/Views/overTimeDetails.php
+++ b/app/Views/overTimeDetails.php
@@ -258,7 +258,7 @@
OT_Hrs_Worked;
echo $OT;
- $totalovertimehrs[] = $record->OT_Hrs_Worked;
+ $totalOThrs[] = $record->OT_Hrs_Worked;
?>
|
@@ -275,7 +275,7 @@
// $OTSalary = ($OT_Hrs_Worked != 0) ? $OT_Hrs_Worked * $oneHoursSalary : 0;
$OTSalary = $OT * $perHrSalary;
echo number_format($OTSalary, 2);
- $totalovertimeamounts[] = $OTSalary;
+ $totalOTsalary[] = $OTSalary;
?>
@@ -292,15 +292,21 @@
|
|
- |
- Total |
- |
- |
+ Total |
-
+
|
-
+
+ |
+
+
+ |
+
+
+ |
+
+
|