switch ($subaction) { case "add": $job->NewVacancy($_POST); if (!$job->Errors) { Cache::ClearHTMLCache('main'); Cache::ClearArrayCache('stats'); $tpl->msg($job->lang['add_vacancy'], $job->lang['add_vacancy_ok'], $PHP_SELF); } $edit = $_POST; break; case "edit": if (!$id) { $tpl->msg($job->lang['error'], $job->lang['vacancy_not_found'], $PHP_SELF); } $edit = $job->GetVacancyForEdit($id); ConvertDBResultToType($TABLES['job_vacancies'], $edit); foreach (array('age_min', 'age_max', 'salary_min', 'salary_max', 'date_exp') as $field) { if (!$edit[$field]) { $edit[$field] = ''; } } $hidden_array['id'] = $id; $hidden_array['subaction'] = "save"; if ($edit['date_exp']) { $edit['date_exp'] = date('Y-m-d H:i', $edit['date_exp']); } $job->lang['btn_add'] = $job->lang['btn_save']; $hidden_array['referal'] = $_SERVER['HTTP_REFERER']; break; case "save": if (!$id) {
switch ($subaction) { case "add": $job->NewResume($_POST); if (!$job->Errors) { Cache::ClearHTMLCache('main'); Cache::ClearArrayCache('stats'); $tpl->msg($job->lang['add_resume'], $job->lang['add_resume_ok'], $PHP_SELF); } $edit = $_POST; break; case "edit": if (!$id) { $tpl->msg($job->lang['error'], $job->lang['resume_not_found'], $PHP_SELF); } $edit = $job->GetResumeForEdit($id); ConvertDBResultToType($TABLES['job_resumes'], $edit); foreach (array('age', 'salary_min', 'salary_max', 'date_exp') as $field) { if (!$edit[$field]) { $edit[$field] = ''; } } $hidden_array['id'] = $id; $hidden_array['subaction'] = "save"; if ($edit['date_exp']) { $edit['date_exp'] = date('Y-m-d H:i', $edit['date_exp']); } $job->lang['btn_add'] = $job->lang['btn_save']; $hidden_array['referal'] = $_SERVER['HTTP_REFERER']; break; case "save": if (!$id) {