xaionaro

updated

... ... @@ -243,16 +243,23 @@ switch ($file) {
}
}
$unitName = '_________________';
$unitHead = '_________________';
if (!empty($a['ChiefName'])) {
//$unitHeadFullname = $curUnit['ChiefName'];
$unitName = mb_strtoupper(chop($a['Podr_BriefName'])).' ['.$a['Code'].']';
$unitHeadFullname = preg_replace('/[ ][ ]+/', ' ', chop(str_replace(array('и.о. ', 'и.о.'), array('', ''), preg_replace('/[0-9].*+/', '', chop($a['ChiefName'])))));
$curUnit = json_decode(file_get_contents('https://sd.mephi.ru/api/1/units.json?from_local_db=true&active_only=true&api_key='.SDAPI_KEY.'&filter_id='.preg_replace('/[^0-9]+/', '', $a['OrgDiv'])), 1)[0];
$unitCode = $curUnit['Code'];
while (substr($unitCode, strlen($unitCode)-2, 2) != '00') {
$curUnit = json_decode(file_get_contents('https://sd.mephi.ru/api/1/units.json?from_local_db=true&active_only=true&api_key='.SDAPI_KEY.'&filter_id='.preg_replace('/[^0-9]+/', '', $curUnit['ParentId'])), 1)[0];
$unitCode = $curUnit['Code'];
if (empty($unitCode)) {
error_log('empty unitCode');
break;
}
}
$unitName = mb_strtoupper(chop($curUnit['BriefName'])).' ['.$curUnit['Code'].']';
$unitHeadFullname = $curUnit['ChiefName'];
$unitHeadNameWords = split(' ', preg_replace('/[А-Я][.]/', '', $unitHeadFullname));
$unitHeadLastname = $unitHeadNameWords[0];
if (mb_strtoupper($a['SurName']) == mb_strtoupper($unitHeadLastname)) {
$curUnit = json_decode(file_get_contents('https://sd.mephi.ru/api/1/units.json?from_local_db=true&active_only=true&api_key='.SDAPI_KEY.'&filter_id='.preg_replace('/[^0-9]+/', '', $a['OrgDiv'])), 1)[0];
$parentUnit = json_decode(file_get_contents('https://sd.mephi.ru/api/1/units.json?from_local_db=true&active_only=true&api_key='.SDAPI_KEY.'&filter_id='.preg_replace('/[^0-9]+/', '', $curUnit['ParentId'])), 1)[0];
$unitName = mb_strtoupper(chop($parentUnit['BriefName'])).' ['.$parentUnit['Code'].']';
... ... @@ -276,7 +283,6 @@ switch ($file) {
if (count($unitHeadNameWords) == 3) {
$unitHead = $unitHeadNameWords[0].' '.mb_substr($unitHeadNameWords[1], 0, 1).'.'.mb_substr($unitHeadNameWords[2], 0, 1).'.';
}
}
$numberToWords = new NumberToWords();
$numberTransformer = $numberToWords->getNumberTransformer('ru');
... ... @@ -288,9 +294,11 @@ switch ($file) {
//$account = $themes[$a['Code']]['theme'];
}
$prorector_appointment = json_decode(file_get_contents('https://voip.mephi.ru/appointments/'.$_GET['prorector-appointment-id'].'.json'), 1)['appointment_selected'];
return array(
'of-prorector' => '_________________',
'prorector' => '_________________',
'prorector' => $prorector_appointment['Subscriber']['Lastname'].' '.mb_substr($prorector_appointment['Subscriber']['Firstname'], 0, 1).'.'.mb_substr($prorector_appointment['Subscriber']['Patronymic'], 0, 1).'.',
'attorney-date' => '«___» __________ 20___г',
'attorney-code' => '_____________',
... ... @@ -306,8 +314,8 @@ switch ($file) {
'SalaryText' => $numberTransformer->toWords($salary).' рублей ноль копеек',
'MultiplyingFactor' => '______',
'MultiplyingFactorReason' => '_________________________________',
'endDateWas' => formatDate($a['EndDate']),
'endDateBecame' => $_GET['newEndDate'],
'endDateWas' => @formatDate(@$a['EndDate']),
'endDateBecame' => @$_GET['newEndDate'],
'account' => $account,
'account-manager' => $account_manager,
'change-date' => '«___» __________ 20___г',
... ...
... ... @@ -143,7 +143,7 @@
\vspace{-.5cm}
\par \fontsize{14pt}{14pt}\selectfont{НИЯУ МИФИ в лице #1, действующего на основании доверенности от #2, № #3, именуемый в дальнейшем «Работодатель», с одной стороны и #4, именуемый в дальнейшем «Работник», с другой стороны, пришли к соглашению о внесении в трудовой договор от #5 № #6 следующих дополнений и изменений с #7:}
\par \fontsize{13pt}{13pt}\selectfont{НИЯУ МИФИ в лице #1, действующего на основании доверенности от #2, № #3, именуемый в дальнейшем «Работодатель», с одной стороны и #4, именуемый в дальнейшем «Работник», с другой стороны, пришли к соглашению о внесении в трудовой договор от #5 № #6 следующих дополнений и изменений с #7:}
}
% memorandum footer (signatures)
... ...