public function viewTakenLeaves() { $tmpObj = new LeaveTakenRequests(); $tmpObj = $tmpObj->retriveLeaveTaken(); $path = "/templates/leave/leaveTakenList.php"; $template = new TemplateMerger($tmpObj, $path); $template->display(); }
/** * Show a screen allowing the manager to select a director * to seek approval from. Also allows the manager to add notes * related to the hiring. * * @param int $id Id of job application */ private function _confirmSeekApproval($id) { $path = '/templates/recruitment/seekApproval.php'; $empInfo = new EmpInfo(); $objs['employeeSearchList'] = $this->_getEmployeeSearchList(); $objs['application'] = JobApplication::getJobApplication($id); $template = new TemplateMerger($objs, $path); $template->display(); }
public static function defineHsp() { if ($_SESSION['isAdmin'] == 'No') { die('You are not authorized to view this page'); } $path = "/templates/benefits/defineHsp.php"; $template = new TemplateMerger(null, $path); $template->display(); }
function reDirect($getArr, $postArr, $object = null) { $form_creator = new FormCreator($getArr, $postArr); if ($_SESSION['isAdmin'] !== 'Yes') { trigger_error("Unauthorized access", E_USER_NOTICE); } switch ($getArr['repcode']) { case 'EMPDEF': //if () $form_creator->formPath = '/templates/report/emprepinfo.php'; $form_creator->popArr['arrAgeSim'] = array('Less Than' => '>', 'Greater Than' => '<', 'Range' => 'range'); //$form_creator->popArr['arrEmpType']= array( 'Permanent', 'Expatriate', 'Contract', 'Temporary' , 'Others'); $form_creator->popArr['arrSerPer'] = array('Less Than' => '>', 'Greater Than' => '<', 'Range' => 'range'); $form_creator->popArr['arrJoiDat'] = array('Joined After' => '>', 'Joined Before' => '<', 'Joined In Between' => 'range'); $report = new EmpReport(); $empinfo = new EmpInfo(); $edu = new Education(); $jobtit = new JobTitle(); $salgrd = new SalaryGrades(); $empstat = new EmploymentStatus(); $langObj = new LanguageInfo(); $skillObj = new Skills(); $form_creator->popArr['grdlist'] = $salgrd->getSalGrdCodes(); $form_creator->popArr['edulist'] = $edu->getAllEducation(); $form_creator->popArr['deslist'] = $jobtit->getJobTit(); $form_creator->popArr['arrEmpType'] = $empstat->getEmpStat(); $form_creator->popArr['languageList'] = $langObj->getLang(); $form_creator->popArr['skillList'] = $skillObj->getSkillCodes(); if ($getArr['capturemode'] == 'updatemode') { $form_creator->popArr['editArr'] = $edit = $report->filterReport($getArr['id']); $criteria_value = explode('|', $edit[0][2]); for ($c = 0; count($criteria_value) > $c; $c++) { $crit_data = explode("=", $criteria_value[$c]); $criteriaChkBox[$c] = $crit_data[0]; for ($d = 1; count($crit_data) > $d; $d++) { $crit_form_data[$crit_data[0]][$d - 1] = $crit_data[$d]; } } $form_creator->popArr['editCriteriaChk'] = $criteriaChkBox; $form_creator->popArr['editCriteriaData'] = $crit_form_data; $form_creator->popArr['fieldList'] = explode('|', $edit[0][3]); } if ($object != null) { $form_creator->popArr['empqual'] = $empqual->getQualifications($object->TypeCode); } break; case 'EMPVIEW': $report = new EmpReport(); $repgen = new ReportGenerator(); $edit = $report->filterReport($getArr['id']); $repgen->reportId = $edit[0][0]; /* TODO: The following actions should be moved to model class */ $criteria = explode('|', $edit[0][2]); $criteriaCount = count($criteria); for ($c = 0; $criteriaCount > $c; $c++) { $crit_value = explode("=", $criteria[$c]); $repgen->setCriteria($crit_value[0], ''); $criteriaValueCount = count($crit_value); for ($d = 1; $criteriaValueCount > $d; $d++) { if ($d == count($crit_value) - 1) { $repgen->setCriteria($crit_value[0], $crit_value[$d], true); } else { $repgen->setCriteria($crit_value[0], $crit_value[$d] . "|", true); } } } $field = explode('|', $edit[0][3]); $fieldCount = count($field); for ($c = 0; $fieldCount > $c; $c++) { $repgen->setField($field[$c], 1); } $sqlQ = $repgen->buildReportQuery(); $arrayDispList = $repgen->buildDisplayList($sqlQ); $employee = array(); if (is_array($arrayDispList)) { $employee = current($arrayDispList); } $columns = count($employee); $rows = count($arrayDispList); $objs['reportName'] = $edit[0][1]; $objs['arrayDispList'] = $arrayDispList; $objs['headerNames'] = $repgen->getHeaders(); $objs['replacements'] = array('directReportingMode' => EmpRepTo::REPORTING_MODE_DIRECT, 'indirectReportingMode' => EmpRepTo::REPORTING_MODE_INDIRECT); $templatePath = '/templates/report/report.php'; $template = new TemplateMerger($objs, $templatePath, null, null); $template->display(); return; break; case 'RUG': $form_creator->formPath = '/templates/report/repusg.php'; $report = new EmpReport(); $emprepgroup = new EmpRepUserGroup(); $form_creator->popArr['report'] = $report->filterReport($getArr['id']); $form_creator->popArr['usgAll'] = $emprepgroup->getAllUserGroups(); $form_creator->popArr['repUsgAss'] = $emprepgroup->getAssignedUserGroup($getArr['id']); $form_creator->popArr['usgUnAss'] = $emprepgroup->getUnAssUserGroups($getArr['id']); break; } $form_creator->display(); }
/** * View the worksheet edit page * @param int $id The workshift Id */ public function viewEditWorkShift($id) { $path = "/templates/time/editWorkShift.php"; try { $workshift = Workshift::getWorkshift($id); $objs[] = $workshift; $objs[] = $workshift->getAssignedEmployees(); $objs[] = $workshift->getEmployeesWithoutWorkshift(); $template = new TemplateMerger($objs, $path); $template->display(); } catch (WorkshiftException $e) { switch ($e->getCode()) { case WorkshiftException::WORKSHIFT_NOT_FOUND: $msg = 'INVALID_WORK_SHIFT_FAILURE'; break; default: $msg = 'UNKNOWN_ERROR_FAILURE'; break; } $this->redirect($msg, '?timecode=Time&action=View_Work_Shifts'); } }