setStylesheet ("/blank/universalnaya/common/smoothness.datepicker.css"); $htmlhead->setJavascript ("/js/ui.datepicker.js"); $htmlhead->setJavascript ("/js/ru.js"); $htmlhead->setJavascript ("/js/date.js"); $htmlhead->setJavascript ("/js/jquery.form.js"); $htmlhead->setJavascript ("/js/jquery.validate.js"); $htmlhead->setJavascript ("/js/additional-methods.js"); $htmlhead->setJavascript ("/module/insurance/voyage_logic.js"); $lang_id = constant ("LANG"); $post = (!empty ($_SESSION['post']) AND (sizeof ($_SESSION['post']) > 0)) ? $_SESSION['post'] : $userinfo; $partner_id = is_numeric ($_POST['partner_id']) ? $_POST['partner_id'] : false ; if (($partner_id != false) AND (isset ($_POST['partner_id']))) { $post = $_POST; $htmlhead->setJavascript ("/module/insurance/partner_voyage_logic.js"); $program_id = $_POST['program']; $country_id = $_POST['country']; $query = "SELECT * FROM `travel_country` WHERE (`lang` = '{$lang_id}') AND (`key` = '{$country_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); $country_zone = $a['0']['factor']; if ($program_id == '3') $country_zone = 0; } else { $program_id = 1; $country_zone = 3; } if (msg::checkConfirm()) { $error = msg::getConfirm(); } if (msg::checkError()) { $error = msg::getError(); } $id = is_numeric ($_GET['id']) ? $_GET['id'] : false ; if (($id != false) AND (isset ($_SESSION['id']))) { $voyage = new voyage; $voyage->sql_link = $sql; $post = $voyage->getOrderInfo($id, $_SESSION['id']); $post = array_merge($post, $userinfo); $htmlhead->setJavascript ("/module/insurance/save_voyage_logic.js"); } $signin = (isset ($_SESSION['signin']) AND ($_SESSION['signin'] === true)) ? 'true' : 'false' ; $query = "SELECT * FROM `travel_program` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $program_value['key'][$k]=$v['key']; $program_value['value'][$k]=$v['name']; } /** * 2014-09-24 * Изменяем вывод стран. Не учитываем страны СНГ при показе (factor==0) */ //$query = "SELECT * FROM `travel_country` WHERE (`lang` = '{$lang_id}') ORDER BY `name` ASC"; $query = "SELECT * FROM `travel_country` WHERE (`lang` = '{$lang_id}' AND `factor`>0) ORDER BY `name` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $country_value['key'][$k]=$v['key']; $country_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `travel_type_visa` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $type_visa_value['key'][$k]=$v['key']; $type_visa_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `travel_period` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $period_many_value['key'][$k]=$v['key']; $period_many_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `travel_medical_summa` WHERE (`lang` = '{$lang_id}') AND (`program` = '{$program_id}') AND (`country` = '{$country_zone}') ORDER BY `key` DESC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $summa_med_value['key'][$k]=$v['key']; $summa_med_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `travel_ns_summa` WHERE (`lang` = '{$lang_id}') AND (`program`='{$program_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $summa_ns_value['key'][$k]=$v['key']; $summa_ns_value['value'][$k]=$v['name']; } array_multisort($summa_ns_value['value'], SORT_ASC, SORT_NUMERIC); $query = "SELECT * FROM `travel_luggage` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $luggage_value['key'][$k]=$v['key']; $luggage_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `travel_citizenship` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $citizenship_value['key'][$k]=$v['key']; $citizenship_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `travel_add_risk` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $add_risk_value['key'][$k]=$v['key']; $add_risk_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `tooltip` WHERE (`lang` = '{$lang_id}') AND (`calculatorId` = '7') ORDER BY `id` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $tooltip_value[$v['itemId']] = $v['value']; } for ($i = 1; $i <= 31; $i++) { $count_day[] = $i; } for ($i = date( "Y"); $i >= (date( "Y")-80); $i--) { $count_year[] = $i; } empty ($post['period_from']) ? $post['period_from'] = date ("d.m.Y") : "" ; $smarty->assign ("post",$post); $smarty->assign ("error",$error); $smarty->assign ("program_value",$program_value); $smarty->assign ("country_value",$country_value); $smarty->assign ("type_visa_value",$type_visa_value); $smarty->assign ("period_many_value",$period_many_value); $smarty->assign ("summa_med_value",$summa_med_value); $smarty->assign ("summa_ns_value",$summa_ns_value); $smarty->assign ("luggage_value",$luggage_value); $smarty->assign ("citizenship_value",$citizenship_value); $smarty->assign ("add_risk_value",$add_risk_value); $smarty->assign ("count_day",$count_day); $smarty->assign ("count_year",$count_year); $smarty->assign ("count_month",array(1,2,3,4,5,6,7,8,9,10,11,12)); $smarty->assign("tooltip_value",$tooltip_value); $smarty->assign ("signin",$signin); $smarty->display ("insurance/voyage.tpl"); $_SESSION['post'] = false; ?>