$card_id = 0; foreach (explode(",", $clients) as $v) { $sql = mysql_query("SELECT card_id, vip FROM " . TABLE_CLIENT . " WHERE client_id='{$v}' ") or Error(1, __FILE__, __LINE__); $arr1 = @mysql_fetch_array($sql); if (@$arr1['card_id'] && !$card_id) { $sql_arr[] = "card_id='{$arr1['card_id']}'"; $sql_arr[] = "card_vip='{$arr1['vip']}'"; $card_id = $arr1['card_id']; } mysql_query("UPDATE " . TABLE_CLIENT . " SET ordercount=ordercount+1 WHERE client_id='{$v}' ") or Error(1, __FILE__, __LINE__); } $sql_str = join(", ", $sql_arr); $order_id = get_next_order_id(); $account = ''; if (class_exists('Lider', false)) { $lider = new Lider(); $account = $lider->setup()->makeAccount(); } mysql_query("INSERT INTO " . TABLE_ORDER . " SET {$sql_str}, order_id='{$order_id}', user_id={$_SESSION['admin_id']}, object_id={$object_id},\n\t\t\t\tdate=CURDATE(), status=1, lider_account='{$account}'") or Error(1, __FILE__, __LINE__); //$order_id = mysql_insert_id(); mysql_query("DELETE FROM " . TABLE_DOC . " WHERE order_id='{$order_id}'") or Error(1, __FILE__, __LINE__); if ($siteorder_id) { mysql_query("UPDATE " . TABLE_SITEORDER . " SET order_id='{$order_id}', user_id={$_SESSION['admin_id']}, status=2 WHERE siteorder_id={$siteorder_id}") or Error(1, __FILE__, __LINE__); } $_SESSION['form_data'] = ''; generate_order($order_id, 'zayavka', $stamp); if (is_array(@$suite_list)) { $suite_arr = array(); $tour_id = @$tour_id ? $tour_id : 0; foreach ($suite_list as $k => $v) { if (add_order_gz($order_id, $k, $date_from_sql, $date_to_sql, $v, $tour_id)) {
<?php require 'Lider.php'; if (class_exists('Lider', false)) { $lider = new Lider(); $lider->setup()->execute($_REQUEST); }
$replace['dogovor_link'] = "?p=order&order_id={$order_id}&step=3"; $replace['provider_bill'] = htmlspecialchars($replace['provider_bill'], ENT_COMPAT, 'cp1251'); if ($replace['prepayment']) { $sum = $replace['prepaid'] ? $replace['inall'] - $replace['prepayment'] : $replace['prepayment']; $prepaid = $replace['prepaid'] ? 2 : 1; } else { $sum = $replace['inall']; $prepaid = 0; } $replace['sum'] = $sum; $replace['pay_phrase'] = $prepaid == 2 ? 'доплаты' : ($prepaid ? 'предоплаты' : 'оплаты'); //$replace['pay_link'] = 'http://my.tour-shop.ru/platron/init.php?sum='.$sum.'&order_id='.$replace['order_id']."&prepaid=$prepaid"; $replace['pay_link'] = 'http://rs.tour-shop.ru/lider/?command=cpay&account=' . $replace['lider_account']; $replace['lider_pay_amount'] = 0; if (class_exists('Lider', false)) { $lider = new Lider(); $replace['lider_pay_amount'] = $lider->getPayAmount($replace); } $arr_file = get_file_info($provider_file_owner, $order_id); if (count($arr_file)) { $replace = array_merge($replace, $arr_file[0]); } else { $replace['filename'] = ''; } $other_payment = array(); $payform = $replace['cash'] ? 'наличные' : ($replace['emoney'] ? 'электронные' : 'безналичный'); $replace['plus'] = 0; $replace['minus'] = 0; if ($replace['prepayment']) { if ($replace['prepaid']) { if ($replace['prepayment'] == $replace['inall']) {