public function displayDefineHolidays($modifier = "specific", $edit = false) { $this->_authenticateViewHoliday(); $record = null; if ($edit) { $holidayObj = new Holidays(); $record = $holidayObj->fetchHoliday($this->getId()); } switch ($modifier) { case "specific": $holiday = new Holidays(); $record['holidayList'] = $holiday->listHolidays(); $path = "/templates/leave/specificHolidaysDefine.php"; break; case "weekend": $path = "/templates/leave/weekendHolidaysDefine.php"; $weekendsObj = new Weekends(); $record = $weekendsObj->fetchWeek(); break; } $record['rights'] = $_SESSION['localRights']; $record['changeWeekends'] = Leave::isLeaveTableEmpty(); $template = new TemplateMerger($record, $path); $modifier = $edit; $template->display($modifier); }
private function _displaySpecificHoliday($modifier) { if (!isset($year)) { $year = date('Y'); } $modifier = array($modifier, $year); $tmpObj = new Holidays(); $tmpObjX = $tmpObj->listHolidays(); $path = "/templates/leave/specificHolidaysList.php"; $template = new TemplateMerger($tmpObjX, $path); $template->display($modifier); }
$SESSION->lang = DEFAULT_LANGUAGE; } \Locale::setDefault($SESSION->lang); $l10n->setLanguage($SESSION->lang); //============================================================================================ // Model //============================================================================================ $hol = new Holidays($dbo); //============================================================================================ // Load the page requested by the user //============================================================================================ if (!isset($_GET['page'])) { $render = true; $thisPage = "Global"; $services = $hol->listServices(); $hlist = $hol->listHolidays(); $l10n->addResource(__DIR__ . '/l10n/holidays.json'); $l10n->localizeArray($services, 'service_name'); $l10n->localizeArray($hlist, 'emp_service'); $l10n->localizeArray($hlist, 'holiday_name'); $l10n->localizeArray($hlist, 'service_name'); $viewFile = 'views/holidays.php'; } elseif ($_GET['page'] === "add") { $hol->addHoliday($_POST); $loggers['audit']->info("Global event added"); } elseif ($_GET['page'] === "delete") { $hol->deleteEvent($_POST['event_id']); $loggers['audit']->info("Global event {$_POST['event_id']} deleted"); } /** * View rendering