From 500105e4c28a86ba2709e501951da68804acab10 Mon Sep 17 00:00:00 2001
From: paulcortez
Date: Thu, 31 Oct 2024 17:02:21 +0800
Subject: [PATCH] attendance log uploading
attendance log uploading
---
app/Config/App.php | 3 +-
app/Config/AuthGroups.php | 18 ++
app/Config/Routes.php | 14 +-
app/Controllers/TKController.php | 233 ++++++++++++++++++
.../2024-10-24-095430_CreateRawAttLog.php | 79 ++++++
...4-10-31-065415_CreateAttendanceSummary.php | 83 +++++++
app/Entities/AttendanceSummary.php | 21 ++
app/Entities/RawAttLog.php | 24 ++
app/Entities/Settings.php | 2 +-
app/Models/AttendanceSummaryModel.php | 66 +++++
app/Models/PayrollTypeModel.php | 2 +-
app/Models/RawAttLogModel.php | 72 ++++++
app/Models/SettingsModel.php | 22 +-
.../templates/adminlte/generalcontent.php | 22 +-
app/Views/timekeeping/attsummaryview.php | 191 ++++++++++++++
.../timekeeping/rawattendancelogview.php | 107 --------
app/Views/timekeeping/rawattloguploadview.php | 183 ++++++++++++++
17 files changed, 1010 insertions(+), 132 deletions(-)
create mode 100644 app/Controllers/TKController.php
create mode 100644 app/Database/Migrations/2024-10-24-095430_CreateRawAttLog.php
create mode 100644 app/Database/Migrations/2024-10-31-065415_CreateAttendanceSummary.php
create mode 100644 app/Entities/AttendanceSummary.php
create mode 100644 app/Entities/RawAttLog.php
create mode 100644 app/Models/AttendanceSummaryModel.php
create mode 100644 app/Models/RawAttLogModel.php
create mode 100644 app/Views/timekeeping/attsummaryview.php
delete mode 100644 app/Views/timekeeping/rawattendancelogview.php
create mode 100644 app/Views/timekeeping/rawattloguploadview.php
diff --git a/app/Config/App.php b/app/Config/App.php
index ecf4baa..aa20654 100644
--- a/app/Config/App.php
+++ b/app/Config/App.php
@@ -133,7 +133,8 @@ class App extends BaseConfig
* @see https://www.php.net/manual/en/timezones.php for list of timezones
* supported by PHP.
*/
- public string $appTimezone = 'UTC';
+ //public string $appTimezone = 'UTC';
+ public string $appTimezone = 'Asia/Manila';
/**
* --------------------------------------------------------------------------
diff --git a/app/Config/AuthGroups.php b/app/Config/AuthGroups.php
index 680fbfe..3f0ce4c 100644
--- a/app/Config/AuthGroups.php
+++ b/app/Config/AuthGroups.php
@@ -69,6 +69,10 @@ class AuthGroups extends ShieldAuthGroups
'title' => 'HR User',
'description' => 'Has access to Human Resources features.',
],
+ 'hr' => [
+ 'title' => 'Timekeeping User',
+ 'description' => 'Has access to Timekeeping features.',
+ ],
];
/**
@@ -118,6 +122,15 @@ class AuthGroups extends ShieldAuthGroups
'hr.data-upload' => 'Can upload data',
'hr.data-download' => 'Can download data',
'hr.data-export' => 'Can export data',
+
+ 'tk.data-create' => 'Can create new data',
+ 'tk.data-edit' => 'Can edit existing data',
+ 'tk.data-delete' => 'Can delete existing data',
+ 'tk.data-view' => 'Can view existing data',
+ 'tk.data-print' => 'Can print existing data',
+ 'tk.data-upload' => 'Can upload data',
+ 'tk.data-download' => 'Can download data',
+ 'tk.data-export' => 'Can export data',
];
/**
@@ -136,6 +149,7 @@ class AuthGroups extends ShieldAuthGroups
'beta.*',
'payroll.*',
'hr.*',
+ 'tk.*',
],
'admin' => [
'admin.access',
@@ -145,6 +159,7 @@ class AuthGroups extends ShieldAuthGroups
'beta.access',
'payroll.*',
'hr.*',
+ 'tk.*',
],
'developer' => [
'admin.access',
@@ -165,5 +180,8 @@ class AuthGroups extends ShieldAuthGroups
'hr' => [
'hr.*',
],
+ 'tk' => [
+ 'tk.*',
+ ],
];
}
diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index c617343..1629c91 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -11,6 +11,8 @@ $routes->get('hi', 'DashboardController::index');
$routes->get('hr', 'HRController::index');
+$routes->get('tk', 'TKController::index');
+
// Human Resources Routes
$routes->get('hr/dept', 'HRController::companyDepartment');
$routes->post('hr/adddept', 'HRController::addCompanyDepartment');
@@ -28,6 +30,8 @@ $routes->get('hr/emp', 'HRController::employee');
$routes->post('hr/addemp', 'HRController::addEmployee');
$routes->post('hr/editemp', 'HRController::editEmployee');
+$routes->get('hr/att', 'HRController::employeeInfo');
+
// Payroll Routes
$routes->get('payroll', 'PayrollController::index');
@@ -62,7 +66,6 @@ $routes->get('payroll/emppaytransrecom/(:num)', 'PayrollController::employeePayr
$routes->post('payroll/saveemppaytransaddinded', 'PayrollController::saveEmpPayTransIncomeDeduction');
$routes->get('payroll/emppaytransdelinded/(:num)/(:num)', 'PayrollController::deleteEmpPayTransIncomeDeduction/$1/$2');
-
//$routes->post('t', 'PayrollController::test');
@@ -77,4 +80,13 @@ $routes->get('adminuser/editusergroup/(:num)', 'AdministratorController::editUse
$routes->get('adminuser/edituserpermission/(:num)', 'AdministratorController::editUserPermissionView/$1');
$routes->post('adminuser/saveusergroup', 'AdministratorController::saveEditedUserGroup');
+
+// Timekeeper Routes`
+$routes->get('tk/rawattlogupload', 'TKController::rawAttendanceLogUpload');
+$routes->post('tk/rawattlogupfile/(:any)/(:any)/(:any)', 'TKController::rawAttendanceLogUploadFile/$1/$2/$3');
+$routes->get('tk/rawattlogdelete/(:any)/(:any)/(:any)', 'TKController::rawAttendanceLogDelete/$1/$2/$3');
+
+$routes->get('tk/attsummary', 'TKController::attendanceSummary');
+$routes->post('tk/attsumsave/(:any)/(:any)', 'TKController::attendanceSummarySave/$1/$2');
+
service('auth')->routes($routes);
diff --git a/app/Controllers/TKController.php b/app/Controllers/TKController.php
new file mode 100644
index 0000000..cbfcdeb
--- /dev/null
+++ b/app/Controllers/TKController.php
@@ -0,0 +1,233 @@
+to(base_url('/login'));
+ }
+
+ public function attendanceSummary()
+ {
+ $rawAttLogModel = new RawAttLogModel();
+
+ $data['payrollTransactions'] = (new PayrollTransactionModel())->orderBy('created_at', 'DESC')->findAll();
+ $data['payGroups'] = (new PayrollGroupModel())->findAll();
+
+ $rawGetData = $this->request->getGet();
+
+ if($rawGetData != null)
+ {
+ $data['selectedData'] = $rawGetData;
+
+ $attendanceSummaryModel = new AttendanceSummaryModel();
+
+ $empSummaries = $attendanceSummaryModel->where(['paytrans_id'=>$rawGetData['paytrans_id'], 'pay_group_id'=>$rawGetData['pay_group_id']])->findAll();
+
+ if($empSummaries == null)
+ {
+ $data['attendanceSummarySaved'] = false;
+
+ $payTrans = (new PayrollTransactionModel())->find($rawGetData['paytrans_id']);
+ $employeeWorkDates = $rawAttLogModel->getEmployeeDaysCount($payTrans->payroll_from, $payTrans->payroll_to);
+
+ $employeeWorkDayCount = [];
+
+ foreach($employeeWorkDates as $employeeWorkDate)
+ {
+ if(!isset($employeeWorkDayCount[$employeeWorkDate->company_issued_id]))
+ $employeeWorkDayCount[$employeeWorkDate->company_issued_id] = [
+ 'employee_id' => $employeeWorkDate->employee_id,
+ 'company_issued_id' => $employeeWorkDate->company_issued_id,
+ 'employee_name' => $employeeWorkDate->first_name . ' ' . $employeeWorkDate->last_name,
+ 'att_work_days' => 0
+ ];
+
+ $employeeWorkDayCount[$employeeWorkDate->company_issued_id]['att_work_days']++;
+ }
+
+ $data['employeeWorkDayCount'] = $employeeWorkDayCount;
+ }
+ else
+ {
+ $data['attendanceSummarySaved'] = true;
+
+ foreach($empSummaries as $empSummary)
+ $employeeWorkDayCount[] = [
+ 'employee_id' => $empSummary->employee_id,
+ 'company_issued_id' => $empSummary->company_issued_id,
+ 'employee_name' => $empSummary->employee_name,
+ 'att_work_days' => $empSummary->att_work_days
+ ];
+
+ $data['employeeWorkDayCount'] = $employeeWorkDayCount;
+ }
+ }
+
+ return view('timekeeping/attsummaryview', $data);
+ }
+
+ public function attendanceSummarySave($payTransId, $payGroupId)
+ {
+ $rawData = $this->request->getPost();
+
+ $batchEmpSummary = [];
+
+ foreach($rawData['emp_work_day_count'] as $empWorkDayCount)
+ {
+ $empSummary = explode('|', $empWorkDayCount);
+
+ $batchEmpSummary[] = [
+ 'paytrans_id' => $payTransId,
+ 'pay_group_id' => $payGroupId,
+ 'employee_id' => $empSummary[0],
+ 'company_issued_id' => $empSummary[1],
+ 'employee_name' => $empSummary[2],
+ 'att_work_days' => $empSummary[3]
+ ];
+ }
+
+ $attSummaryModel = new AttendanceSummaryModel();
+
+ if($attSummaryModel->insertBatch($batchEmpSummary, true))
+ return redirect()->back()->with('message', 'Attendance summary saved.');
+ else
+ return redirect()->back()->with('error', 'Failed to save attendance summary.');
+ }
+
+ public function rawAttendanceLogUpload()
+ {
+ $data['branches'] = (new CompanyBranchModel())->findAll();
+ $data['selectedBranch'] = $this->request->getGet('branch_code');
+ $data['attFromTo'] = $this->request->getGet('att_from_to');
+ $data['attFrom'] = $this->request->getGet('att_from');
+ $data['attTo'] = $this->request->getGet('att_to');
+
+ if($data['selectedBranch'] != null && $data['attFromTo'] != null)
+ {
+ $data['attendanceLog'] = (new RawAttLogModel())->where(['log_date >='=>$data['attFrom'], 'log_date <='=>$data['attTo']])->findAll();
+
+ $attLogHTMLTable = new \CodeIgniter\View\Table();
+ $attLogHTMLTable->setTemplate(MiscLib::adminLTETableTemplate());
+
+ if($data['attendanceLog'] == null)
+ $data['tblAttLog'] = 'No attendance log found.
';
+ else
+ {
+ $attLogHTMLTable->addRow('Employee ID', 'Log Date', 'Log Time', 'In/Out', 'Branch');
+ foreach($data['attendanceLog'] as $attLog)
+ {
+ $attLogHTMLTable->addRow($attLog->company_issued_id, $attLog->log_date, $attLog->log_time, ($attLog->log_type) ? 'Out' : 'In', $attLog->branch_code);
+ }
+
+ $data['tblAttLog'] = $attLogHTMLTable->generate();
+ }
+ }
+
+ return view('timekeeping/rawattloguploadview', $data);
+ }
+
+ public function rawAttendanceLogUploadFile($selectedBranch, $attendanceFrom, $attendanceTo)
+ {
+ $rawAttLogModel = new RawAttLogModel();
+ $batchRawAttLog = [];
+
+ $file = $this->request->getFile('att_file');
+
+ if ($file->isValid() && ! $file->hasMoved()) {
+ $name = $file->getName();
+
+ $filePath = WRITEPATH . 'uploads/attendance/' . $selectedBranch . '/' . $name;
+ $file->move(WRITEPATH . 'uploads/attendance/' . $selectedBranch, $name, true);
+
+ $data = [];
+ $fileHandle = fopen($filePath, 'r');
+
+ if($fileHandle)
+ {
+ while (($line = fgets($fileHandle)) !== false)
+ {
+ if(trim($line) == '') continue;
+
+ // Create DateTime objects for comparison
+ $dateFromFile = Time::createFromFormat('Y-m-d', substr($line, 10, 10));
+ $attFrom = Time::createFromFormat('Y-m-d', $attendanceFrom);
+ $attTo = Time::createFromFormat('Y-m-d', $attendanceTo);
+
+ // Check if the date from file falls within the specified range
+ if ($dateFromFile < $attFrom || $dateFromFile > $attTo) continue;
+
+ $batchRawAttLog[] = [
+ 'company_issued_id' => trim(substr($line, 0, 9)),
+ 'log_date' => substr($line, 10, 10),
+ 'log_time' => substr($line, 21, 8),
+ 'ucol1' => substr($line, 30, 1),
+ 'log_type' => substr($line, 32, 1),
+ 'ucol2' => substr($line, 34, 1),
+ 'ucol3' => substr($line, 36, 1),
+ 'branch_code' => $selectedBranch,
+ 'att_from' => $attendanceFrom,
+ 'att_to' => $attendanceTo,
+ 'created_at' => Time::now(),
+ 'created_by' => auth()->user()->employee_id,
+ ];
+ // 1182 2019-10-29 10:32:41 1 0 1 0
+ }
+
+ fclose($fileHandle);
+
+ if($rawAttLogModel->addBatchData($batchRawAttLog, true))
+ return redirect()->back()->with('message', 'Raw attendance log uploaded.');
+ else
+ return redirect()->back()->with('error', 'Error uploading raw attendance log.');
+ }
+ else
+ return redirect()->back()->with('error', 'Error reading the file. Please check the file and try again.');
+ }
+ else
+ return redirect()->back()->with('error', 'Error uploading file. Please check the file and try again.');
+ }
+
+ public function rawAttendanceLogDelete($branchCode, $logDateFrom, $logDAteTo)
+ {
+ $attLogModel = new RawAttLogModel();
+
+ $result = $attLogModel
+ ->where(['log_date >='=>$logDateFrom,
+ 'log_date <='=>$logDAteTo,
+ 'branch_code'=>$branchCode])
+ ->delete();
+
+ if($result)
+ return redirect()->back()->with('message', 'Raw attendance log deleted.');
+ else
+ return redirect()->back()->with('error', 'Failed to delete raw attendance log.');
+ }
+}
diff --git a/app/Database/Migrations/2024-10-24-095430_CreateRawAttLog.php b/app/Database/Migrations/2024-10-24-095430_CreateRawAttLog.php
new file mode 100644
index 0000000..d5f97d3
--- /dev/null
+++ b/app/Database/Migrations/2024-10-24-095430_CreateRawAttLog.php
@@ -0,0 +1,79 @@
+forge->addField([
+ 'company_issued_id' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 25,
+ 'null' => true,
+ ],
+ 'log_date' => [
+ 'type' => 'DATE',
+ 'null' => true,
+ ],
+ 'log_time' => [
+ 'type' => 'TIME',
+ 'null' => true,
+ ],
+ 'ucol1' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 2,
+ 'null' => true,
+ ],
+ 'log_type' => [
+ 'type' => 'TINYINT',
+ 'constraint' => 1,
+ 'null' => true,
+ ],
+ 'ucol2' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 2,
+ 'null' => true,
+ ],
+ 'ucol3' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 2,
+ 'null' => true,
+ ],
+ 'branch_code' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 25,
+ 'null' => false,
+ ],
+ 'att_from' => [
+ 'type' => 'DATE',
+ 'null' => true,
+ ],
+ 'att_to' => [
+ 'type' => 'DATE',
+ 'null' => true,
+ ],
+
+ // Common fields
+ 'created_at' => [
+ 'type' => 'DATETIME',
+ 'null' => true,
+ ],
+ 'created_by' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => '20',
+ 'null' => true
+ ],
+ ]);
+
+ $this->forge->addKey(['company_issued_id', 'log_date', 'log_time', 'log_type'], true);
+ $this->forge->createTable('raw_att_log');
+ }
+
+ public function down()
+ {
+ $this->forge->dropTable('raw_att_log');
+ }
+}
diff --git a/app/Database/Migrations/2024-10-31-065415_CreateAttendanceSummary.php b/app/Database/Migrations/2024-10-31-065415_CreateAttendanceSummary.php
new file mode 100644
index 0000000..3a8241c
--- /dev/null
+++ b/app/Database/Migrations/2024-10-31-065415_CreateAttendanceSummary.php
@@ -0,0 +1,83 @@
+forge->addField([
+ 'attlogsum_id' => [
+ 'type' => 'INT',
+ 'constraint' => 11,
+ 'unsigned' => true,
+ 'auto_increment' => true,
+ ],
+ 'paytrans_id' => [
+ 'type' => 'INT',
+ 'constraint' => 11,
+ 'unsigned' => true,
+ ],
+ 'pay_group_id' => [
+ 'type' => 'INT',
+ 'constraint' => 11,
+ 'unsigned' => true,
+ 'null' => false,
+ ],
+ 'employee_id' => [
+ 'type' => 'INT',
+ 'constraint' => 11,
+ 'unsigned' => true,
+ ],
+ 'company_issued_id' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 25,
+ ],
+ 'employee_name' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => 255,
+ ],
+ 'att_work_days' => [
+ 'type' => 'DECIMAL',
+ 'constraint' => '12,4',
+ 'null' => false
+ ],
+
+ // Common fields
+ 'created_at' => [
+ 'type' => 'DATETIME',
+ 'null' => true,
+ ],
+ 'created_by' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => '20',
+ 'null' => true
+ ],
+ 'updated_at' => [
+ 'type' => 'DATETIME',
+ 'null' => true,
+ ],
+ 'updated_by' => [
+ 'type' => 'VARCHAR',
+ 'constraint' => '20',
+ 'null' => true
+ ],
+ 'deleted_at' => [
+ 'type' => 'DATETIME',
+ 'null' => true,
+ ],
+ ]);
+
+ $this->forge->addKey('attlogsum_id', true);
+ $this->forge->addForeignKey('paytrans_id', 'pay_trans', 'paytrans_id', 'CASCADE', 'RESTRICT');
+ $this->forge->addForeignKey('pay_group_id', 'pay_group', 'pay_group_id', 'CASCADE', 'RESTRICT');
+ $this->forge->createTable('att_log_summary');
+ }
+
+ public function down()
+ {
+ $this->forge->dropTable('att_log_summary');
+ }
+}
diff --git a/app/Entities/AttendanceSummary.php b/app/Entities/AttendanceSummary.php
new file mode 100644
index 0000000..a8190c3
--- /dev/null
+++ b/app/Entities/AttendanceSummary.php
@@ -0,0 +1,21 @@
+ null,
+ 'paytrans_id' => null,
+ 'pay_group_id' => null,
+ 'employee_id' => null,
+ 'company_issued_id' => null,
+ 'employee_name' => null,
+ 'att_work_days' => null,
+ ];
+ protected $datamap = [];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
+ protected $casts = [];
+}
diff --git a/app/Entities/RawAttLog.php b/app/Entities/RawAttLog.php
new file mode 100644
index 0000000..7f9a1bb
--- /dev/null
+++ b/app/Entities/RawAttLog.php
@@ -0,0 +1,24 @@
+ null,
+ 'log_date' => null,
+ 'log_time' => null,
+ 'ucol1' => null,
+ 'log_type' => null,
+ 'ucol2' => null,
+ 'ucol3' => null,
+ 'branch_code' => null,
+ 'att_from' => null,
+ 'att_to' => null,
+ ];
+ protected $datamap = [];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
+ protected $casts = [];
+}
diff --git a/app/Entities/Settings.php b/app/Entities/Settings.php
index 92a17a1..3d0429e 100644
--- a/app/Entities/Settings.php
+++ b/app/Entities/Settings.php
@@ -15,6 +15,6 @@ class Settings extends Entity
'context' => null,
];
protected $datamap = [];
- protected $dates = ['created_at', 'updated_at', 'deleted_at'];
+ protected $dates = ['created_at', 'updated_at'];
protected $casts = [];
}
diff --git a/app/Models/AttendanceSummaryModel.php b/app/Models/AttendanceSummaryModel.php
new file mode 100644
index 0000000..29bf592
--- /dev/null
+++ b/app/Models/AttendanceSummaryModel.php
@@ -0,0 +1,66 @@
+user()->employee_id;
+ return $data;
+ }
+
+ public function assignUpdatedBy(array $data)
+ {
+ $data['data']['updated_by'] = auth()->user()->employee_id;
+ return $data;
+ }
+
+ public function addBatchData($data, $ignoreDuplicate = false)
+ {
+ $builder = $this->db->table('att_log_summary');
+ // ignore($ignoreDuplicate) will ignore duplicate data
+ return $builder->ignore($ignoreDuplicate)->insertBatch($data);
+ }
+}
diff --git a/app/Models/PayrollTypeModel.php b/app/Models/PayrollTypeModel.php
index 12e466f..deef007 100644
--- a/app/Models/PayrollTypeModel.php
+++ b/app/Models/PayrollTypeModel.php
@@ -7,7 +7,7 @@ use CodeIgniter\Model;
class PayrollTypeModel extends Model
{
protected $table = 'pay_type';
- protected $primaryKey = 'id';
+ protected $primaryKey = 'paytype_id';
protected $useAutoIncrement = true;
protected $returnType = \App\Entities\PayrollType::class;
protected $useSoftDeletes = true;
diff --git a/app/Models/RawAttLogModel.php b/app/Models/RawAttLogModel.php
new file mode 100644
index 0000000..7e75cbf
--- /dev/null
+++ b/app/Models/RawAttLogModel.php
@@ -0,0 +1,72 @@
+user()->employee_id;
+ return $data;
+ }
+
+ public function addBatchData($data, $ignoreDuplicate = false)
+ {
+ $builder = $this->db->table('raw_att_log');
+ // ignore($ignoreDuplicate) will ignore duplicate data
+ return $builder->ignore($ignoreDuplicate)->insertBatch($data);
+ }
+
+ public function getEmployeeDaysCount($logDataFrom, $logDataTo)
+ {
+ $builder = $this->db->table('raw_att_log');
+ $builder->distinct()->select(['raw_att_log.company_issued_id', 'employee.employee_id', 'employee.last_name', 'employee.first_name', 'raw_att_log.log_date']);
+ $builder->join('employee', 'employee.company_issued_id = raw_att_log.company_issued_id');
+ return $builder->getWhere(['raw_att_log.log_date >='=>$logDataFrom, 'raw_att_log.log_date <='=>$logDataTo])->getResult();
+ }
+}
diff --git a/app/Models/SettingsModel.php b/app/Models/SettingsModel.php
index a6afb71..3a9f035 100644
--- a/app/Models/SettingsModel.php
+++ b/app/Models/SettingsModel.php
@@ -10,18 +10,18 @@ class SettingsModel extends Model
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = \App\Entities\Settings::class;
- protected $useSoftDeletes = true;
+ protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = ['class', 'key', 'value', 'type', 'context'];
protected bool $allowEmptyInserts = false;
// Dates
- protected $useTimestamps = false;
+ protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
- protected $deletedField = 'deleted_at';
+ //protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
@@ -31,24 +31,12 @@ class SettingsModel extends Model
// Callbacks
protected $allowCallbacks = true;
- protected $beforeInsert = ['assignCreatedAt'];
+ protected $beforeInsert = [];
protected $afterInsert = [];
- protected $beforeUpdate = ['assignUpdatedAt'];
+ protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
-
- public function assignCreatedAt(array $data)
- {
- $data['data']['created_at'] = date('Y-m-d H:i:s');
- return $data;
- }
-
- public function assignUpdatedAt(array $data)
- {
- $data['data']['updated_at'] = date('Y-m-d H:i:s');
- return $data;
- }
}
diff --git a/app/Views/templates/adminlte/generalcontent.php b/app/Views/templates/adminlte/generalcontent.php
index 93cb130..50e5169 100644
--- a/app/Views/templates/adminlte/generalcontent.php
+++ b/app/Views/templates/adminlte/generalcontent.php
@@ -196,26 +196,40 @@
+
+
+
+ user()->inGroup('admin', 'superadmin', 'hr', 'tk')): ?>
+
- Timekeeping
+ Raw Logs
-
user()->inGroup('admin', 'superadmin', 'payroll')): ?>
diff --git a/app/Views/timekeeping/attsummaryview.php b/app/Views/timekeeping/attsummaryview.php
new file mode 100644
index 0000000..3bc4c08
--- /dev/null
+++ b/app/Views/timekeeping/attsummaryview.php
@@ -0,0 +1,191 @@
+
+= $this->extend('templates/adminlte/generalcontent') ?>
+
+
+
+= $this->section('title') ?>TK Raw Log Management= $this->endSection() ?>
+
+
+
+= $this->section('css') ?>
+= $this->endSection() ?>
+
+
+
+= $this->section('bodyclass') ?>sidebar-mini= $this->endSection() ?>
+
+
+
+= $this->section('containertitle') ?>Raw Attendance Log= $this->endSection() ?>
+
+
+
+= $this->section('breadcrumbs') ?>
+Raw Log
+= $this->endSection() ?>
+
+
+
+= $this->section('main') ?>
+
+
+
+
+
+
+
+
+
+= $this->endSection() ?>
+
+
+
+
+= $this->section('js') ?>
+
+
+
+= $this->endSection() ?>
+
+
\ No newline at end of file
diff --git a/app/Views/timekeeping/rawattendancelogview.php b/app/Views/timekeeping/rawattendancelogview.php
deleted file mode 100644
index 723c2f5..0000000
--- a/app/Views/timekeeping/rawattendancelogview.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
-= $this->extend('templates/adminlte/generalcontent') ?>
-
-
-
-= $this->section('title') ?>Payroll Group= $this->endSection() ?>
-
-
-
-= $this->section('css') ?>
-= $this->endSection() ?>
-
-
-
-= $this->section('bodyclass') ?>sidebar-mini= $this->endSection() ?>
-
-
-
-= $this->section('containertitle') ?>Payroll Group= $this->endSection() ?>
-
-
-
-= $this->section('breadcrumbs') ?>
-Raw Log
-= $this->endSection() ?>
-
-
-
-= $this->section('main') ?>
-
-
-
-
-
-
-
-= $this->endSection() ?>
-
-
-
-
-= $this->section('js') ?>
-
-
-
-= $this->endSection() ?>
-
-
\ No newline at end of file
diff --git a/app/Views/timekeeping/rawattloguploadview.php b/app/Views/timekeeping/rawattloguploadview.php
new file mode 100644
index 0000000..4971d97
--- /dev/null
+++ b/app/Views/timekeeping/rawattloguploadview.php
@@ -0,0 +1,183 @@
+
+= $this->extend('templates/adminlte/generalcontent') ?>
+
+
+
+= $this->section('title') ?>TK Raw Log Upload= $this->endSection() ?>
+
+
+
+= $this->section('css') ?>
+
+
+
+
+= $this->endSection() ?>
+
+
+
+= $this->section('bodyclass') ?>sidebar-mini= $this->endSection() ?>
+
+
+
+= $this->section('containertitle') ?>Upload Raw Log= $this->endSection() ?>
+
+
+
+= $this->section('breadcrumbs') ?>
+Raw Log
+= $this->endSection() ?>
+
+
+
+= $this->section('main') ?>
+
+
+
+
+
+
+
+
+
+
+
+= $this->endSection() ?>
+
+
+
+
+= $this->section('js') ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+= $this->endSection() ?>
+
+
\ No newline at end of file