setJavascript ("/js/jquery.form.js"); $htmlhead->setJavascript ("/js/jquery.validate.js"); $htmlhead->setJavascript ("/js/additional-methods.js"); $htmlhead->setJavascript ("/module/insurance/amulet_logic.js"); $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_amulet_logic.js"); $nssum_id = $_POST['summa_nc']; } else { $nssum_id = 1; } 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']))) { $amulet = new amulet; $amulet->sql_link = $sql; $post = $amulet->getOrderInfo($id, $_SESSION['id']); $post = array_merge($post, $userinfo); $htmlhead->setJavascript ("/module/insurance/save_amulet_logic.js"); } $signin = (isset ($_SESSION['signin']) AND ($_SESSION['signin'] === true)) ? 'true' : 'false' ; $lang_id = constant ("LANG"); $query = "SELECT * FROM `amulet_med_summa` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $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 `amulet_nc_summa` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { if ($v['key'] == $nssum_id) { $summa_nc_value['key'][$k]=$v['key']; $summa_nc_value['value'][$k]=$v['name']; } } $query = "SELECT * FROM `type_payment` WHERE (`lang` = '{$lang_id}') ORDER BY `key` ASC"; $a = $sql->QuickResult ( $query ); foreach ($a as $k=>$v) { $type_pay_value['key'][$k]=$v['key']; $type_pay_value['value'][$k]=$v['name']; } $query = "SELECT * FROM `tooltip` WHERE (`lang` = '{$lang_id}') AND (`calculatorId` = '5') 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; } $smarty->assign ("post",$post); $smarty->assign ("error",$error); $smarty->assign ("summa_med_value",$summa_med_value); $smarty->assign ("summa_nc_value",$summa_nc_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 ("type_pay_value",$type_pay_value); $smarty->assign ("signin",$signin); $smarty->display ("insurance/amulet.tpl"); $_SESSION['post'] = false; ?>