"; print "

".$_lang[CalcTitle]."


"; if ($do == 'order') { if ($domain_reg == '') {$error=$_lang[OrderErrorNoDomainReg]; $do='';} else if ((!$domain or !$zone_id) and !$otherdomain and $domain_reg != "2" and $vid != "vpn") {$error=$_lang[OrderErrorNoDomain]; $do='';} else if (!$tarif_id) {$error=$_lang[OrderErrorNoTarif]; $do='';} else if (!$months[$tarif_id]) {$error=$_lang[OrderErrorNoSrokZakaza]; $do='';} else { if ($domain and $zone_id) { $zone = GetZoneById($zone_id); $domain=strtolower($domain); $fulldomain=strtolower($domain.".".$zone->zone); } else { $fulldomain=$otherdomain; } $link = "order.php?vid=$vid&tarif=$tarif_id&domain_reg=$domain_reg&domain=$domain&zone=$zone->zone&otherdomain=$otherdomain"; if ($fulldomain) { $dom=new domain($fulldomain); } if ($domain_reg == "1" and (mb_strlen($domain) < $zone->minWidth or mb_strlen($domain) > $zone->maxWidth)) { $error = $_lang[OrderErrorDomainLength]; $error=str_replace("{minWidth}",$zone->minWidth,$error);$error=str_replace("{maxWidth}",$zone->maxWidth,$error); $do='';} else if ($domain_reg == "1" and !preg_match("/^[a-z0-9]{1}[a-z0-9-]+[a-z0-9]{1}$/u",$domain)) { $error = $_lang[OrderErrorDomainSymbols]; $do=''; } else if ($domain_reg == "1" and !$dom->is_available()) {$error=$_lang[OrderErrorDomainRegistered]; $do='';} else { $hostmonths=$months[$tarif_id]; $addonsCost=0; $selectedAddons=$addons[$tarif_id]; $addonsToSave=""; $addonsToSaveText=""; while (list($k,$v) = @each($selectedAddons)) { if ($v) { $selectedAddon = GetAddonById($v); if ($addonsToSaveText) { $addonsToSaveText = $addonsToSaveText.", ".$selectedAddon->name; } else { $addonsToSaveText = $selectedAddon->name; } $addonsToSave = $addonsToSave.":x:$selectedAddon->id"; #Устанавливаем спец. цену, если она указана для данной доп. услуги и данного пользователя # $addonSpecCost = GetSpecialCost($_SESSION['userId'],"addon",$selectedAddon->id); if ($addonSpecCost) { $addonsCost += $addonSpecCost["cost1"]; $addonsCost += $addonSpecCost["cost2"]*$hostmonths; } else { $addonsCost += $selectedAddon->cost_start; $addonsCost += $selectedAddon->cost_monthly*$hostmonths; } } } if (!$addonsToSaveText) { $addonsToSaveText="нет"; } # Учитываем скидку на доп. услуги при регистрации клиента с указанием источника имеющего скидку # if ($aboutusfromid and $addonsCost > 0) { $addonsCost=$addonsCost-($addonsCost/100)*GetAboutUsFromDiscount($aboutusfromid,'addon'); } $addonsCost=round($addonsCost,2); $t=@mysql_query("select id,cost,cost_setup,name from tarifs where id='$tarif_id'") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); $t=mysql_fetch_object($t); #Устанавливаем спец. цену, если она указана для данного тарифа и данного пользователя # $tarifSpecCost = GetSpecialCost($_SESSION['userId'],"tarif",$t->id); if ($tarifSpecCost) { $host_setup = $tarifSpecCost["cost1"]; $hostcost = $tarifSpecCost["cost2"]; } else { $host_setup = $t->cost_setup; $hostcost = $t->cost; } $tsroki=@mysql_query("select discount from tarifs_sroki where tarif_id='$tarif_id' and months='$hostmonths'") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); if (mysql_num_rows($tsroki) > 0) { $tsroki=mysql_fetch_object($tsroki); $srokDiscount=$tsroki->discount; } else { $srokDiscount=0; } $host=$hostcost*$hostmonths; $host=$host-($host/100)*$srokDiscount+$host_setup; # Учитываем скидку на хостинг при регистрации клиента с указанием источника имеющего скидку # if ($aboutusfromid and $host > 0) { $host=$host-($host/100)*GetAboutUsFromDiscount($aboutusfromid,'host'); } $host=round($host,2); $dom=0; if ($domain_reg == "1") { $tzones=@mysql_query("select id,cost_if_host,minsrok from zones where id='$zone_id'") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); $tzones=mysql_fetch_object($tzones); #Устанавливаем спец. цену, если она указана для данной доменной зоны и данного пользователя # $domSpecCost = GetSpecialCost($_SESSION['userId'],"zone",$tzones->id); if ($domSpecCost) { $domaincost=$domSpecCost["cost1"]; } else { $domaincost=$tzones->cost_if_host; } $domainminsrok=$tzones->minsrok; $dom=$domaincost*($domainminsrok/12); # Учитываем скидку на домен при регистрации клиента с указанием источника имеющего скидку # if ($aboutusfromid and $dom > 0) { $dom=$dom-($dom/100)*GetAboutUsFromDiscount($aboutusfromid,'domain'); } $dom=round($dom,2); $allsumm = $host+$dom+$addonsCost; $domainfree = 0; $tfreedomains=@mysql_query("select * from tarifs_freedomains where tarif_id='$tarif_id' and zone='$zone->zone' and hostmonths='$hostmonths'") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); if (mysql_num_rows($tfreedomains) > 0) {$domainfree=1;} $tfreedomains=@mysql_query("select * from tarifs_freedomains where tarif_id='$tarif_id' and zone='$zone->zone' and ordersum > 0 and ordersum <= $allsumm") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); if (mysql_num_rows($tfreedomains) > 0) {$domainfree=1;} if ($domainfree) {$dom=0; $bonus=$_lang[OrderFreeDomainInZone]." $zone->zone
";} } print "
".$_lang[OrderParamsOfOrder].":
".$_lang[OrderTarif].": $t->name
".$_lang[OrderSrokZakaza].": $hostmonths ".$_lang[OrderSokraschenieMonth].".
".$_lang[OrderDomain].": $fulldomain [ $_newreg[$domain_reg] ]
$bonus ".$_lang[OrderAddons].": $addonsToSaveText

".$_lang[OrderTotal].":
".$_lang[OrderType][hosting].": ".round($host*CURK,2)." ".CURS."
".$_lang[Domain].": ".round($dom*CURK,2)." ".CURS."
".$_lang[OrderAddons].": ".round($addonsCost*CURK,2)." ".CURS."

".$_lang[OrderTotal].": ".round(($host+$dom+$addonsCost)*CURK,2)." ".CURS."

".$_lang[CalcGotoOrder]."

".$_lang[CalcNePodhodid]."... ".$_lang[CalcAgain]." "; } } } if ($do == 'ordershop') { $shop = GetShopItemById($item_id); if (!$item_id) {$error=$_lang[OrderErrorNoItem]; $do='';} else if ($shop->costtype != "one" and !$months[$item_id]) {$error=$_lang[OrderErrorNoSrokZakaza]; $do='';} else { if ($_SESSION['userId']) { $itemSpecCost = GetSpecialCost($_SESSION['userId'],"shop",$shop->id); if ($itemSpecCost) { $shop->cost = $tarifSpecCost["cost1"]; } } $itemmonths = $months[$item_id]; $itemcost = $shop->cost; if ($shop->costtype == "month") { $itemcost=$itemcost*$itemmonths; } else if ($shop->costtype == "year") { $itemcost=$itemcost*($itemmonths/12); } $itemcost = round($itemcost,2); if ($shop->costtype == "month") {$msrok = $itemmonths." ".$_lang[OrderSokraschenieMonth]; } else if ($shop->costtype == "year") {$msrok = ($itemmonths/12)." ".$_lang[OrderSokraschenieGod];} else { $msrok = $_lang[OrderRazovo]; } print "
".$_lang[OrderParamsOfOrder].":
".$_lang[OrderItem].": $shop->name
".$_lang[OrderSrokZakaza].": $msrok

".$_lang[OrderTotal].":
".$_lang[OrderItem].": ".round($itemcost*CURK,2)." ".CURS."

".$_lang[CalcGotoOrder]."

".$_lang[CalcNePodhodid]."... ".$_lang[CalcAgain]." "; } } if ($vid and $vid != "shop" and !$do) { if ($error) {print "".$_lang[Error].": $error

";} if ($vid == "vpn") {$domain_reg='2';} if ($domain_reg == '2') {$check3='checked'; $disabled='disabled'; $disabled2='disabled';} else if ($domain_reg == '0') {$check1='checked'; $disabled=''; $disabled2='';} else if ($domain_reg == '1') {$check2='checked'; $disabled='disabled'; $disabled2='';} else {$check2='checked'; $disabled='disabled';} if (!($vid == "hosting" or $vid == "reseller" or $vid == "vds" or $vid == "dedicated" or $vid == "vpn")) {$vid='hosting';} if ($tarif) { $r = @mysql_query("select * from tarifs where active='1' and name='$tarif' or id='".intval($tarif)."'") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); if (mysql_num_rows($r) > 0) { $r = mysql_fetch_object($r); $tarif_id = $r->id; $tarif_group = $r->tarifsgroup; $vid = $r->vid; } else { $tarif = ""; } } ?>
> >>>
:

* : >
>
>
* : value="">
:
value="" size=30>
* : Line: ".__LINE__."
MySQL Error: ".mysql_error()); $tarifs_cnt = mysql_num_rows($r); while ($rr = mysql_fetch_object($r)) { if ($rr->id == $tarif_id or $tarif == $rr->name or $tarifs_cnt == 1) {$addon='checked'; $tarif_id=$rr->id;} else {$addon='';} if ($rr->cost_setup) {$addon_cost=" + ".round($rr->cost_setup*CURK,2)." ".CURS." ".$_lang[OrderRazovoZaUstanovku];} else {$addon_cost="";} print "id $addon onclick='showdiv(this.value);'> $rr->name (".round($rr->cost*CURK,2)." ".CURS."/".$_lang[OrderSokraschenieMonth].$addon_cost.")
"; } ?>
* : tarif_id == $tarif_id) {$style="style='display: block;'";} else {$style="style='display: none;'";} if (!$last_tarif_id) {print "
tarif_id $style>
tarif_id $style>
"; ?>
: addons); if ($rr->id == $tarif_id) {$style="style='display: block;'";} else {$style="style='display: none;'";} print "
id $style>"; $cntAddons=0; while (list($k,$v) = @each($addonsForTarif)) { if ($v) { $oneAddon = GetAddonById($v); if ($oneAddon->active) { $addonMoney = ""; if ($oneAddon->cost_start) { $addonMoney=round($oneAddon->cost_start*CURK,2)." ".CURS." ".$_lang[OrderRazovo]; if ($oneAddon->cost_monthly) {$addonMoney = $addonMoney." + ";} } if ($oneAddon->cost_monthly) {$addonMoney=$addonMoney.round($oneAddon->cost_monthly*CURK,2)." ".CURS."/".$_lang[OrderSokraschenieMonth];} if (!$addonMoney) { $addonMoney = $_lang[OrderFree]; } print "id][] value=$oneAddon->id>$oneAddon->name ($addonMoney)
"; $cntAddons++; } } } if (!$cntAddons) { print $_lang[No]; } print "
"; } print ""; ?>
 

* - ".$_lang[Error].": $error

";} if ($item) { $r = @mysql_query("select * from shop_items where active=1 and name='$item' or id='".intval($item)."'") or die("File: ".__FILE__."
Line: ".__LINE__."
MySQL Error: ".mysql_error()); if (mysql_num_rows($r) > 0) { $r = mysql_fetch_object($r); $item_id = $r->id; $item_group = $r->tarifsgroup; } else { $item = ""; } } ?>
>
:

* : Line: ".__LINE__."
MySQL Error: ".mysql_error()); $items_cnt = mysql_num_rows($r); while ($rr = mysql_fetch_object($r)) { if ($_SESSION['userId']) { $itemSpecCost = GetSpecialCost($_SESSION['userId'],"shop",$rr->id); if ($itemSpecCost) { $rr->cost = $itemSpecCost["cost1"]; } } if ($rr->id == $item_id or $item == $rr->name or $items_cnt == 1) {$addon='checked'; $item_id=$rr->id;} else {$addon='';} if ($rr->costtype == "month") { $itemCostTxtAddon = "/".$_lang[OrderSokraschenieMonth];} else if ($rr->costtype == "year") { $itemCostTxtAddon = "/".$_lang[OrderSokraschenieGod];} else { $itemCostTxtAddon = " ".$_lang[OrderRazovo]; } $itemCostTxt = round($rr->cost*CURK,2)." ".CURS.$itemCostTxtAddon; $rr->description = htmlDecode($rr->description); $rr->description = preg_replace("/\n/ui","
",$rr->description); if ($rr->description) {$description="\"$rr-description\" border=0>";} else {$description="";} print "id $addon onclick='showdiv(this.value);'> $rr->name (".$itemCostTxt.") $description
"; } ?>
* : Line: ".__LINE__."
MySQL Error: ".mysql_error()); while ($rr = mysql_fetch_object($r)) { if ($rr->id == $item_id) {$style="style='display: block;'";} else {$style="style='display: none;'";} print "
id $style>"; if ($rr->costtype == "one") { print $_lang[OrderRazovo]; } else { print ""; } print "
"; } print ""; ?>
 

* - ".$_lang[CalcSelect].":

"; print "
"; if (@in_array("hosting",$weSalesTypes)) { $resPrint .= " ".$_lang[OrderType]["hosting"]."
";} if (@in_array("reseller",$weSalesTypes)) { $resPrint .= " ".$_lang[OrderType]["reseller"]."
";} if (@in_array("vds",$weSalesTypes)) { $resPrint .= " ".$_lang[OrderType]["vds"]."
";} if (@in_array("dedicated",$weSalesTypes)) { $resPrint .= " ".$_lang[OrderType]["dedicated"]."
";} if (@in_array("vpn",$weSalesTypes)) { $resPrint .= " ".$_lang[OrderType]["vpn"]."
";} if (@in_array("shop",$weSalesTypes)) { $resPrint .= " ".$_lang[OrderItem]."
";} print $resPrint; print "
"; } foot('utf-8'); mclose(); ?>