function normalizeBirthDays($bd) { $ret = array(); $mon = get_month_array(); $bd = (array) $bd; if (gettype($bd['arrSTR']) == 'object') { $bd = (array) $bd['arrSTR']; array_push($ret, $bd); } else { $bd = (array) $bd['arrSTR']; foreach ($bd as $val) { array_push($ret, (array) $val); } } foreach ($ret as $k => $val) { $ret[$k]['HBDay'] = $val['HBDay'] . " " . $mon[$val['HBMonth']]; if ($val['HBAge'] % 5 == 0) { $ret[$k]['HBMonth'] = true; } else { $ret[$k]['HBMonth'] = false; } } return $ret; }
$jext = '.jade'; echo "<br><br><br><br>"; // var_dump($_POST); $depList = getDepartmentList(); $mode = $_GET['mode'] ? $_GET['mode'] : 'bd'; $currDep = $_POST['rep_dept'] ? $_POST['rep_dept'] : "000000000"; $tpl = getTemplate($mode); if ($_POST['go']) { switch ($mode) { case 'bd': $content = get_bd_content($currDep); break; case 'mv': $content = get_mv_content($currDep, $_POST); break; case 'ls': $content = get_list_employee($currDep); break; case 'vc': $content = get_vacations($currDep); break; case 'fr': $content = get_fired_list($currDep, $_POST); break; } } // echo 'content'; // var_dump($content); // var_dump($tpl); $jade->render($tpl, ['currDepCode' => $currDep, 'currDep' => $currDep == "000000000" ? "" : $depList[$currDep], 'depList' => $depList, 'mode' => $mode, 'title' => 'Списки сотрудников сотрудников', 'content' => is_array($content) ? $content : array(), 'arrMonth' => get_month_array(), 'PeriodBeg' => $_POST['rep-period-from'] ? $_POST['rep-period-from'] : date('01-m-Y'), 'PeriodEnd' => $_POST['rep-period-to'] ? $_POST['rep-period-to'] : date('t-m-Y'), 'go' => $_POST['go'], 'reason' => $_POST['rep-purp']]);