<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');

$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');

$routes->get('hr/branch', 'HRController::companyBranch');
$routes->post('hr/addbranch', 'HRController::addCompanyBranch');

$routes->get('hr/jobtitle', 'HRController::jobTitle');
$routes->post('hr/addjobtitle', 'HRController::addJobTitle');

$routes->get('hr/empstatus', 'HRController::employmentStatus');
$routes->post('hr/addempstatus', 'HRController::addEmploymentStatus');

$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');

$routes->get('payroll/paygroup', 'PayrollController::payrollGroup');
$routes->post('payroll/addpaygroup', 'PayrollController::addPayrollGroup');

$routes->get('payroll/inded', 'PayrollController::incomeDeduction');
$routes->get('payroll/indedtransupdate/(:num)', 'PayrollController::incomeDeductionTransUpdate/$1');
$routes->get('payroll/indedtransapplyupdate/(:num)/(:num)', 'PayrollController::incomeDeductionTransApplyUpdate/$1/$2');
$routes->post('payroll/saveinded', 'PayrollController::saveIncomeDeduction');
$routes->get('payroll/delinded/(:num)', 'PayrollController::deleteIncomeDeduction/$1');

$routes->get('payroll/paytype', 'PayrollController::payrollType');
$routes->post('payroll/addpaytype', 'PayrollController::addPayrollType');

$routes->get('payroll/emppayinfo', 'PayrollController::employeePayrollInfo');
$routes->post('payroll/saveemppayinfo', 'PayrollController::saveEmployeePayrollInfo');
$routes->get('payroll/delempayinfo/(:num)', 'PayrollController::deleteEmployeePayrollInfo/$1');

$routes->get('payroll/compben', 'PayrollController::employeeCompensationBenefits');
$routes->post('payroll/savecompben', 'PayrollController::saveEmployeeCompensationBenefits');
$routes->post('payroll/delcomben', 'PayrollController::deleteEmployeeCompensationBenefits');

$routes->get('payroll/paysettings', 'PayrollController::payrollSettings');
$routes->post('payroll/paysettings', 'PayrollController::payrollSettings');

$routes->get('payroll/paytrans', 'PayrollController::payrollTransactions');
$routes->post('payroll/addpaytrans', 'PayrollController::addPayrollTransactions');

$routes->get('payroll/emppaytrans/(:num)', 'PayrollController::employeePayrollTransactions/$1');
$routes->get('payroll/emppaytransviewempinit/(:num)/(:num)', 'PayrollController::employeePayrollTransactionsViewEmpForInit/$1/$2');
$routes->get('payroll/emppaytransinit/(:num)/(:num)/(:num)', 'PayrollController::empPayTransInitializePayroll/$1/$2/$3');
$routes->get('payroll/emppaytransempinit/(:num)/(:num)', 'PayrollController::empPayTransInitializeEmpPayroll/$1/$2');
$routes->get('payroll/emppaytransempreinitpay/(:num)/(:num)/(:num)', 'PayrollController::empPayTransReInitEmpPayroll/$1/$2/$3');
$routes->post('payroll/emppaytransupdateworkdays', 'PayrollController::employeePayrollTransactionsEditDaysWorked');
$routes->get('payroll/emppaytransrecom/(:num)', 'PayrollController::employeePayrollTransactionsRecompute/$1');
$routes->post('payroll/saveemppaytransaddinded', 'PayrollController::saveEmpPayTransIncomeDeduction');
$routes->get('payroll/emppaytransdelinded/(:num)/(:num)', 'PayrollController::deleteEmpPayTransIncomeDeduction/$1/$2');
$routes->get('payroll/emppaytransdel/(:num)', 'PayrollController::employeePayrollTransactionsDeleteEmp/$1');

$routes->get('payroll/emppaytransreport/(:num)/(:num)', 'PayrollController::empPayTransReport/$1/$2');
$routes->get('payroll/empslip/(:num)/(:num)', 'PayrollController::empPayslip/$1/$2');


$routes->get('payroll/paytransreview/(:num)', 'PayrollController::payrollTransactionsReview/$1');

//$routes->post('t', 'PayrollController::test');


// Administrator Routes
$routes->get('adminuser', 'AdministratorController::index');
$routes->get('adminuser/newuser', 'AdministratorController::newUserView');
$routes->get('adminuser/getuserbyid/(:num)', 'AdministratorController::getUserById/$1');
$routes->post('adminuser/adduser', 'AdministratorController::saveNewUser');
$routes->post('adminuser/updateuser', 'AdministratorController::updateUser');
$routes->post('adminuser/deleteuser', 'AdministratorController::deleteUser');
$routes->get('adminuser/editusergroup/(:num)', 'AdministratorController::editUserGroupView/$1');
$routes->get('adminuser/edituserpermission/(:num)', 'AdministratorController::editUserPermissionView/$1');
$routes->post('adminuser/saveusergroup', 'AdministratorController::saveEditedUserGroup');
$routes->get('adminuser/fromemplist', 'AdministratorController::newUserFromEmployeeList');
$routes->get('adminuser/newuserfromemplist/(:any)', 'AdministratorController::createUserFromEmployeeList/$1');
$routes->post('adminuser/updateuserpass', 'AdministratorController::updateUserPass');


// 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');
$routes->get('tk/attsumdel/(:any)/(:any)', 'TKController::attendanceSummaryDelete/$1/$2');


// Regular Employee Routes
$routes->get('remp', 'RegularEmployeeController::index');
$routes->get('remp/payview', 'RegularEmployeeController::payslipView');
$routes->get('remp/payprint/(:num)', 'RegularEmployeeController::payslipViewPrint/$1');

service('auth')->routes($routes);
