From 4553b566a9ed888b1d3a6c45396ef478d7a95d98 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 23 Apr 2025 20:19:00 +0530 Subject: [PATCH 1/2] stock changes 23-04-2025 --- app/Controllers/Report.php | 2 +- app/Helpers/datetime_helper.php | 44 ++- app/Views/report_emp.php | 525 +++++++++++++++----------------- app/Views/reportslink.php | 4 +- 4 files changed, 270 insertions(+), 305 deletions(-) diff --git a/app/Controllers/Report.php b/app/Controllers/Report.php index 22cff088..f2c78550 100755 --- a/app/Controllers/Report.php +++ b/app/Controllers/Report.php @@ -1193,7 +1193,7 @@ class Report extends BaseController $day = array(); - $DateofJoiningInString = $Employee->DateofJoining; + $DateofJoiningInString = $Employee->DateofJoining; $DateofJoining = date_create($DateofJoiningInString); // print_r($DateofJoining); // $doj_month = date_format($DateofJoining, "n"); diff --git a/app/Helpers/datetime_helper.php b/app/Helpers/datetime_helper.php index 75a9dd26..a39ee72d 100755 --- a/app/Helpers/datetime_helper.php +++ b/app/Helpers/datetime_helper.php @@ -79,40 +79,34 @@ if (!function_exists('get_date_format')) { // } if (!function_exists('format_date')) { - function format_date($dateString, $days = 0,$format = 'Y-m-d') + function format_date($dateString, $days = 0, $format = 'Y-m-d') { - // Check if the input is already a Unix timestamp - if (is_numeric($dateString) && (string) (int) $dateString === $dateString) { - $date = strtotime($dateString); - } else { - // Use date_create() to create a DateTime object + // If already a DateTime object + if ($dateString instanceof DateTime) { + $date = $dateString; + } + // If Unix timestamp + elseif (is_numeric($dateString) && (string) (int) $dateString === (string) $dateString) { + $date = new DateTime(); + $date->setTimestamp((int) $dateString); + } + // If string + else { $date = date_create($dateString); } - - // If $date is false, meaning parsing failed, return null + if (!$date) { return null; } - - // Subtract the specified number of days from the date if $days is provided + + // Modify date if ($days != 0) { - // If $date is a Unix timestamp, modify it using strtotime() - if (is_numeric($dateString) && (string) (int) $dateString === $dateString) { - $date = strtotime("-$days day", $date); - } else { - // If $date is a DateTime object, modify it using DateTime::modify() - date_modify($date, "-$days day"); - } - } - - // If $date is a Unix timestamp, format it using date() - if (is_numeric($dateString) && (string) (int) $dateString === $dateString) { - return date($format, $date); - } else { - // If $date is a DateTime object, format it using DateTime::format() - return date_format($date, $format); + $date->modify("-{$days} days"); } + + return $date->format($format); } + } if (!function_exists('get_financial_year')) { diff --git a/app/Views/report_emp.php b/app/Views/report_emp.php index 63c4588a..acbe3e4e 100755 --- a/app/Views/report_emp.php +++ b/app/Views/report_emp.php @@ -1,303 +1,274 @@ + - -
-
-
- -
- -
-
-

Employee Performance
- input->post('financialyear')){ - $ab=$this->input->post('financialyear'); - echo '('.$ab.')'; - echo ' '; - - } - if($this->input->post('month')){ - $m=$this->input->post('month'); - echo '('.$m.')'; - echo ' '; - } - - ?> -

- -
- -
+ .dataTables_filter input { + padding: 4px; + } -
+ .dataTables_filter { + /* width: 50%; */ + float: right; + text-align: right; + } -
- - - -
- -
- -
+ .dataTables_paginate { + width: 50%; + float: right; + text-align: right; + } + + div.dt-buttons { + position: relative; + /* float: right; */ + + } + + +
+
+ +
+ +
+
+
+
+
+
-
- -
- -
- - - -
-

- - -
- - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - uri->total_segments(); - $ab=$this->uri->segment($last); - foreach($per as $index =>$rel) - { - //echo $index; - //echo - ?> - - - - - - - - - - - - - - - - - - -
EmpIDEmployee Name Status
Month
Year
Total DaysPresent DaysPercentageTotal DaysPresent DaysPercentage
- Eid;?> - ename;?>active == 1){ - echo 'Active'; - }else - { - echo 'In Active'; - } - ?>monthworked;?>monthpercentage;?>
- -
-
-
- -
- -
-
+ +
+ +
+
+
+ + +
+
+ +
+ + +
+
+ +
+ +
+
+ +
+ +
+ +
+ + + +
+ +

+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $rel) + { + //echo $index; + //echo + ?> + + + + + + + + + + + + + + + + + + +
EmpIDEmployee Name Status
Month
Year
Total DaysPresent DaysPercentageTotal DaysPresent DaysPercentage
+ Eid;?> + ename;?>active == 1){ + echo 'Active'; + }else + { + echo 'In Active'; + } + ?>monthworked;?>monthpercentage;?>
+
+
+
+
+
+ + + + + + + + + + + + - - - - - - - - \ No newline at end of file diff --git a/app/Views/reportslink.php b/app/Views/reportslink.php index 8725d7c6..150d7d0d 100644 --- a/app/Views/reportslink.php +++ b/app/Views/reportslink.php @@ -56,7 +56,7 @@

  Finance Reports

Cost Center

-

Production Salary Cost

+
@@ -88,7 +88,7 @@

  Attendance

-

Employee Performance

+

Employee Performance

Leave Report

From ea0d9afaaf27271f6111d6ca1826220397d8f222 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 24 Apr 2025 09:07:52 +0530 Subject: [PATCH 2/2] stock changes 23-04-2025 --- app/Controllers/Report.php | 2 ++ app/Views/report_emp.php | 51 +++++++++++++++++++++++++++----------- app/Views/reportslink.php | 16 ++++++------ 3 files changed, 47 insertions(+), 22 deletions(-) diff --git a/app/Controllers/Report.php b/app/Controllers/Report.php index 9db52041..b2d01671 100755 --- a/app/Controllers/Report.php +++ b/app/Controllers/Report.php @@ -1170,10 +1170,12 @@ class Report extends BaseController $ab = $this->request->getPost('financialyear'); + $data['ab'] = $ab; $fa = substr((string)$ab, 0, -5); $aa = substr((string)$ab, 5, 5); $m = $this->request->getPost('month'); + $data['m'] = $m; //print_r($prod); diff --git a/app/Views/report_emp.php b/app/Views/report_emp.php index acbe3e4e..9e8f9c59 100755 --- a/app/Views/report_emp.php +++ b/app/Views/report_emp.php @@ -87,8 +87,12 @@ foreach($fy as $item): {?> + + - + @@ -104,19 +108,38 @@
diff --git a/app/Views/reportslink.php b/app/Views/reportslink.php index 5149411d..ca030c4e 100644 --- a/app/Views/reportslink.php +++ b/app/Views/reportslink.php @@ -40,15 +40,15 @@