public function index() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // this checks if the logged in user is HR, if its not then do not permit to show // the datalist page if ($LC->isHROrAdmin() == FALSE) { echo "<center><h2>You do not have permission to access this page.</h2></center>"; return; } // get the list of educational attainment data needed for the dropdown $data['educationAttainmentList'] = $this->Db_educattainment_model->educattainmentSelectAll(); // get the list of employment status data needed for the dropdown $data['employmentStatus'] = $this->Db_employmentstatus_model->employmentStatusSelectAll(); // get the list of employment position data needed for the dropdown $data['employmentPosition'] = $this->Db_employment_position_model->employmentPositionSelectAll(); // get the list of departments data needed for the dropdown $data['departments'] = $this->Db_departments_model->departmentsSelectAll(); // get the list of taxstatus data needed for the dropdown $data['taxStatusList'] = $this->Db_taxstatus_model->taxStatusSelectAll(); // get the list of clients data needed for dropdown $data['clientList'] = $this->Db_clients_model->clientsSelectAll(); // load the employee datalist $data['listData'] = $this->Datalist_model->getEmployeeDataByUserID(); // display the pages with the passed data $this->load->view('templates/Header'); $this->load->view('datalist/Datalist', $data); $this->load->view('templates/Footer'); }
public function index() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // this checks if the logged in user is staff, if its not then do not permit to show // the dataform page if ($LC->isHROrAdmin() == TRUE) { echo "<center><h2>You do not have permission to access this page.</h2></center>"; return; } // get the list of educational attainment data needed for the dropdown $data['educationAttainmentList'] = $this->Db_educattainment_model->educattainmentSelectAll(); // load the employee form data $data['formData'] = $this->Dataform_model->getEmployeeDataByID($this->session->userRec['employee_id']); // load the dependents data $data['dependentsData'] = $this->Dataform_model->getDependentsDataByID($this->session->userRec['employee_id']); // load the emergency contacts data $data['emergencyContactsData'] = $this->Dataform_model->getEmergencyContactsDataByID($this->session->userRec['employee_id']); // load the educRecord Data $data['acadStatusList'] = $this->Dataform_model->getEducRecordsDataByID($this->session->userRec['employee_id']); // display the pages with the passed data $this->load->view('templates/Header'); $this->load->view('dataform/Dataform', $data); $this->load->view('templates/Footer'); }
public function index() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // get all the userlist from the users table $data['usersList'] = $this->Usercontrol_model->getAllUsersList(); // get the user types from the database for the dropdown $data['usersType'] = $this->Usercontrol_model->getAllUserTypes(); $this->load->view('templates/header'); $this->load->view('usercontrol/usercontrol', $data); $this->load->view('templates/footer'); }
public function index() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // this gets all the client and display the list on the client editor $data['clientList'] = $this->Clienteditor_model->getClientList(); //$data['clientname'] = $this->Clienteditor_model->getSpecificClient(); // used for viewing the pages and passing data $this->load->view('templates/Header'); $this->load->view('clienteditor/Clienteditor', $data); $this->load->view('templates/Footer'); }
public function index() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // get the employees List $data['employeesList'] = $this->Dashboard_model->getEmployeeList(); $data['holidayList'] = $this->Dashboard_model->getHolidayList(); $data['empOTSchedList'] = $this->Dashboard_model->getEmpWithOTSchedList(); $this->load->view('templates/header'); $this->load->view('dashboard/dashboard', $data); $this->load->view('templates/footer'); }
public function index() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // this gets all the users list on the user control $data['usersList'] = $this->Usercontrol_model->getAllUsersList(); // this gets all the departments list for the user control dropdown $data['userTypeList'] = $this->Usercontrol_model->getAllUserType(); // get the HR position status of the currently logged in user $data['isHROrAdmin'] = $LC->isHROrAdmin(); // used for viewing the pages and passing data $this->load->view('templates/Header'); $this->load->view('usercontrol/Usercontrol', $data); $this->load->view('templates/Footer'); }
public function performLogout() { $LC = new LoginCredentials(); $LC->logout(); }
public function summary() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); $this->load->view('templates/header'); $this->load->view('reports/payrollsummary'); $this->load->view('templates/footer'); }
public function benefits() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // get the employees List $data['employeesList'] = $this->Finance_model->fetchEmployeesList(); $this->load->view('templates/header'); $this->load->view('finance/benefits', $data); $this->load->view('templates/footer'); }
public function edit() { // check for logged in user $LC = new LoginCredentials(); $LC->checkAuthorization(); // get the employee ID that needs to be edited in the URL $employeeID = ""; if ($this->uri->segment(3) != null) { $employeeID = $this->uri->segment(3); } else { if ($this->input->post("employeeID") != null) { $employeeID = $this->input->post("employeeID"); } } // Perform the validation if the form has been submitted //------------------------------------------------------- if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->load->library("form_validation"); // QUICK INFORMATION VALIDATION $this->form_validation->set_rules("empStatus", 'Employee Status', 'required'); $this->form_validation->set_rules("position", 'Position', 'required'); $this->form_validation->set_rules("department", 'Department', 'required'); $this->form_validation->set_rules("taxStatus", 'Tax Status', 'required'); // EMPLOYEE DETAILS VALIDATION $this->form_validation->set_rules("emp_no", 'Employee Number', 'required'); $this->form_validation->set_rules("emp_firstName", 'First Name', 'required'); $this->form_validation->set_rules("emp_lastName", 'Last Name', 'required'); $this->form_validation->set_rules("emp_middleName", 'Middle Name', ''); $this->form_validation->set_rules("emp_gender", 'Gender', 'required'); $this->form_validation->set_rules("nationality", 'Nationality', 'required'); $this->form_validation->set_rules("emp_civilStatus", 'Civil Status', 'required'); $this->form_validation->set_rules("emp_dob", 'Date of Birth', 'required'); $this->form_validation->set_rules("emp_sssID", 'SSS Number', ''); $this->form_validation->set_rules("emp_hdmfID", 'HDMF Number', ''); $this->form_validation->set_rules("emp_tinID", 'PHIC Number', ''); $this->form_validation->set_rules("emp_phicID", 'TIN Number', ''); // ADDRESS DETAILS VALIDATION $this->form_validation->set_rules("houseNo", 'House No.', 'numeric'); $this->form_validation->set_rules("purokNo", 'Purok No.', 'numeric'); $this->form_validation->set_rules("streetName", 'Street Name', ''); $this->form_validation->set_rules("barangayNo", 'Barangay No.', 'numeric'); $this->form_validation->set_rules("barangayName", 'Barangay Name', ''); $this->form_validation->set_rules("province", 'Province', ''); $this->form_validation->set_rules("city", 'City', ''); $this->form_validation->set_rules("zipCode", 'Zip Code', 'required'); $this->form_validation->set_rules("country", 'Country', 'required'); // CONTACT NUMBERS VALIDATION $this->form_validation->set_rules("homeTel", 'Home Landline', ''); $this->form_validation->set_rules("mobileNo", 'Mobile Number', 'numeric'); $this->form_validation->set_rules("personal_email", 'Personal Email', 'required|valid_email'); $this->form_validation->set_rules("work_email", 'Work Email', 'valid_email'); // BANK ACCOUNT VALIDATION $this->form_validation->set_rules("bankName", 'Bank Name', 'required'); $this->form_validation->set_rules("bankAccountNumber", 'Bank Account Number', 'required'); $this->form_validation->set_rules("bankBranch", 'Bank Branch', 'required'); $this->form_validation->set_rules("bankAddress", 'Bank Address', 'required'); //------------------------------------------------------------ // Run the validations and perform an update when all of the // fields have been successfully validated //------------------------------------------------------------ if ($this->form_validation->run() == TRUE) { // UPDATE EMPLOYEE DATA //------------------------ $whereArray = array("emp_id" => $employeeID); $employeesArray = array('emp_firstname' => $_POST['emp_firstName'], 'emp_middlename' => $_POST['emp_middleName'], 'emp_lastname' => $_POST['emp_lastName'], 'emp_no' => $_POST['emp_no'], 'emp_gender' => $_POST['emp_gender'], 'emp_civilstatus' => $_POST['emp_civilStatus'], 'nationality' => $_POST['nationality'], 'emp_dob' => $_POST['emp_dob'], 'emp_sssId' => $_POST['emp_sssID'], 'emp_hdmfId' => $_POST['emp_hdmfID'], 'emp_tin' => $_POST['emp_tinID'], 'emp_phicId' => $_POST['emp_phicID'], 'houseNo' => $_POST['houseNo'], 'purokNo' => $_POST['purokNo'], 'streetName' => $_POST['streetName'], 'barangayNo' => $_POST['barangayNo'], 'barangayName' => $_POST['barangayName'], 'province' => $_POST['province'], 'city' => $_POST['city'], 'zipCode' => $_POST['zipCode'], 'country' => $_POST['country'], 'homeTel' => $_POST['homeTel'], 'mobileNo' => $_POST['mobileNo'], 'personal_email' => $_POST['personal_email'], 'work_email' => $_POST['work_email'], 'empStatus_id' => $_POST['empStatus'], 'department_id' => $_POST['department'], 'position_id' => $_POST['position'], 'taxStatus_id' => $_POST['taxStatus']); // perform an update in the employees model $this->Db_employees_model->employeesUpdate($employeesArray, $whereArray); // UPDATE BANK ACCOUNT DETAILS //----------------------------- $bankDetailsArray = array('bankName' => $_POST['bankName'], 'bankAcctNumber' => $_POST['bankAccountNumber'], 'bankBranch' => $_POST['bankBranch'], 'bankAddress' => $_POST['bankAddress']); $this->Db_bankaccts_model->bankAcctsUpdate($bankDetailsArray, $whereArray); // UPDATE WORK SCHEDULE DETAILS //------------------------------ $workScheduleArray = array('monday_in' => $_POST['mondayIn'] != '' ? $_POST['mondayIn'] : NULL, 'monday_out' => $_POST['mondayOut'] != '' ? $_POST['mondayOut'] : NULL, 'tuesday_in' => $_POST['tuesdayIn'] != '' ? $_POST['tuesdayIn'] : NULL, 'tuesday_out' => $_POST['tuesdayOut'] != '' ? $_POST['tuesdayOut'] : NULL, 'wednesday_in' => $_POST['wednesdayIn'] != '' ? $_POST['wednesdayIn'] : NULL, 'wednesday_out' => $_POST['wednesdayOut'] != '' ? $_POST['wednesdayOut'] : NULL, 'thursday_in' => $_POST['thursdayIn'] != '' ? $_POST['thursdayIn'] : NULL, 'thursday_out' => $_POST['thursdayOut'] != '' ? $_POST['thursdayOut'] : NULL, 'friday_in' => $_POST['fridayIn'] != '' ? $_POST['fridayIn'] : NULL, 'friday_out' => $_POST['fridayOut'] != '' ? $_POST['fridayOut'] : NULL, 'saturday_in' => $_POST['saturdayIn'] != '' ? $_POST['saturdayIn'] : NULL, 'saturday_out' => $_POST['saturdayOut'] != '' ? $_POST['saturdayOut'] : NULL, 'sunday_in' => $_POST['sundayIn'] != '' ? $_POST['sundayIn'] : NULL, 'sunday_out' => $_POST['sundayOut'] != '' ? $_POST['sundayOut'] : NULL, 'flexiTime' => isset($_POST['flexiCheckbox']) && $_POST['flexiCheckbox'] == 'on' ? 1 : 0); $this->Db_empworksched_model->empWorkSchedUpdate($workScheduleArray, $whereArray); // Create a history record that an employee has been updated $HC = new HistoryCreator(); $HC->logEmployeeHistory($this->session->userPayroll['users_id'], $employeeID, "UPDATE"); // Return a SUCCESS message echo "SUCCESS"; return; } else { echo validation_errors(); return; } } // get the filename of the profile image saved in the uploads folder $this->load->helper("file"); $data['profileImageURL'] = get_filenames("uploads/profileimages/" . $employeeID . "/")[0]; // get the employee Detail by supplying the employee ID and pass it to view $data['employeeDetail'] = $this->Employees_model->getEmployeeDetailByID($employeeID); // This is used for getting the datas needed for form dropdowns $data['employeeStatusList'] = $this->Db_status_model->statusSelectAll(); $data['positionsList'] = $this->Db_positions_model->positionsSelectAll(); $data['departmentsList'] = $this->Db_departments_model->departmentsSelectAll(); $data['taxstatusList'] = $this->Db_taxstatus_model->taxstatusSelectAll(); // shows the Employees Edit page $this->load->view('templates/header'); $this->load->view('employees/edit', $data); $this->load->view('templates/footer'); }