Файл: whois.php
Строк: 215
<?
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[WhoisTitle]);
print "<H1 class=pagetitle>".$_lang[WhoisTitle]."</H1><hr class=hr>";
printWhoisForm("","","utf-8");
if ($fulldomain) {
$domain = mb_split(".",$fulldomain);
$domain = $domain[0];
$zone = preg_replace("/$domain./ui","",$fulldomain);
}
if ($domain or $checkedzones or $zone) {
$weSalesTypes = GetSetting("weSalesTypes");
$weSalesTypes = @mb_split("::",$weSalesTypes);
print "<H1 class=pagetitle>".$_lang[WhoisCheckResult]."</H1><hr class=hr>";
if ($zone) { $checkedzones = array($zone); }
if (!$domain or @is_array($domain)) { $error = $_lang[WhoisErrorDomain]; }
else if (!$checkedzones) { $error = $_lang[WhoisErrorZone]; }
if ($error) { print "<font color=red>".$_lang[Error].": $error</font><BR><BR>"; }
else {
print "<table class='rpTableBlank' border=0 cellspacing=0 cellpadding=3>";
$freecnt = 0;
while (list($k, $v) = @each($checkedzones)) {
$d = new domain($domain.".".$v);
$order = "";
if (@in_array("hosting",$weSalesTypes) and @in_array("domains",$weSalesTypes)) {
$order .= "<b>[ <A class=rootlink href=order.php?zone=$v&domain=$domain&domain_reg=1>".$_lang[WhoisOrderHostAndDomain]."</a> ]</b> ";
}
if (@in_array("domains",$weSalesTypes)) {
$order .= "<b>[ <A class=rootlink href=order.php?type=d&zone=$v&domain=$domain>".$_lang[WhoisOrderDomain]."</a> ]</b> ";
}
if ($d->is_available()) {
$err = $d->last_error;
if ($err) {
$avail = $_lang[WhoisAvailError];
$color = "domainerror";
} else {
$avail = $_lang[WhoisAvailFree];
$color = "domainfree";
$freecnt++;
}
if (IsZoneActive($v)) { $act = $order; } else { $act = $_lang[WhoisDomainNotActive]; }
} else {
$avail = $_lang[WhoisAvailNotFree];
$color = "domainreged";
$act = "";
if (@in_array("hosting",$weSalesTypes)) {
$act .= "<b>[ <A class=rootlink href=order.php?zone=$v&domain=$domain&domain_reg=0>".$_lang[WhoisOrderHost]."</a> ]</b> ";
}
$act .= "<B>[ <A class=rootlink href=?whoisdomain=$d->domain>".$_lang[WhoisWhois]."</a> ]</b> ";
}
print "<tr><td><B>$d->domain </b></td><Td align=center class=$color> $avail </td><td align=left> $act </td><td>$err</td></tr>";
$err="";
}
print "</table>";
$whoisShow = GetSetting("whoisShow");
if ($whoisShow == "1" or ($whoisShow == "2" and $freecnt == 0)) {
print "<BR><H1 class=pagetitle>".$_lang[WhoisFreeDomainsInOtherZones]."</H1><hr class=hr>";
print "<table class='rpTableBlank' border=0 cellspacing=0 cellpadding=3>";
$cnt = 0;
$allzones = GetZonesNamesForWhois();
while (list($k, $v) = @each($allzones)) {
if (!in_array($v,$checkedzones)) {
$d = new domain($domain.".".$v);
$order = "";
if (@in_array("hosting",$weSalesTypes) and @in_array("domains",$weSalesTypes)) {
$order .= "<b>[ <A class=rootlink href=order.php?zone=$v&domain=$domain&domain_reg=1>".$_lang[WhoisOrderHostAndDomain]."</a> ]</b> ";
}
if (@in_array("domains",$weSalesTypes)) {
$order .= "<b>[ <A class=rootlink href=order.php?type=d&zone=$v&domain=$domain>".$_lang[WhoisOrderDomain]."</a> ]</b> ";
}
if ($d->is_available() and !$d->last_error) {
print "<tr><td><B>$d->domain </b></td><Td align=center class=domainfree> ".$_lang[WhoisAvailFree]." </td><td align=left> $order </td></tr>";
$cnt++;
}
}
}
if ($cnt == 0) { print "<tr><td>".$_lang[WhoisNoFreeDomainsInOtherZones]."</td></tr>"; }
print "</table>";
}
if (@mb_strlen($domain) == 2) {
print "<BR><font color=red>".$_lang[Warning]."</font> ".$_lang[WhoisAboutDomainLength];
}
}
}
if ($whoisdomain) {
print "<H1 class=pagetitle>".$_lang[WhoisDomainInfo]."</H1><hr class=hr>";
$d = new domain($whoisdomain);
$whois_info = $d->html_info();
if ($d->last_error) {
print $_lang[Error].": $d->last_error";
}
else {
print "$whois_info";
}
}
foot('utf-8');
mclose();
?>