Файл: zones.php
Строк: 456
<?
session_set_cookie_params(86400);
session_start();
$full_home_path = dirname(__FILE__);
require_once($full_home_path."/_rootload.php");
mconnect();
validateUser();
if (!EnableLanguages()) { error("Can not load languages."); mclose(); exit; }
if (!GetCurrentCurrency()) { print $_lang[ErrorGetCurrentCurrency]; mclose(); exit; }
head('utf-8',$_lang[OrderAvailZones]);
$zonesShowRegistrator=GetSetting("zonesShowRegistrator");
$zonesgroups = GetZonesGroups();
$isBegin = true;
while ($isBegin or $zonesgroup = @mysql_fetch_object($zonesgroups)) {
if ($isBegin) {
print "<H1 class=pagetitle>".$_lang[OrderAvailZones]."</H1><hr class=hr>";
if (GetSetting("usersChangeCurrency")) {
print "<form style="margin: 0" method=post>";
print $_lang[tarifsCurrency].": ";
print "<select class=input name=valuta>";
$r = GetCurrencys();
while ($rr = mysql_fetch_object($r)) {
if ($rr->code == $valuta or $rr->code == CURС) { $selected = "selected"; } else { $selected = ""; }
print "<option value='$rr->code' $selected>$rr->name</option>";
}
print "</select> <input type=submit class=button value=OK></form><BR>";
}
$zones = GetZonesActive("0","1");
if (!(@mysql_num_rows($zones) > 0)) {$isBegin = false; continue;}
} else {
$zones = GetZonesActive($zonesgroup->id,"1");
}
if (@mysql_num_rows($zones) > 0) {
if (!$isBegin) {
print "<H1 class=pagetitle>".$zonesgroup->name."</H1><hr class=hr>";
}
if ($zonesgroup->description and !$isBegin) {
$zonesgroup->description = htmlDecode($zonesgroup->description);
$zonesgroup->description = preg_replace("/n/ui","<br>",$zonesgroup->description);
print $zonesgroup->description; print "<BR><BR>";
}
$tableRows = 3;
$domainCostType = GetSetting("domainCostType");
$zonesShowReg=GetSetting("zonesShowReg");
$zonesShowRenew=GetSetting("zonesShowRenew");
$zonesShowReg2=GetSetting("zonesShowReg2");
$zonesShowRenew2=GetSetting("zonesShowRenew2");
$zonesShowRegHostReseller=GetSetting("zonesShowRegHostReseller");
$zonesShowRenewHostReseller=GetSetting("zonesShowRenewHostReseller");
$zonesShowRegReseller=GetSetting("zonesShowRegReseller");
$zonesShowRenewReseller=GetSetting("zonesShowRenewReseller");
if ($zonesShowReg) { $tableRows++; }
if ($zonesShowRenew) { $tableRows++; }
if ($zonesShowReg2) { $tableRows++; }
if ($zonesShowRenew2) { $tableRows++; }
if ($zonesShowRegHostReseller) { $tableRows++; }
if ($zonesShowRenewHostReseller) { $tableRows++; }
if ($zonesShowRegReseller) { $tableRows++; }
if ($zonesShowRenewReseller) { $tableRows++; }
print "<table class='rpTable'>";
print "<tr class=$font_head align=left>";
print "<Td align=center>".$_lang[OrderZoneSmall]."</td>";
print "<td align=center>".$_lang[OrderSrokSmall]."</td>";
if ($zonesShowReg) { print "<td align=center><B>".$_lang[ZonesReg]."</B><BR>"; if (!$domainCostType) {print $_lang[ZonesRegCost0]; } else {print $_lang[ZonesRegCost1]; } print "</td>"; }
if ($zonesShowReg2) { print "<td align=center><B>".$_lang[ZonesReg]."</B><BR>"; if (!$domainCostType) {print $_lang[ZonesReg2Cost0]; } else {print $_lang[ZonesReg2Cost1]; } print "</td>"; }
if ($zonesShowRegHostReseller) { print "<td align=center><B>".$_lang[ZonesReg]."</B><BR>".$_lang[ZonesHostReseller]."</td>"; }
if ($zonesShowRegReseller) { print "<td align=center><B>".$_lang[ZonesReg]."</B><BR>".$_lang[ZonesReseller]."</td>"; }
if ($zonesShowRenew) { print "<td align=center><B>".$_lang[ZonesRenew]."</B><BR>"; if (!$domainCostType) {print $_lang[ZonesRenewCost0]; } else {print $_lang[ZonesRegCost1]; } print "</td>"; }
if ($zonesShowRenew2) { print "<td align=center><B>".$_lang[ZonesRenew]."</B><BR>"; if (!$domainCostType) {print $_lang[ZonesRenew2Cost0]; } else {print $_lang[ZonesReg2Cost1]; } print "</td>"; }
if ($zonesShowRenewHostReseller) { print "<td align=center><B>".$_lang[ZonesRenew]."</B><BR>".$_lang[ZonesHostReseller]."</td>"; }
if ($zonesShowRenewReseller) { print "<td align=center><B>".$_lang[ZonesRenew]."</B><BR>".$_lang[ZonesReseller]."</td>"; }
print "<td></td>";
print "</tr>";
getfont();
$cnt=0;
while ($zone = mysql_fetch_object($zones)) {
getfont();
$cnt++;
if ($zonesShowRegistrator and $zone->autoreg) {
$registrator = GetRegistratorNameById($zone->autoreg);
if ($registrator) {
$regAddon = "<img src='./_rootimages/question.gif' alt='<B>".$_lang[OrderDomainRegistrator].":</B><BR>$registrator'>";
} else {
$regAddon = "";
}
} else {
$regAddon = "";
}
$zone->description = htmlDecode($zone->description);
$zone->description = preg_replace("/n/ui","<br>",$zone->description);
if ($zone->description) { $description = "<img src=./_rootimages/question.gif alt="$zone->description" border=0>"; } else { $description = ""; }
$zone->cost_if_not_host = $zone->cost_if_not_host / GetCurrencyKoeficientByCode($zone->cost_if_not_hostCurrency);
$zone->cost_if_host = $zone->cost_if_host / GetCurrencyKoeficientByCode($zone->cost_if_hostCurrency);
$zone->cost_if_reseller = $zone->cost_if_reseller / GetCurrencyKoeficientByCode($zone->cost_if_resellerCurrency);
$zone->cost_if_domainreseller = $zone->cost_if_domainreseller / GetCurrencyKoeficientByCode($zone->cost_if_domainresellerCurrency);
$zone->renew_if_not_host = $zone->renew_if_not_host / GetCurrencyKoeficientByCode($zone->renew_if_not_hostCurrency);
$zone->renew_if_host = $zone->renew_if_host / GetCurrencyKoeficientByCode($zone->renew_if_hostCurrency);
$zone->renew_if_reseller = $zone->renew_if_reseller / GetCurrencyKoeficientByCode($zone->renew_if_resellerCurrency);
$zone->renew_if_domainreseller = $zone->renew_if_domainreseller / GetCurrencyKoeficientByCode($zone->renew_if_domainresellerCurrency);
print "<tr class=$font_row height=30>";
print "<Td align=left>.".$zone->zone." ".$regAddon.$description."</td>";
print "<td align=center>".($zone->minsrok/12)." ".$_lang[OrderSokraschenieGod]."</td>";
if ($zonesShowReg) { print "<td align=center>".round($zone->minsrok/12*$zone->cost_if_not_host*CURK,2)." ".CURS."</td>"; }
if ($zonesShowReg2) { print "<td align=center>".round($zone->minsrok/12*$zone->cost_if_host*CURK,2)." ".CURS."</td>"; }
if ($zonesShowRegHostReseller) { print "<td align=center>".round($zone->minsrok/12*$zone->cost_if_reseller*CURK,2)." ".CURS."</td>"; }
if ($zonesShowRegReseller) { print "<td align=center>".round($zone->minsrok/12*$zone->cost_if_domainreseller*CURK,2)." ".CURS."</td>"; }
if ($zonesShowRenew) { print "<td align=center>".round($zone->minsrok/12*$zone->renew_if_not_host*CURK,2)." ".CURS."</td>"; }
if ($zonesShowRenew2) { print "<td align=center>".round($zone->minsrok/12*$zone->renew_if_host*CURK,2)." ".CURS."</td>"; }
if ($zonesShowRenewHostReseller) { print "<td align=center>".round($zone->minsrok/12*$zone->renew_if_reseller*CURK,2)." ".CURS."</td>"; }
if ($zonesShowRenewReseller) { print "<td align=center>".round($zone->minsrok/12*$zone->renew_if_domainreseller*CURK,2)." ".CURS."</td>"; }
print "<td><a class=rootlink href=order.php?type=d&zone=$zone->zone>".$_lang[Order]."</a></td>";
print "</tr>";
}
print "<tr class=$font_head align=left><Td colspan=$tableRows>".$_lang[ZonesTotal].": $cnt</td></tr>";
print "</table><BR>";
$isBegin = false;
}
}
foot('utf-8');
mclose();
?>