Файл: billing/_rootfuncs.php
Строк: 2160
<?
function EnableLanguages( $isAdmin = 0 )
{
global $full_home_path,$lang,$newlang,$languages,$_SESSION,$_lang,$login,$pass;
require_once($full_home_path."/_rootlang/_langconfig.inc.php");
require_once($full_home_path."/_rootlang/russian.inc.php");
@include_once($full_home_path."/_rootlang/russian.local.inc.php");
if (!$isAdmin)
{
$default_language = GetSetting("lngDefault");
$lngUsersCanChange = GetSetting("lngUsersCanChange");
if ($lngUsersCanChange)
{
$lngEnableLangVariable = GetSetting("lngEnableLangVariable");
if ($lngEnableLangVariable)
{
$lang = strtolower($lang);
}
else
{
$lang = "";
}
if ($newlang)
{
$lang = $newlang;
}
if ($lang || !$_SESSION['userLogin'] || $login && $pass)
{
$user = GetUserByLogin($login);
if ($user->lang)
{
$lang = $user->lang;
}
}
if ($lang && $languages[$lang] != "")
{
$_SESSION['userLang'] = $lang;
}
else if (!$_SESSION['userLang'])
{
$_SESSION['userLang'] = $default_language;
}
else if ($_SESSION['userLang'])
{
$sess_lang = $_SESSION['userLang'];
if (!$sess_lang && $sess_lang && !$languages[$sess_lang])
{
$_SESSION['userLang'] = $default_language;
}
}
}
else
{
$_SESSION['userLang'] = $default_language;
}
if ($_SESSION['userLang'] && @file_exists($full_home_path."/_rootlang/".$_SESSION['userLang'].".inc.php"))
{
require_once($full_home_path."/_rootlang/".$_SESSION['userLang'].".inc.php");
@include_once($full_home_path."/_rootlang/".$_SESSION['userLang'].".local.inc.php");
LoadLanguageToParams();
return $_SESSION['userLang'];
}
return false;
}
LoadLanguageToParams();
}
function LoadLanguageToVariable($lng = "")
{
global $full_home_path;
require($full_home_path."/_rootlang/_langconfig.inc.php");
require($full_home_path."/_rootlang/russian.inc.php");
@include($full_home_path."/_rootlang/russian.local.inc.php");
if ($lng && $languages[$lng])
{
require($full_home_path."/_rootlang/".$lng.".inc.php");
@include($full_home_path."/_rootlang/".$lng.".local.inc.php");
return $_lang;
}
$default_language = GetSetting("lngDefault");
if ($languages[$default_language])
{
require($full_home_path."/_rootlang/".$default_language.".inc.php");
@include($full_home_path."/_rootlang/".$default_language.".local.inc.php");
}
return $_lang;
}
function LoadLanguageToParams()
{
global $_lang,$_yes,$_status,$_statusBill,$_newreg,$_renew,$_newregmin,$_renewmin,$_sort,$_priority,$_statusTicket;
$_yes[0] = $_lang[No];
$_yes[1] = $_lang[Yes];
$_status[0] = $_lang[OrderStatusNeObrabotan];
$_status[1] = $_lang[OrderStatusObrabotan];
$_status[2] = $_lang[OrderStatusSuspended];
$_statusBill[0] = $_lang[BillNotPayed];
$_statusBill[1] = $_lang[BillPayed];
$_statusBill[2] = $_lang[BillPayedUslovno];
$_newreg['0'] = $_lang[DomainExists];
$_newreg['1'] = $_lang[DomainNew];
$_newreg['2'] = $_lang[DomainWithout];
$_renew[0] = $_lang[DomainWithoutRenew];
$_renew[1] = $_lang[DomainRenew];
$_newregmin[0] = $_lang[DomainExistsMin];
$_newregmin[1] = $_lang[DomainNewMin];
$_newregmin[2] = $_lang[DomainWithoutMin];
$_renewmin[0] = $_lang[DomainWithoutRenewMin];
$_renewmin[1] = $_lang[DomainRenewMin];
$_sort[asc] = $_lang[SortAsc];
$_sort[desc] = $_lang[SortDesc];
$_priority[0] = $_lang[TicketPriority0];
$_priority[1] = $_lang[TicketPriority1];
$_priority[2] = $_lang[TicketPriority2];
$_statusTicket[open] = $_lang[TicketStatusOpen];
$_statusTicket[closed] = $_lang[TicketStatusClose];
$_statusTicket[wait] = $_lang[TicketStatusWait];
}
function StopIp($ip,$str)
{
if(stristr(",".$str.",",$ip))return true;
if(stristr(",".$str.",",",*,") || stristr(",".$str.",",",*"))return true;
$iplist = explode(" ",$str);
$ip = explode(".",$ip);
for($i = 0;$i<count($iplist);$i++)
{
if(eregi($ip[0].".?(".$ip[1]."|*).?(".$ip[2]."|*).?(".$ip[3]."|*).?",$iplist[$i]))return true;
}
}
function adminLogOn($log,$pas)
{
global $_SESSION,$ip;
$admin = @mysql_query("select * from admin_users where login='$log'" ) or die(mysql_error());
if (mysql_num_rows($admin) > 0)
{
$admin = mysql_fetch_object($admin);
if (crypt($pas,$admin->password) == $admin->password)
{
$_SESSION['adminId'] = $admin->id;
$_SESSION['adminName'] = $admin->name;
$_SESSION['adminHash'] = $admin->password;
$_SESSION['adminFullAccess'] = $admin->fullaccess;
$_SESSION['adminAccessto'] = $admin->accessto;
$_SESSION['adminAccesstoArray'] = split("::", $admin->accessto);
$_SESSION['adminIP'] = $ip;
$_SESSION['adminLastDate'] = $admin->curDate;
$_SESSION['adminLastIp'] = $admin->curIp;
$_SESSION['billsShow'] = "";
$_SESSION['domainShow'] = "";
$_SESSION['domainSort'] = "";
$_SESSION['domainDesc'] = "";
$_SESSION['orderShow'] = "";
$_SESSION['orderShowVid'] = "";
$_SESSION['orderSort'] = "";
$_SESSION['orderDesc'] = "";
$_SESSION['ticketsStatus'] = "";
$_SESSION['ticketsDepartment'] = "";
@mysql_query("UPDATE admin_users set lastDate=curDate,lastIp=curIp where id='$admin->id'" ) or die(mysql_error());
@mysql_query("UPDATE admin_users set curDate=NOW(),curIp='$ip' where id='$admin->id'" ) or die(mysql_error());
return 1;
}
}
return 0;
}
function adminLogOut()
{
global $_SESSION;
unset($_SESSION['adminId']);
unset($_SESSION['adminName']);
unset($_SESSION['adminHash']);
unset($_SESSION['adminFullAccess']);
unset($_SESSION['adminAccessto']);
unset($_SESSION['adminAccesstoArray']);
unset($_SESSION['adminIP']);
unset($_SESSION['adminLastDate']);
unset($_SESSION['adminLastIp']);
return 1;
}
function validateAdmin()
{
global $_SESSION,$ip;
if ($_SESSION['adminId'])
{
$r = @mysql_query("select * from admin_users where id='".$_SESSION['adminId']."' and password='".$_SESSION['adminHash']."' and fullaccess='".$_SESSION['adminFullAccess']."' and accessto='".$_SESSION['adminAccessto']."'" ) or die(mysql_error());
if (mysql_num_rows($r) == 0 || $_SESSION['adminIP'] != $ip)
{
adminLogOut( );
return 0;
}
return 1;
}
return 0;
}
function validateUser()
{
global $_SESSION,$ip;
if ($_SESSION['userId'])
{
$r = @mysql_query("select * from users where id='".$_SESSION['userId']."' and password='".$_SESSION['userHash']."'" ) or die(mysql_error());
if (mysql_num_rows($r) == 0 || $_SESSION['userIP'] != $ip)
{
userLogOut();
}
else
{
return 1;
}
}
}
function userLogOn($u,$p)
{
$usip = @mysql_query("select * from users where login='$u' and user_ip") or die(mysql_error());
if ((mysql_num_rows($usip) >0) and $u)
{
$ip=$_SERVER['REMOTE_ADDR'];
$usip = @mysql_query("select * from users where login='$u' and user_ip") or die(mysql_error());
$rr=mysql_fetch_object($usip);
if((StopIp($ip,$rr->user_ip)) and $u)
{
global $_SESSION,$ip;
$u = strtolower($u);
mconnect();
$r = @mysql_query("select * from users where login='$u'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
if (crypt($p,$r->password) == $r->password || crypt($p,$r->tempPassword) == $r->tempPassword)
{
$_SESSION['userId'] = $r->id;
$_SESSION['userLogin'] = $r->login;
$_SESSION['userEmail'] = $r->email;
$_SESSION['userEmail2'] = $r->email2;
$_SESSION['userCurrency'] = $r->currency;
$_SESSION['userHash'] = $r->password;
$_SESSION['userIP'] = $ip;
if ($r->lang && !$_SESSION['userLang'])
{
$_SESSION['userLang'] = $r->lang;
}
$_SESSION['userAttachPDFtoBill'] = $r->attachPDFtoBill;
if ($r->tempPassword)
{
@mysql_query("update users set tempPassword='' where id='$r->id'" ) or die(mysql_error());
}
addUserLog($r->id, "auth", "OK [".$ip."]");
return 1;
}
addUserLog($r->id, "auth", "BAD PASSWORD [".$ip."]");
return 0;
}
return -1;
}
else
{
head('utf-8',$_lang[CalcTitle]);
print "<center><font color=red>Пользователь разрешил вход только с определенного IP адреса.</font></center>";
print "<center><font color=red>Ваш IP адрес $ip - не внесен в список разрешенных.</font></center>";
print "<center><a href=billing.php>Назад...</a></center>";
foot('utf-8');
exit;
}
}
global $_SESSION,$ip;
$u = strtolower($u);
mconnect();
$r = @mysql_query("select * from users where login='$u'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
if (crypt($p,$r->password) == $r->password || crypt($p,$r->tempPassword) == $r->tempPassword)
{
$_SESSION['userId'] = $r->id;
$_SESSION['userLogin'] = $r->login;
$_SESSION['userEmail'] = $r->email;
$_SESSION['userEmail2'] = $r->email2;
$_SESSION['userCurrency'] = $r->currency;
$_SESSION['userHash'] = $r->password;
$_SESSION['userIP'] = $ip;
if ($r->lang && !$_SESSION['userLang'])
{
$_SESSION['userLang'] = $r->lang;
}
$_SESSION['userAttachPDFtoBill'] = $r->attachPDFtoBill;
if ($r->tempPassword)
{
@mysql_query("update users set tempPassword='' where id='$r->id'" ) or die(mysql_error());
}
addUserLog($r->id, "auth", "OK [".$ip."]");
return 1;
}
addUserLog($r->id, "auth", "BAD PASSWORD [".$ip."]");
return 0;
}
return -1;
}
function userLogOut()
{
global $_SESSION;
unset( $_SESSION['userId'] );
unset( $_SESSION['userLogin'] );
unset( $_SESSION['userEmail'] );
unset( $_SESSION['userEmail2'] );
unset( $_SESSION['userCurrency'] );
unset( $_SESSION['userHash'] );
unset( $_SESSION['userIP'] );
unset( $_SESSION['userLang'] );
unset( $_SESSION['userAttachPDFtoBill'] );
return 1;
}
function mconnect()
{
global $dbhost,$dbuser,$dbpass,$dbname;
@mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error());
@mysql_query("SET NAMES utf8");
@mysql_select_db("{$dbname}") or die(mysql_error());
}
function mencoding($encoding)
{
global $dbname;
@mysql_query("SET NAMES ".$encoding);
@mysql_select_db("{$dbname}") or die(mysql_error());
}
function mclose()
{
if (@mysql_ping()) {@mysql_close();}
}
function getfont()
{
global $font_row,$font_row1,$font_row2;
if ($font_row == $font_row1) {$font_row = $font_row2;}else{$font_row = $font_row1;}
}
function htmlEncode($txt)
{
return htmlspecialchars($txt, ENT_QUOTES, "UTF-8");
}
function htmlDecode($txt)
{
return htmlspecialchars_decode($txt, ENT_QUOTES);
}
function myDate($date)
{
$date = split("-", $date);
return $date[2].".".$date[1].".".$date[0];
}
function fromMyDate($date)
{
$date = split("\.", $date);
return $date[2]."-".$date[1]."-".$date[0];
}
function dateNow()
{
return date("d.m.Y");
}
function head($enc = "windows-1251", $CUR_PAGE_TITLE = "")
{
global $full_home_path,$languages;
$PAGE_TITLE = parseRPStrArray(GetSetting("pageTitle"),":xxx:",":xx:");
$lngUser = $_SESSION['userLang'];
$lngDefault = GetSetting("lngDefault");
if ($lngUser && $languages[$lngUser] && $PAGE_TITLE[$lngUser])
{
$PAGE_TITLE = $PAGE_TITLE[$lngUser];
}
else if ($lngDefault && $languages[$lngDefault] && $PAGE_TITLE[$lngDefault])
{
$PAGE_TITLE = $PAGE_TITLE[$lngDefault];
}
else
{
$PAGE_TITLE = "";
}
$pageTitleAddPage = GetSetting("pageTitleAddPage");
if ($PAGE_TITLE && $pageTitleAddPage && $CUR_PAGE_TITLE)
{
$pageTitleDelimiter = GetSetting("pageTitleDelimiter");
$PAGE_TITLE = $CUR_PAGE_TITLE." ".$pageTitleDelimiter." ".$PAGE_TITLE;
}
if (!$PAGE_TITLE || $CUR_PAGE_TITLE)
{
$PAGE_TITLE = $CUR_PAGE_TITLE;
}
if ($enc == "utf-8")
{
require($full_home_path."/_rootheader.utf8.php");
}
else if ($enc == "koi8-r")
{
$PAGE_TITLE = iconv("utf-8", "koi8-r", $PAGE_TITLE);
require($full_home_path."/_rootheader.koi8r.php");
}
else if ($enc == "windows-1251")
{
$PAGE_TITLE = iconv("utf-8", "windows-1251", $PAGE_TITLE);
require($full_home_path."/_rootheader.php");
}
print '<script src="./_rootmenu/hint.js" type="text/javascript"></script>';
}
function _head($enc = "windows-1251", $CUR_PAGE_TITLE = "")
{
global $full_home_path,$languages;
$PAGE_TITLE = parseRPStrArray(GetSetting("pageTitle"),":xxx:",":xx:");
$lngUser = $_SESSION['userLang'];
$lngDefault = GetSetting("lngDefault");
if ($lngUser && $languages[$lngUser] && $PAGE_TITLE[$lngUser])
{
$PAGE_TITLE = $PAGE_TITLE[$lngUser];
}
else if ($lngDefault && $languages[$lngDefault] && $PAGE_TITLE[$lngDefault])
{
$PAGE_TITLE = $PAGE_TITLE[$lngDefault];
}
else
{
$PAGE_TITLE = "";
}
$pageTitleAddPage = GetSetting("pageTitleAddPage");
if ($PAGE_TITLE && $pageTitleAddPage && $CUR_PAGE_TITLE)
{
$pageTitleDelimiter = GetSetting("pageTitleDelimiter");
$PAGE_TITLE = $CUR_PAGE_TITLE." ".$pageTitleDelimiter." ".$PAGE_TITLE;
}
if (!$PAGE_TITLE || $CUR_PAGE_TITLE)
{
$PAGE_TITLE = $CUR_PAGE_TITLE;
}
if ($enc == "utf-8")
{
print "<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>$PAGE_TITLE</title><link rel=StyleSheet href="_style.css" type="text/css"></head><body>";
}
else if ($enc == "koi8-r")
{
$PAGE_TITLE = iconv("utf-8", "koi8-r", $PAGE_TITLE);
require($full_home_path."/_rootheader.koi8r.php");
}
else if ($enc == "windows-1251")
{
$PAGE_TITLE = iconv("utf-8", "windows-1251", $PAGE_TITLE);
require($full_home_path."/_rootheader.php");
}
print '<script src="./_rootmenu/hint.js" type="text/javascript"></script>';
if ($_SESSION['userId'])
{
_menu($enc);
}
}
function foot($enc = "windows-1251")
{
global $full_home_path;
if ($enc == "utf-8")
{
require($full_home_path."/_rootfooter.utf8.php");
}
else if ($enc == "koi8-r")
{
require($full_home_path."/_rootfooter.koi8r.php");
}
else if ($enc == "windows-1251")
{
require($full_home_path."/_rootfooter.php");
}
}
function _foot($enc = "windows-1251")
{
global $full_home_path;
if ($enc == "utf-8")
{
print "<tr valign='bottom'><td colspan='2' valign='bottom' align='center' class='copyright'><div>© Copyright 2008-".date( "Y" )." Hosting-TRADE Company, All Right Reserved.</div><div>S1</div></td></tr></body></html>";
}
else if ($enc == "koi8-r")
{
require($full_home_path."/_rootfooter.koi8r.php");
}
else if ($enc == "windows-1251")
{
require($full_home_path."/_rootfooter.php");
}
}
function GotoTranslit($var)
{
$_obfuscate_Ygnwxl_4kxoOQUNMDJcяїЅ = array( "Р°", "Р±", "РІ", "Рі", "Рґ", "Рµ", "Р·", "Рё", "Рє", "Р»", "Рј", "РЅ", "Рѕ", "Рї", "СЂ", "СЃ", "С‚", "Сѓ", "С„", "С†", "С‹", "С”", "С—", "С–" );
$_obfuscate_b2j8jepNHVS9MMVr = array( "a", "b", "v", "g", "d", "e", "z", "i", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "c", "y", "e", "i", "i" );
$_obfuscate_IT5SRq8YZrOr1fiH8gяїЅяїЅ = array( "Р№", "С‘", "Р¶", "С…", "С‡", "С€", "С‰", "СЌ", "СЋ", "СЏ", "СЉ", "СЊ" );
$_obfuscate_osyz47473F1m1MwurwяїЅяїЅ = array( "y", "jo", "zh", "kh", "ch", "sh", "sch", "e", "yu", "ya", "", "" );
$_obfuscate_lJ1MLqXSEgycceQVL67U = array( "Рђ", "Р‘", "Р’", "Р“", "Р”", "Р•", "Р—", "Р�", "Рљ", "Р›", "Рњ", "Рќ", "Рћ", "Рџ", "Р ", "РЎ", "Рў", "РЈ", "Р¤", "Р¦", "Р«", "Р„", "Р‡", "Р†" );
$_obfuscate_bhh4GSpd8SSAzoMDXAяїЅяїЅ = array( "A", "B", "V", "G", "D", "E", "Z", "I", "K", "L", "M", "N", "O", "P", "R", "S", "T", "U", "F", "C", "Y", "E", "I", "I" );
$_obfuscate_BXManKU0 = array( "Р™", "РЃ", "Р–", "РҐ", "Р§", "РЁ", "Р©", "Р", "Р®", "РЇ", "РЄ", "Р¬" );
$_obfuscate_WSJ6EyjHxtqyefFfW0яїЅ = array( "Y", "Jo", "Zh", "Kh", "Ch", "Sh", "Sch", "E", "Yu", "Ya", "", "" );
$_obfuscate_WgkqzwTzwяїЅяїЅ = "АБВГДЕЁЖЗР�ЙКЛМНОПРСТУФХЦЧШЩЬЪЫРЮЯ";
$_obfuscate_GeY8YRVE8V4яїЅ = "абвгдеёжзийклмнопрстуфхцчшщьъыэюя";
$var = str_replace( ".php", "", $var );
$var = trim( strip_tags( $var ) );
$var = preg_replace( "/\s+/msu", "_", $var );
$var = str_replace( $_obfuscate_BXManKU0, $_obfuscate_WSJ6EyjHxtqyefFfW0яїЅ, $var );
$var = str_replace( $_obfuscate_lJ1MLqXSEgycceQVL67U, $_obfuscate_bhh4GSpd8SSAzoMDXAяїЅяїЅ, $var );
$var = str_replace( $_obfuscate_Ygnwxl_4kxoOQUNMDJcяїЅ, $_obfuscate_b2j8jepNHVS9MMVr, $var );
$var = str_replace( $_obfuscate_IT5SRq8YZrOr1fiH8gяїЅяїЅ, $_obfuscate_osyz47473F1m1MwurwяїЅяїЅ, $var );
$var = preg_replace( "/[^a-z0-9\_\-.]+/miu", "", $var );
$var = preg_replace( "#[\-]+#iu", "_", $var );
$var = str_replace( "_", " ", $var );
return $var;
}
function semantic($i,&$words,&$fem,$f,$lng )
{
global $_1_2,$_1_19,$des,$hang,$namecur,$nametho,$namemil,$namemrd;
$words = "";
$fl = 0;
if (100 <= $i)
{
$jkl = intval($i/100);
$words .= $hang[$jkl][$lng];
$i %= 100;
}
if (20 <= $i)
{
$jkl = intval($i/10);
$words .= $des[$jkl][$lng];
$i %= 10;
$fl = 1;
}
switch ($i)
{
case 1 :
$fem = 1;
break;
case 2 :
case 3 :
case 4 :
$fem = 2;
break;
$fem = 3;
}
if ($i < 3 && 0 < $f)
{
if (2 <= $f)
{
$words .= $_1_19[$i][$lng];
}
else
{
$words .= $_1_2[$i][$lng];
}
}
else
{
$words .= $_1_19[$i][$lng];
}
}
function num2str( $L, $currency, $lng )
{
global $_1_2,$_1_19,$des,$hang,$namecur,$nametho,$namemil,$namemrd,$kopeek;
$p = " ";
$s1 = " ";
$s2 = " ";
$kop = intval($L * 100 - intval($L) * 100);
$L = intval($L);
if (1000000000 <= $L)
{
$many = 0;
semantic(intval($L / 1000000000), &$s1, &$many, 3, $lng);
$p .= $s1.$namemrd[$many][$lng];
$L %= 1000000000;
}
if (1000000 <= $L)
{
$many = 0;
semantic(intval($L / 1000000), &$s1, &$many, 2, $lng);
$p .= $s1.$namemil[$many][$lng];
$L %= 1000000;
if ($L == 0)
{
$p .= $namecur[$currency][3][$lng]." ";
}
}
if (1000 <= $L)
{
$many = 0;
semantic(intval($L / 1000), &$s1, &$many, 1, $lng);
$p .= $s1.$nametho[$many][$lng];
$L %= 1000;
if ($L == 0)
{
$p .= $namecur[$currency][3][$lng]." ";
}
}
if ($L != 0)
{
$many = 0;
semantic($L, &$s1, &$many, 0, $lng);
$p .= $s1.$namecur[$currency][$many][$lng];
}
if (0 < $kop)
{
$many = 0;
semantic($kop, &$s1, &$many, 1, $lng);
$p .= $s1.$kopeek[$many][$lng];
return $p;
}
$p .= " 00 ".$kopeek[3][$lng];
return $p;
}
function GetTpl($tpl, $langs = "russian", $_obfuscate_Nq2eh_yHnAяїЅяїЅ = "0")
{
global $languages;
$r = @mysql_query("select * from templates where param='$tpl' and byDefault='1'") or die(mysql_error());
if (!$_obfuscate_Nq2eh_yHnAяїЅяїЅ || 0 < mysql_num_rows($r))
{
$r = mysql_fetch_object($r);
$langs = $r->language;
}
if (!$languages[$langs])
{
$langs = "russian";
}
if ($languages[$langs])
{
$r = @mysql_query("select * from templates where param='$tpl' and language='$langs'") or die(mysql_error());
$r = @mysql_fetch_object($r);
if ($_obfuscate_Nq2eh_yHnAяїЅяїЅ || $r->template)
{
$result[subject] = $r->subject;
$result[template] = htmlDecode($r->template);
return $result;
}
$r = @mysql_query("select * from templates where param='$tpl' and language='russian'") or die(mysql_error());
$r = @mysql_fetch_object($r);
$result[subject] = $r->subject;
$result[template] = htmlDecode($r->template);
}
return $result;
}
function GetSetting($set)
{
$r = @mysql_query("select * from settings where param='$set'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
return htmlDecode($r->value);
}
}
function SetSetting($param,$value)
{
@mysql_query("update settings set value='$value' where param='$param'") or die(mysql_error());
}
function GetAddons()
{
$z = @mysql_query("select * from addons") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return $z;}
}
function GetAddonById($id)
{
$z = @mysql_query("select * from addons where id='$id'" ) or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetAddonsIdsByTxt($txt)
{
$orderAddons = split(":x:",$txt);
if (GetArrayNotNullCount($orderAddons) > 0)
{
$resultArray = null;
while (list($k,$v) = each(&$orderAddons))
{
if ($v)
{
$resultArray[] = $v;
}
}
}
if (is_array($resultArray))
{
return $resultArray;
}
return false;
}
function GetAddonsIdsForOrderId($id)
{
$order = GetOrderById($id);
return GetAddonsIdsByTxt($order->addons);
}
function GetAccessibleAddonsIdsForTarifId($id)
{
$tarif = GetTarifById($id);
return GetAddonsIdsByTxt($tarif->addons);
}
function GetAccessibleAddonsIdsForOrderId($id)
{
$order = GetOrderById($id);
if ($order->id)
{
$currentOrderAddons = GetAddonsIdsForOrderId($order->id);
if (!$currentOrderAddons)
{
$currentOrderAddons = array();
}
$addonsForTarif = GetAccessibleAddonsIdsForTarifId($order->tarif);
$resultArray = null;
while (list($k,$v) = @each(&$addonsForTarif))
{
$oneAddon = GetAddonById($v);
if ($oneAddon->id)
{
if ($oneAddon->unlimforoneorder)
{
$resultArray[] = $v;
}
else if (!in_array($v,$currentOrderAddons))
{
$resultArray[] = $v;
}
}
}
if (is_array($resultArray))
{
return $resultArray;
}
}
}
function GetArrayNotNullCount($arr)
{
$cnt = 0;
while (list($k,$v) = each(&$arr))
{
if ($v)
{
$cnt++;
}
}
reset(&$arr);
return $cnt;
}
function GetCurrencys($_obfuscate_wNHhWW03uSIяїЅ = "0")
{
if ($_obfuscate_wNHhWW03uSIяїЅ)
{
$_obfuscate_IRFhnYwяїЅ = "";
}
else
{
$_obfuscate_IRFhnYwяїЅ = "where NOT(koeficient=0)";
}
$z = @mysql_query("select * from currency ".$_obfuscate_IRFhnYwяїЅ) or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return $z;
}
}
function GetCurrencyByCode($code)
{
$code = strtoupper($code);
$z = @mysql_query("select * from currency where code='$code' or id='".@intval($code)."'" ) or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
return false;
}
function GetCurrencyKoeficientByCode($code)
{
$code = strtoupper($code);
$z = @mysql_query("select koeficient from currency where code='$code' or id='".@intval($code)."'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z->koeficient;
}
return false;
}
function GetCurrentAdminCurrency()
{
$r = @mysql_query("select * from currency where koeficient='1'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
define("CURAS",$r->symbol);
return true;
}
return false;
}
function GetCurrentCurrency()
{
global $_SESSION,$valuta;
if ($valuta && GetSetting("usersChangeCurrency"))
{
$currency = GetCurrencyByCode(strtoupper($valuta));
if ($currency->symbol && $currency->koeficient && !$_SESSION['userId'])
{
$_SESSION['userCurrency'] = strtoupper($valuta);
}
}
if (!$currency || $_SESSION['userCurrency'] && GetSetting("usersChangeCurrency"))
{
$currency = GetCurrencyByCode($_SESSION['userCurrency']);
}
if ($currency->symbol) {}
if (!$currency->koeficient)
{
$currency = GetSetting("currency");
$currency = GetCurrencyByCode($currency);
}
if ($currency->symbol && $currency->koeficient)
{
define("CURРЎ",$currency->code);
define("CURS",$currency->symbol);
define("CURK",$currency->koeficient);
return true;
}
return false;
}
function LoadCurrencyToVariable($_obfuscate_ldg4MIpoU2obJz0O)
{
if ($_obfuscate_ldg4MIpoU2obJz0O && GetSetting("usersChangeCurrency"))
{
$currency = GetCurrencyByCode($_obfuscate_ldg4MIpoU2obJz0O);
}
if ($currency->symbol) {}
if (!$currency->koeficient)
{
$currency = GetSetting("currency");
$currency = GetCurrencyByCode($currency);
}
if ($currency->symbol && $currency->koeficient)
{
$res['CURРЎ'] = $currency->code;
$res['CURS'] = $currency->symbol;
$res['CURK'] = $currency->koeficient;
return $res;
}
return false;
}
function GetTarifById($id)
{
$z = @mysql_query("select * from tarifs where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetBillById($id)
{
$z = @mysql_query("select * from bills where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetBillPayedCountByUserId($id)
{
$z = @mysql_query("select COUNT(*) as cnt from bills where status='1' and uid='$id'") or die(mysql_error());
$z = mysql_fetch_object($z);
return $z->cnt;
}
function GetZoneByZone($zone)
{
$z = mysql_query("select * from zones where zone='$zone'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetActiveZoneByZone($zone)
{
$z = mysql_query("select * from zones where zone='$zone' and active='1'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetZoneById($id)
{
$z = mysql_query("select * from zones where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetZoneByDomain($domain)
{
$z = @mysql_query("select t1.* from zones as t1, orders_domains as t2 where t1.id=t2.zone_id and t2.domain='$domain'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetZoneByDomainOrderId($id)
{
$z = @mysql_query("select t1.* from zones as t1, orders_domains as t2 where t1.id=t2.zone_id and t2.id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetDomainByDomain($domain)
{
$z = mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders_domains where domain='$domain'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetDomainById($id)
{
$z = mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders_domains where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetZonesNamesActive()
{
$z = @mysql_query("select zone from zones where active='1' order by zone") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
while ($zz = mysql_fetch_object($z))
{
$result[] = $zz->zone;
}
return $result;
}
}
function GetZonesNamesForWhois()
{
$z = @mysql_query("select zone from zones where active='1' and useinwhois='1' group by zone order by zone") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
while ($zz = mysql_fetch_object($z))
{
$result[] = $zz->zone;
}
return $result;
}
}
function GetZonesNamesForWhoisFavorite()
{
$z = @mysql_query("select zone from zones where active='1' and isFavorite='1' group by zone order by zone") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
while ($zz = mysql_fetch_object($z))
{
$result[] = $zz->zone;
}
return $result;
}
}
function GetZonesActive()
{
$z = @mysql_query("select * from zones where active='1' group by zone order by zone") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return $z;
}
}
function GetZonesForWhois()
{
$z = @mysql_query("select * from zones where active='1' and useinwhois='1' group by zone order by zone") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return $z;
}
}
function GetZonesAll()
{
$z = @mysql_query("select * from zones order by zone") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return $z;
}
}
function IsZoneInUse($id)
{
$z = @mysql_query("select * from orders_domains where zone_id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return true;
}
return false;
}
function IsZoneActive($zone)
{
$z = @mysql_query("select * from zones where zone='$zone' and active='1'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return true;
}
return false;
}
function GetZoneByNonExistsDomain($domain)
{
$dom = mb_split("\.", $domain);
$zone = preg_replace("/".$dom['0']."\./ui", "", $domain);
$z = mysql_query("select * from zones where zone='$zone'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function IsTarifInUse($id)
{
$z = @mysql_query("select * from orders where tarif='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return true;
}
return false;
}
function GetTarifsGroups()
{
$z = @mysql_query("select * from tarifs_groups order by name") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return $z;
}
}
function GetTarifsGroupById($id)
{
$z = @mysql_query("select * from tarifs_groups where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return mysql_fetch_object($z);
}
}
function GetAboutUsFromAll()
{
$z = @mysql_query("select * from aboutusfrom order by sort") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return $z;
}
}
function GetAboutUsFromById($id)
{
$z = @mysql_query("select * from aboutusfrom where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return mysql_fetch_object($z);
}
}
function GetPayMethods()
{
$r = @mysql_query("select * from pay_methods order by id") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
function GetNews($num = 0)
{
mconnect();
if ($num)
{
$r = @mysql_query("select * from news order by data desc, id desc limit 0,".$num) or die(mysql_error());
}
else
{
$r = @mysql_query("select * from news order by data desc, id desc") or die(mysql_error());
}
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
function GetNewsById($id)
{
$r = @mysql_query("select * from news where id='$id'") or die(mysql_error());
if ($id && mysql_num_rows($r) > 0)
{
return mysql_fetch_object($r);
}
}
function GetServers($id = "")
{
if ($id)
{
$r = @mysql_query("select * from servers where id='$id'") or die(mysql_error());
return mysql_fetch_object($r);
}
$r = @mysql_query("select * from servers order by parentid,id") or die(mysql_error());
if ((mysql_num_rows($r) > 0) && (mysql_num_rows($r) > 0))
{
return $r;
}
}
function GetServerUserCount($id)
{
if ($id)
{
$r = @mysql_query( "select COUNT(*) as cnt from orders where serverid='$id'") or die(mysql_error());
$r = @mysql_fetch_object($r);
return $r->cnt;
}
}
function IsLoginExists($login)
{
$z = @mysql_query("select * from users where login='$login'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
return true;
}
}
function GetUserById($id)
{
$z = @mysql_query("select * from users where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetUserProfileByUserId($id,$profileid = "")
{
if ($profileid)
{
$_obfuscate_3y0Y = "uid='".$id."' and id='".$profileid."'";
}
else
{
$_obfuscate_3y0Y = "uid='".$id."' order by id LIMIT 0,1";
}
$z = @mysql_query("select * from users_profile where ".$_obfuscate_3y0Y) or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetUserByLogin($login)
{
$z = @mysql_query("select * from users where login='$login'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetUsersLogins()
{
$z = @mysql_query("select login from users order by login") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
while ($zz = mysql_fetch_object($z))
{
$result[] = $zz->login;
}
return $result;
}
}
function GetUsersAll()
{
$r = @mysql_query("select * from users order by login") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
function GetOrderById($id,$uid = "")
{
if ($uid)
{
$_obfuscate_15kGZlfkx8UяїЅ = "and uid='".$uid."'";
}
else
{
$_obfuscate_15kGZlfkx8UяїЅ = "";
}
$z = @mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders where id='$id' {$_obfuscate_15kGZlfkx8UяїЅ}") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetUserPartnerMoney($id)
{
$z = @mysql_query("select partnerMoney from users where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return round($z->partnerMoney, 2);
}
}
function GetUserReferalsCount($id)
{
$z = @mysql_query("select * from users where referal='$id'") or die(mysql_error());
return mysql_num_rows($z);
}
function GetUserReferalsArray($id)
{
$r = @mysql_query("select id,login,email from users where referal='$id' order by login") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
while ($rr = mysql_fetch_object($r))
{
$result[$rr->id][login] = $rr->login;
$result[$rr->id][email] = $rr->email;
}
return $result;
}
return false;
}
function GetUserMoney($id)
{
$r = @mysql_query("select money from users where id='$id'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
return round($r->money, 2);
}
return false;
}
function GetTicketById($id)
{
$z = @mysql_query("select * from tickets where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function IsUserActiveReseller($uid)
{
$r = @mysql_query("select t1.id from orders as t1, tarifs as t2 where t1.uid='$uid' and t1.todate>NOW() and t1.tarif=t2.id and t2.vid='reseller'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return true;
}
return false;
}
function IsUserHaveActiveOrders($uid)
{
$r = @mysql_query("select id from orders where uid='$uid' and todate>NOW()") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return true;
}
return false;
}
function IsUserDomainReseller($uid)
{
$r = @mysql_query("select * from users where id='$uid'") or die(mysql_error());
$r = mysql_fetch_object($r);
if ($r->domainreseller)
{
return true;
}
return false;
}
function GetAccessibleChangeTarifsForHostingOrder($orderId)
{
$order = GetOrderById($orderId);
if ($order->id && $order->status)
{
$tarif = GetTarifById($order->tarif);
if ($tarif->id)
{
$_obfuscate_4qMUJ8GPalUяїЅ = GetSetting("changetarif_up");
$_obfuscate_Ncfycl9ZBavtfQяїЅяїЅ = GetSetting("changetarif_down");
$_obfuscate_F4jKfe66Az827nQяїЅ = GetSetting("userBalanceEnable");
if ($_obfuscate_4qMUJ8GPalUяїЅ || $_obfuscate_Ncfycl9ZBavtfQяїЅяїЅ && $_obfuscate_F4jKfe66Az827nQяїЅ)
{
if ($_obfuscate_4qMUJ8GPalUяїЅ)
{
$_obfuscate_EKP_rQяїЅяїЅ = "cost > ".$tarif->cost;
}
if ($_obfuscate_Ncfycl9ZBavtfQяїЅяїЅ && $_obfuscate_F4jKfe66Az827nQяїЅ)
{
$_obfuscate_zkNKvwяїЅяїЅ = "cost < ".$tarif->cost;
}
if ($_obfuscate_4qMUJ8GPalUяїЅ && $_obfuscate_Ncfycl9ZBavtfQяїЅяїЅ && $_obfuscate_F4jKfe66Az827nQяїЅ)
{
$_obfuscate_rsTHvjAяїЅ = "OR";
}
$r = @mysql_query("select * from tarifs where active=1 and nochange=0 and vid='$tarif->vid' and NOT(id='{$order->tarif}') and ({$_obfuscate_EKP_rQяїЅяїЅ} {$_obfuscate_rsTHvjAяїЅ} {$_obfuscate_zkNKvwяїЅяїЅ}) order by cost") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
}
}
return false;
}
function IsAccessibleChangeTarifForHostingOrder($orderId,$newTarifId)
{
$tarifs = GetAccessibleChangeTarifsForHostingOrder($orderId);
$newTarif = GetTarifById($newTarifId);
while ($tarif = @mysql_fetch_object($tarifs))
{
if ($tarif->id = $newTarifId) {return true;}
}
}
function IsIPInIPs($ip,$_obfuscate_KduFvP4Baa6cIQяїЅяїЅ)
{
if ($_obfuscate_KduFvP4Baa6cIQяїЅяїЅ)
{
$_obfuscate_5VVDqdCoKKDlePLhQяїЅяїЅ = split("rn", $_obfuscate_KduFvP4Baa6cIQяїЅяїЅ);
$result = false;
while (list($key,$value) = each(&$_obfuscate_5VVDqdCoKKDlePLhQяїЅяїЅ))
{
if (preg_match("/\-/ui", $value))
{
$ips = split("\-", $value);
if (ip2long($ips[0]) <= ip2long($ip) and ip2long($ip) <= ip2long($ips[1])) {$result = true;break;}
}
if (ip2long($ip) == ip2long($value)) {$result = true;break;}
}
return $result;
}
return true;
}
function IsNewTicketsForAdmin()
{
$r = @mysql_query("select id from tickets where parentid=0 and newforadmin='1' LIMIT 0,1") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return true;
}
}
function IsNewTicketsForUser($uid)
{
$r = @mysql_query("select * from tickets where parentid=0 and newforuser='1' and userid='$uid' LIMIT 0,1") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return true;
}
return false;
}
function GetAdminEmailsWhereTrueParam($param,$department = "")
{
$r = @mysql_query("select email,groups from admin_users where ".$param."='1'") or die(mysql_error());
$res = array();
if (mysql_num_rows($r) > 0)
{
while ($rr = mysql_fetch_object($r))
{
if ($rr->groups)
{
$_obfuscate_seAяїЅ = @split( "::", $rr->groups );
}
else
{
$_obfuscate_seAяїЅ = array( );
}
if (!(count($_obfuscate_seAяїЅ) == 0) || $department && (!$department && !@in_array("{$department}", $_obfuscate_seAяїЅ)))
{
$res[] = $rr->email;
}
}
}
return $res;
}
function GetAboutUsFromDiscount($id,$type)
{
$r = @mysql_query("select discount".$type.(" as discount from aboutusfrom where id='$id'")) or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
return $r->discount;
}
return 0;
}
function GetSpecialCost($uid,$type,$id)
{
if ($type == "tarif") {$row = "tarif_id";}
else if ($type == "zone") {$row = "zone_id";}
else if ($type == "addon") {$row = "addon_id";}
else if ($type == "shop") {$row = "item_id";}
$r = @mysql_query("select cost1,cost2 from specialcosts where uid='$uid' and {$row}='{$id}'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
$result['cost1'] = $r->cost1;
$result['cost2'] = $r->cost2;
return $result;
}
return false;
}
function GetDomainsCntByRegistratorId($id)
{
if ($id)
{
$r = @mysql_query("select COUNT(*) as cnt from orders_domains where autoregby='$id'") or die(mysql_error());
$r = @mysql_fetch_object($r);
return $r->cnt;
}
return 0;
}
function GetRegistratorNameById($id)
{
$r = @mysql_query("select name from registrators where id='$id'") or die(mysql_error());
if ($id && mysql_num_rows($r) > 0)
{
$r = @mysql_fetch_object($r);
return $r->name;
}
return "";
}
function GetRegistrators()
{
$r = @mysql_query("select * from registrators") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
function GetRegistratorTypeById($id)
{
$r = @mysql_query("select type from registrators where id='$id'") or die(mysql_error());
if ($id && mysql_num_rows($r) > 0)
{
$r = @mysql_fetch_object($r);
return $r->type;
}
return "";
}
function GetRegistratorById( $id )
{
$r = @mysql_query("select * from registrators where id='$id'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return mysql_fetch_object($r);
}
}
function GetDomainCostForUserByZoneId($uid = 0, $_obfuscate_HkNt, $_obfuscate_SW3ZDkHh0C4яїЅ = 0)
{
$_obfuscate_8LuEvIqX = GetZoneById($_obfuscate_HkNt);
if ($_obfuscate_8LuEvIqX->id)
{
if (IsUserDomainReseller($uid))
{
if ($_obfuscate_8LuEvIqX->action > 0)
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->action;
}
else
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->cost_if_domainreseller;
}
}
else if (IsUserActiveReseller($uid))
{
if ($_obfuscate_8LuEvIqX->action > 0)
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->action;
}
else
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->cost_if_reseller;
}
}
else
{
$_obfuscate_Pqut9pswKOL23UvYRUяїЅ = GetSetting("domainCostType");
if ((!$_obfuscate_Pqut9pswKOL23UvYRUяїЅ && IsUserHaveActiveOrders($uid) || $_obfuscate_SW3ZDkHh0C4яїЅ || !$_obfuscate_Pqut9pswKOL23UvYRUяїЅ) || $_obfuscate_SW3ZDkHh0C4яїЅ)
{
if ($_obfuscate_8LuEvIqX->action > 0)
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->action;
}
else
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->cost_if_host;
}
}
else
{
if ($_obfuscate_8LuEvIqX->action > 0)
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->action;
}
else
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_8LuEvIqX->cost_if_not_host;
}
}
}
$_obfuscate_BTkJylgUz_tD = GetSpecialCost($uid, "zone", $_obfuscate_HkNt);
if ($_obfuscate_BTkJylgUz_tD)
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = $_obfuscate_BTkJylgUz_tD['cost1'];
return $_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ;
}
}
else
{
$_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ = 0;
}
return $_obfuscate_Zi5mgUMKBNYagAяїЅяїЅ;
}
function GetKvitancii($_obfuscate_pgkq7ZLY = 0)
{
if ($_obfuscate_pgkq7ZLY)
{
$addon = "where active=1";
}
$r = @mysql_query("select * from kvitancii ".$addon) or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
function GetKvitanciiById($id)
{
$r = @mysql_query("select * from kvitancii where id='$id'") or die(mysql_error());
if ($id && mysql_num_rows($r) > 0)
{
return mysql_fetch_object($r);
}
}
function GetFakturas($_obfuscate_pgkq7ZLY = 0)
{
if ($_obfuscate_pgkq7ZLY)
{
$addon = "where active=1";
}
$r = @mysql_query("select * from kvitancii_faktura ".$addon) or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
return $r;
}
}
function GetFakturasById($id)
{
$r = @mysql_query("select * from kvitancii_faktura where id='$id'") or die(mysql_error());
if ($id && mysql_num_rows($r) > 0)
{
return mysql_fetch_object($r);
}
}
function GetMoneyBackByOrderId($id)
{
if ($id)
{
$order = GetOrderById($id);
if ($order->id && $order->leftdays > 0)
{
$bill = @mysql_query("select id,uid,host_srok,money_host from bills where status=1 and newtarif='0' and NOT(host_srok='0') and newaddons='' and host_id='$order->id' order by id desc LIMIT 0,1") or die(mysql_error());
if (mysql_num_rows($bill) > 0)
{
$bill = mysql_fetch_object($bill);
if ($bill->money_host != "0")
{
$_obfuscate_HTJ1ivWMXDn = round($order->leftdays*($bill->money_host/($bill->host_srok*30)),2);
return $_obfuscate_HTJ1ivWMXDn;
}
$_obfuscate_HTJ1ivWMXDn = "-";
return $_obfuscate_HTJ1ivWMXDn;
}
$_obfuscate_zR61fMHWKQr6HKGJnwяїЅяїЅ = GetSpecialCost($order->uid,"tarif",$order->tarif);
if ($_obfuscate_zR61fMHWKQr6HKGJnwяїЅяїЅ)
{
$_obfuscate_LXoVhAяїЅяїЅ = $_obfuscate_zR61fMHWKQr6HKGJnwяїЅяїЅ['cost2'];
}
else
{
$tarif = GetTarifById($order->tarif);
$_obfuscate_LXoVhAяїЅяїЅ = $tarif->cost;
}
if ($_obfuscate_LXoVhAяїЅяїЅ != 0)
{
$_obfuscate_HTJ1ivWMXDn = round($order->leftdays*($_obfuscate_LXoVhAяїЅяїЅ/30),2);
return $_obfuscate_HTJ1ivWMXDn;
}
$_obfuscate_HTJ1ivWMXDn = "-";
return $_obfuscate_HTJ1ivWMXDn;
}
return "-";
}
}
function _obfuscate_HB8NJ3AaDARkLRN4($_obfuscate_N6wcV_rUTifTgяїЅяїЅ,$_obfuscate_aj7p,$_obfuscate_0bLKOSuSL4IlJbKj,$dir)
{
$conn_id = ftp_connect($_obfuscate_N6wcV_rUTifTgяїЅяїЅ);
$login_result = ftp_login($conn_id,$_obfuscate_aj7p,$_obfuscate_0bLKOSuSL4IlJbKj);
if (!$conn_id && !$login_result)
{
return false;
}
ftp_pasv($conn_id, true);
_obfuscate_BwQKATkEK3ZiEXxvdWIhehUV($conn_id,$dir);
ftp_close($conn_id);
}
function _obfuscate_BwQKATkEK3ZiEXxvdWIhehUV($handle,$directory)
{
if (@!ftp_rmdir($handle,$directory) || !@ftp_delete($handle,$directory))
{
$_obfuscate_bLgYFIkC5l8яїЅ = @ftp_nlist($handle,$directory);
foreach ($_obfuscate_bLgYFIkC5l8яїЅ as $file)
{
_obfuscate_BwQKATkEK3ZiEXxvdWIhehUV($handle,$file);
}
_obfuscate_BwQKATkEK3ZiEXxvdWIhehUV($handle,$directory);
}
}
function ftpUploadDir($conn_id,$dir,$_obfuscate_f_6jaVbZ57QяїЅ)
{
if (!preg_match("/\/$/ui",$dir) || !preg_match("/\$/ui",$dir))
{
$dir .= "/";
}
if (!preg_match("/\/$/ui",$_obfuscate_f_6jaVbZ57QяїЅ))
{
$_obfuscate_f_6jaVbZ57QяїЅ .= "/";
}
if (@is_dir($dir))
{
$_obfuscate_FGcяїЅ = @opendir($dir);
while (($file = @readdir($_obfuscate_FGcяїЅ)) !== false)
{
if (!($file != ".") && !($file != ".."))
{
if (@is_file($dir."/".$file))
{
ftp_put($conn_id,$_obfuscate_f_6jaVbZ57QяїЅ.$file,$dir.$file, FTP_BINARY);
}
else if (@is_dir($dir."/".$file))
{
@ftp_mkdir($conn_id,$_obfuscate_f_6jaVbZ57QяїЅ.$file);
ftpUploadDir($conn_id,$dir.$file."/",$_obfuscate_f_6jaVbZ57QяїЅ.$file."/");
}
}
}
@closedir($_obfuscate_FGcяїЅ);
}
}
function _obfuscate_HmxwIRV3($_obfuscate_8SedAwBPAяїЅяїЅ)
{
if (!file_exists($_obfuscate_8SedAwBPAяїЅяїЅ))
{
return false;
}
if (is_file($_obfuscate_8SedAwBPAяїЅяїЅ) || is_link($_obfuscate_8SedAwBPAяїЅяїЅ))
{
return unlink($_obfuscate_8SedAwBPAяїЅяїЅ);
}
$dir = dir($_obfuscate_8SedAwBPAяїЅяїЅ);
while (false !== ($_obfuscate_dS3LtQYяїЅ = $dir->read()))
{
if ($_obfuscate_dS3LtQYяїЅ == "." || $_obfuscate_dS3LtQYяїЅ == "..")
{
_obfuscate_HmxwIRV3($_obfuscate_8SedAwBPAяїЅяїЅ.DIRECTORY_SEPARATOR.$_obfuscate_dS3LtQYяїЅ);
}
}
$dir->close();
return rmdir($_obfuscate_8SedAwBPAяїЅяїЅ);
}
function checkAdminAccess($in,$printerror = 0)
{
global $_SESSION,$version,$full_home_path;
if ($_SESSION['adminFullAccess']) {return true;}
if (@in_array($in, $_SESSION['adminAccesstoArray'])) {return true;}
if ($printerror)
{
print "<center><font color=red>Access denied!</font></center>";
include($full_home_path."/_rootinc/adminfoot.inc.php");
mclose();
exit();
}
return false;
}
function writeAdminLog($val,$aid = "")
{
global $_SESSION;
if (!$aid) {$aid = $_SESSION['adminId'];}
@mysql_query("INSERT INTO admin_logs (aid,dt,val) VALUES('$aid',NOW(),'$val')") or die(mysql_error());
}
function GetAdminByLogin($login)
{
$r = @mysql_query("select * from admin_users where login='$login'") or die(mysql_error());
if ($login && mysql_num_rows($r) > 0) {return mysql_fetch_object($r);}
}
function GetAdminById($id)
{
$r = @mysql_query("select * from admin_users where id='$id'") or die(mysql_error());
if ( $id && mysql_num_rows($r) > 0) {return mysql_fetch_object($r);}
}
function WriteMailLog($subject,$message,$uid = "")
{
if (!$uid && GetSetting("mailLogUserEnable") || !$uid || GetSetting("mailLogAdminEnable"))
{
if ($subject && $message)
{
$uid = $_SESSION["userId"];
$subject = htmlEncode($subject);
$message = htmlEncode($message);
@mysql_query("insert into mail_logs (uid,dt,subject,message) values('$uid',NOW(),'$subject','$message')") or die(mysql_error());
return true;
}
return false;
}
return false;
}
function hmac($key,$data)
{
$b = 64;
if ($b < strlen($key))
{
$key = pack("H*", md5($key));
}
$key = str_pad($key, $b, chr(0));
$ipad = str_pad("", $b, chr(54));
$opad = str_pad("", $b, chr(92));
$_obfuscate_x0qhkx7s = $key ^ $ipad;
$z = $key ^ $opad;
return md5($z.pack("H*", md5($_obfuscate_x0qhkx7s.$data)));
}
function GetCoupon($type,$code)
{
$r = @mysql_query("select * from coupons where type='$type' and code='$code'") or die(mysql_error());
if ($type && $code && mysql_num_rows($r) > 0)
{
return mysql_fetch_object($r);
}
}
function GetCouponActiveCount($type)
{
$r = @mysql_query("select * from coupons where type='$type' and active='1'") or die(mysql_error());
return mysql_num_rows($r);
}
function IsCanUseCoupon($id,$uid)
{
if ($id)
{
$r = @mysql_query("select *,TO_DAYS(toDate)-TO_DAYS(NOW()) as leftdays from coupons where id='$id' and active='1'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
if ($r->leftdays == "" || $r->leftdays != "" && 0 <= $r->leftdays)
{
if ($r->usedBy)
{
$_obfuscate_dWyjQIPj = split("\,", $r->usedBy);
$_obfuscate_qwZ4bCzinRBzQwяїЅяїЅ = array();
$_obfuscate_uiDvD2UjHgLEegяїЅяїЅ = array();
$_obfuscate_7KKqLt98RdEh6lcSEAяїЅяїЅ = array();
while (list($index,$value) = each(&$_obfuscate_dWyjQIPj))
{
if (preg_match("/\:/ui",$value))
{
$_obfuscate__R2_ = split("\:",$value);
$_obfuscate__zeVetJj = $_obfuscate__R2_[0];
$_obfuscate_kww6iExd = $_obfuscate__R2_[1];
$_obfuscate_qwZ4bCzinRBzQwяїЅяїЅ[] = $_obfuscate__zeVetJj;
$_obfuscate_7KKqLt98RdEh6lcSEAяїЅяїЅ[$_obfuscate__zeVetJj] = $_obfuscate_7KKqLt98RdEh6lcSEAяїЅяїЅ[$_obfuscate__zeVetJj] + 1;
$_obfuscate_uiDvD2UjHgLEegяїЅяїЅ[$_obfuscate__zeVetJj][] = $_obfuscate_kww6iExd;
}
else
{
$_obfuscate_qwZ4bCzinRBzQwяїЅяїЅ[] = $value;
$_obfuscate_7KKqLt98RdEh6lcSEAяїЅяїЅ[$value] = $_obfuscate_7KKqLt98RdEh6lcSEAяїЅяїЅ[$value] + 1;
}
}
if ($r->canUsed == "1") {return false;}
if ($r->canUsed == "2")
{
if ($uid)
{
if (in_array($uid,$_obfuscate_qwZ4bCzinRBzQwяїЅяїЅ)) {return true;}
return false;
}
return false;
}
if ($r->canUsed == "3")
{
if ($uid)
{
if ($_obfuscate_7KKqLt98RdEh6lcSEAяїЅяїЅ[$uid] > 0) {return false;}
return true;
}
return true;
}
if ($r->canUsed == "4") {return true;}
}
else {return true;}
}
else {return false;}
}
else {return false;}
}
else {return false;}
}
function AddUsedByToCoupon($_obfuscate_BDMCBGcnuEяїЅ,$uid,$billid = "")
{
if ($billid) {$value = "{$uid}:{$billid}";}
else {$value = "{$uid}";}
$r = @mysql_query("select usedBy from coupons where id='$_obfuscate_BDMCBGcnuEяїЅ'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
if ($r->usedBy)
{
$_obfuscate_dWyjQIPj = split("\,",$r->usedBy);
$_obfuscate_dWyjQIPj[] = $value;
$_obfuscate_E7itIpIяїЅ = @join(",",$_obfuscate_dWyjQIPj);
}
else {$_obfuscate_E7itIpIяїЅ = $value;}
@mysql_query("update coupons set usedBy='$_obfuscate_E7itIpIяїЅ' where id='$_obfuscate_BDMCBGcnuEяїЅ'") or die(mysql_error());
}
}
function xml2array($text)
{
$_obfuscate_yvTuN8WgLAяїЅяїЅ = "/<(\S+)[^>]*>(.*?)<\/\1>/su";
preg_match_all($_obfuscate_yvTuN8WgLAяїЅяїЅ,$text,$_obfuscate_jq3moiIяїЅ);
foreach ($_obfuscate_jq3moiIяїЅ[1] as $key => $val)
{
if (preg_match($_obfuscate_yvTuN8WgLAяїЅяїЅ,$_obfuscate_jq3moiIяїЅ[2][$key])) {$array[$val][] = xml2array($_obfuscate_jq3moiIяїЅ[2][$key]);}
else {$array[$val] = html_entity_decode($_obfuscate_jq3moiIяїЅ[2][$key]);}
}
return $array;
}
function GetUsersMenu($id = "")
{
if ($id)
{
$r = @mysql_query("select * from users_menu where id='$id'") or die(mysql_error());
return mysql_fetch_object($r);
}
$z = @mysql_query("select * from users_menu order by sort") or die(mysql_error());
if ((@mysql_num_rows($r) > 0) && (mysql_num_rows($z) > 0))
{
return $z;
}
}
function uploadPassportFiles($_obfuscate_FZpMnTD5Dd63ZwяїЅяїЅ,$profileid,$_obfuscate_9CyG0ll37jVLkkzTGwяїЅяїЅ)
{
global $full_home_path,$_FILES,$UploadError;
if ($_FILES[$_obfuscate_FZpMnTD5Dd63ZwяїЅяїЅ][name])
{
if ($_FILES[$_obfuscate_FZpMnTD5Dd63ZwяїЅяїЅ]['error'] == 0)
{
$_obfuscate_oZoqGNXVuSDA = getimagesize($_FILES[$_obfuscate_FZpMnTD5Dd63ZwяїЅяїЅ]['tmp_name']);
if ($_obfuscate_oZoqGNXVuSDA['mime'] == "image/jpeg")
{
$_obfuscate_yuhQH7PQFQяїЅяїЅ = "passport_".$profileid."_".$_obfuscate_9CyG0ll37jVLkkzTGwяїЅяїЅ.".jpg";
$file = $full_home_path."/_rootfiles/".$_obfuscate_yuhQH7PQFQяїЅяїЅ;
if (!file_exists($file))
{
if (move_uploaded_file($_FILES[$_obfuscate_FZpMnTD5Dd63ZwяїЅяїЅ]['tmp_name'],$file))
{
@chmod($file, 511);
return $_obfuscate_yuhQH7PQFQяїЅяїЅ;
}
$UploadError = "cant move tmp file";
return false;
}
$UploadError = "file exists";
return false;
}
$UploadError = "bad mime type";
return false;
}
$UploadError = "code: ".$_FILES[$_obfuscate_FZpMnTD5Dd63ZwяїЅяїЅ]['error'];
return false;
}
}
function IsProfileUsed($profileId)
{
$r = @mysql_query("select * from orders_domains where profileId='$profileId'") or die(mysql_error());
if (mysql_num_rows($r) > 0) {return true;}
$r = @mysql_query("select * from users where defaultProfileId='$profileId'") or die(mysql_error());
if (mysql_num_rows($r) > 0) {return true;}
return false;
}
function IsEmailUsed($email)
{
$r = @mysql_query("select * from users where (email='$email' OR email2='$email')") or die(mysql_error());
if (mysql_num_rows($r) > 0) {return true;}
return false;
}
function hexbin($temp)
{
$len = strlen($temp);
$i = 0;
for (; $i < $len; $i += 2)
{
$data .= chr(hexdec(substr($temp,$i,2)));
}
return $data;
}
function GetServersIPs($_obfuscate_LqOTwY5IF6zA,$_obfuscate_Bq2vYlFYuJYяїЅ = "")
{
if ($_obfuscate_Bq2vYlFYuJYяїЅ) {$addon = "and order_id='".$_obfuscate_Bq2vYlFYuJYяїЅ."'";}
$r = @mysql_query("select * from servers_ips where server_id='$_obfuscate_LqOTwY5IF6zA' $addon order by ip") or die(mysql_error());
if (mysql_num_rows($r) > 0 && $_obfuscate_Bq2vYlFYuJYяїЅ)
{
$r = @mysql_fetch_object($r);
return $r;
}
if (mysql_num_rows($r)) {return $r;}
}
function GetFreeServerIP($_obfuscate_LqOTwY5IF6zA)
{
$r = @mysql_query("select * from servers_ips where server_id='$_obfuscate_LqOTwY5IF6zA' and order_id='0' LIMIT 0,1") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = @mysql_fetch_object($r);
return $r;
}
}
function GetOrderIpByOrderId($_obfuscate_Bq2vYlFYuJYяїЅ)
{
$order = GetOrderById($_obfuscate_Bq2vYlFYuJYяїЅ);
if ($order->id && $order->serverid)
{
$server = GetServers($order->serverid);
$r = @mysql_query("select * from servers_ips where server_id='$server->id' and order_id='$order->id' and isMain='1'") or die(mysql_error());
if (mysql_num_rows($r) > 0)
{
$r = mysql_fetch_object($r);
return $r->ip;
}
return $server->userip;
}
}
function _obfuscate_cHJpbnR0YXJpZmNvc3QяїЅ($_obfuscate_F03g11SC83kяїЅ,$_obfuscate_uX9Gf4D0,$_obfuscate_t1mh2yDK,$enc = "windows-1251")
{
mconnect();
$tarif = GetTarifById($_obfuscate_F03g11SC83kяїЅ);
if ($tarif->id)
{
$_obfuscate_9zubLQяїЅяїЅ = @mysql_query("select * from tarifs_sroki where tarif_id='$tarif->id' and months='$_obfuscate_t1mh2yDK'") or die(mysql_error());
if (mysql_num_rows($_obfuscate_9zubLQяїЅяїЅ) > 0)
{
$_obfuscate_9zubLQяїЅяїЅ = mysql_fetch_object($_obfuscate_9zubLQяїЅяїЅ);
$currency = GetCurrencyByCode(strtoupper($_obfuscate_uX9Gf4D0));
if ($currency->code)
{
$_obfuscate_LXoVhAяїЅяїЅ = $tarif->cost*$_obfuscate_t1mh2yDK-$tarif->cost*$_obfuscate_t1mh2yDK/100*$_obfuscate_9zubLQяїЅяїЅ->discount;
$_obfuscate_LXoVhAяїЅяїЅ *= $currency->koeficient;
$_obfuscate_LXoVhAяїЅяїЅ = round($_obfuscate_LXoVhAяїЅяїЅ, 2);
if (!($enc == "utf-8"))
{
if ($enc == "koi8-r") {$currency->symbol = iconv("utf-8","koi8-r",$currency->symbol);}
else if ($enc == "windows-1251") {$currency->symbol = iconv("utf-8","windows-1251",$currency->symbol);}
}
print $_obfuscate_LXoVhAяїЅяїЅ." ".$currency->symbol;
}
else {print "no currency";}
}
else {print "no srok";}
}
else {print "no tarif";}
}
function GetShopItemGroups()
{
$z = @mysql_query("select * from shop_groups order by name") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return $z;}
}
function GetShopItemGroupById($id)
{
$z = @mysql_query("select * from shop_groups where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return mysql_fetch_object($z);}
}
function IsShopItemInUse($id)
{
$z = @mysql_query("select * from orders_shop where item='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return true;}
return false;
}
function GetShopItemById($id)
{
$z = @mysql_query("select * from shop_items where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetOrderShopById($id,$uid = "")
{
if ($uid) {$_obfuscate_15kGZlfkx8UяїЅ = "and uid='".$uid."'";}
else {$_obfuscate_15kGZlfkx8UяїЅ = "";}
$z = @mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders_shop where id='$id' $_obfuscate_15kGZlfkx8UяїЅ") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object($z);
return $z;
}
}
function GetShopItems()
{
$z = @mysql_query("select * from shop_items order by name") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return $z;}
}
function GetFaqGroups()
{
$z = @mysql_query("select * from faq_groups order by sort,id") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return $z;}
}
function GetFaqGroupById($id)
{
$z = @mysql_query("select * from faq_groups where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return mysql_fetch_object($z);}
}
function GetFaqs($_obfuscate_vH0яїЅ = "")
{
if ($_obfuscate_vH0яїЅ != "") {$addon = "where `group`='".$_obfuscate_vH0яїЅ."'";}
$z = @mysql_query("select * from faq $addon order by `group`,sort,id") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return $z;}
}
function GetFaqById( $id )
{
$z = @mysql_query("select * from faq where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return mysql_fetch_object($z);}
}
function _obfuscate_cHJpbnRkb21haW5jb3N0($_obfuscate_fFtDsgOHBgяїЅяїЅ,$_obfuscate_NcRdu_neRusяїЅ,$_obfuscate_L91NPjeEBwяїЅяїЅ,$_obfuscate_uX9Gf4D0,$enc = "windows-1251")
{
mconnect();
$zone = GetZoneById($_obfuscate_fFtDsgOHBgяїЅяїЅ);
if ($zone->id)
{
if ($_obfuscate_NcRdu_neRusяїЅ == "cost1")
{
if ($_obfuscate_L91NPjeEBwяїЅяїЅ)
{
$_obfuscate_LXoVhAяїЅяїЅ = $zone->renew_if_not_host;
}
else
{
if ($zone->action > 0) {$_obfuscate_LXoVhAяїЅяїЅ = $zone->action;}else{$_obfuscate_LXoVhAяїЅяїЅ = $zone->cost_if_not_host;}
}
}
else if ($_obfuscate_NcRdu_neRusяїЅ == "cost2" )
{
if ($_obfuscate_L91NPjeEBwяїЅяїЅ)
{
$_obfuscate_LXoVhAяїЅяїЅ = $zone->renew_if_host;
}
else
{
if ($zone->action > 0) {$_obfuscate_LXoVhAяїЅяїЅ = $zone->action;}else{$_obfuscate_LXoVhAяїЅяїЅ = $zone->cost_if_host;}
}
}
else if ($_obfuscate_NcRdu_neRusяїЅ == "reseller" )
{
if ($_obfuscate_L91NPjeEBwяїЅяїЅ)
{
$_obfuscate_LXoVhAяїЅяїЅ = $zone->renew_if_reseller;
}
else
{
if ($zone->action > 0) {$_obfuscate_LXoVhAяїЅяїЅ = $zone->action;}else{$_obfuscate_LXoVhAяїЅяїЅ = $zone->cost_if_reseller;}
}
}
else
{
if ($_obfuscate_NcRdu_neRusяїЅ == "domainreseller" )
{
if ($_obfuscate_L91NPjeEBwяїЅяїЅ)
{
$_obfuscate_LXoVhAяїЅяїЅ = $zone->renew_if_domainreseller;
}
else
{
if ($zone->action > 0) {$_obfuscate_LXoVhAяїЅяїЅ = $zone->action;}else{$_obfuscate_LXoVhAяїЅяїЅ = $zone->cost_if_domainreseller;}
}
}
else {print "no costtype";}
}
if ($_obfuscate_LXoVhAяїЅяїЅ)
{
$currency = GetCurrencyByCode(strtoupper($_obfuscate_uX9Gf4D0));
if ($currency->code)
{
$_obfuscate_LXoVhAяїЅяїЅ *= $currency->koeficient;
$_obfuscate_LXoVhAяїЅяїЅ = round($_obfuscate_LXoVhAяїЅяїЅ, 2);
if (!($enc == "utf-8"))
{
if ($enc == "koi8-r") {$currency->symbol = iconv("utf-8","koi8-r",$currency->symbol);}
else if ($enc == "windows-1251") {$currency->symbol = iconv("utf-8","windows-1251",$currency->symbol);}
}
echo $_obfuscate_LXoVhAяїЅяїЅ." ".$currency->symbol;
}
else {print "no currency";}
}
}
else {print "no zone";}
}
function parseRPStrArray($str,$_obfuscate_XkяїЅ,$_obfuscate_1mkяїЅ)
{
$_obfuscate_ReIяїЅ = @split("{$_obfuscate_XkяїЅ}",$str);
while (list($k,$v) = each(&$_obfuscate_ReIяїЅ))
{
$_obfuscate_eOoяїЅ = @split("{$_obfuscate_1mkяїЅ}",$v);
$param = $_obfuscate_eOoяїЅ[0];
$value = $_obfuscate_eOoяїЅ[1];
if (!$param && !$value) {$_obfuscate_hYOjB84WSnfH[$param] = $value;}
}
return $_obfuscate_hYOjB84WSnfH;
}
function parseRPArrayStr($_obfuscate_bCpttUumCwяїЅяїЅ,$_obfuscate_XkяїЅ,$_obfuscate_1mkяїЅ)
{
while (list($k,$v) = each(&$_obfuscate_bCpttUumCwяїЅяїЅ)) {$_obfuscate_23gU96fscTffOMYяїЅ[] = $k."{$_obfuscate_1mkяїЅ}".$v;}
$_obfuscate_6_IMEuswpP3Y = @join($_obfuscate_XkяїЅ,$_obfuscate_23gU96fscTffOMYяїЅ);
return $_obfuscate_6_IMEuswpP3Y;
}
function GetAdminGroups()
{
$z = @mysql_query("select * from admin_groups order by name") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return $z;}
}
function GetAdminGroupById( $id )
{
$z = @mysql_query("select * from admin_groups where id='$id'") or die(mysql_error());
if (mysql_num_rows($z) > 0) {return mysql_fetch_object($z);}
}
function _obfuscate_ZBINB0B1EhU4ajML($code)
{
$code = strtoupper($code);
$z = @mysql_query("select * from currency where code='$code'") or die(mysql_error());
if (mysql_num_rows($z) > 0)
{
$z = mysql_fetch_object( $z );
echo $z->koeficient." ".$z->symbol;
}
else {print "no currency";}
}
set_magic_quotes_runtime(0);
@set_time_limit(200);
mb_internal_encoding("UTF-8");
while (list($key,$val) = each(&$GLOBALS['_GET']))
{
if (!is_array($val))
{
$$key = htmlEncode(stripslashes($val));
$GLOBALS['_GET']["{$key}"] = $$key;
}
else
{
$$key = array();
$tmp = array();
while (list($kkey,$vval) = each(&$val))
{
if (!is_array($vval)) {$tmp[$kkey] = htmlEncode(stripslashes($vval));}
else
{
$tmp2 = array();
while (list($kkey,$vval) = each(&$val)) {$tmp2[$kkkey] = htmlEncode(stripslashes($vvval));}
$tmp[$kkey] = $tmp2;
}
}
$$key = $tmp;
$GLOBALS['_GET']["{$key}"] = $tmp;
}
}
while (list($key,$val) = each(&$GLOBALS['_POST']))
{
if (!is_array($val))
{
$$key = htmlEncode(stripslashes($val));
$GLOBALS['_POST']["{$key}"] = $$key;
}
else
{
$$key = array();
$tmp = array();
while (list($kkey,$vval) = each(&$val))
{
if (!is_array($vval)) {$tmp[$kkey] = htmlEncode(stripslashes($vval));}
else
{
$tmp2 = array();
while (list($kkey,$vval) = each(&$val)) {$tmp2[$kkkey] = htmlEncode(stripslashes($vvval));}
$tmp[$kkey] = $tmp2;
}
}
$$key = $tmp;
$GLOBALS['_POST']["{$key}"] = $tmp;
}
}
$do = @preg_replace("/(\W)/uis","",$do);
$lang = @preg_replace("/(\W)/uis","",$lang);
$newlang = @preg_replace("/(\W)/uis","",$newlang);
$version = "1.7.0";
$font_row = $font_row2;
$ip = getenv("REMOTE_ADDR");
$server_host = getenv("HTTP_HOST");
$server_ip = getenv("SERVER_ADDR");
if (!$admin_script) {$admin_script = "admin.php";}
if (!$PHPPATH) {$PHPPATH = "/usr/bin/php";}
require_once($full_home_path."/_rootinc/functions.inc.php");
require_once($full_home_path."/_rootinc/domain.class.inc.php");
require_once($full_home_path."/_rootinc/da.class.inc.php");
require_once($full_home_path."/_rootinc/whm.inc.php");
require_once($full_home_path."/_rootinc/isp.inc.php");
require_once($full_home_path."/_rootinc/regru.inc.php");
require_once($full_home_path."/_rootinc/webnames.inc.php");
require_once($full_home_path."/_rootinc/estdomains.inc.php");
require_once($full_home_path."/_rootinc/freehost.inc.php");
require_once($full_home_path."/_rootinc/naunet.inc.php");
require_once($full_home_path."/_rootinc/nicru.inc.php");
require_once($full_home_path."/_rootinc/todaynic.inc.php");
require_once($full_home_path."/_rootinc/hostmaster.inc.php");
require_once($full_home_path."/_rootinc/onlinenic.inc.php");
require_once($full_home_path."/_rootinc/easypay.inc.php");
require_once($full_home_path."/_rootinc/portmone.inc.php");
require_once($full_home_path."/_rootinc/captcha.inc.php");
require_once($full_home_path."/_rootinc/class.phpmailer.php");
require_once($full_home_path."/_rootinc/class.pop3.php");
require_once($full_home_path."/_rootinc/class.smtp.php");
require_once($full_home_path."/_rootinc/started.inc.php");
require_once($full_home_path."/_rootinc/ukrnames.inc.php");
require_once($full_home_path."/_rootinc/r01.inc.php");
require_once($full_home_path."/_rootinc/idna.class.inc.php");
require_once($full_home_path."/_rootinc/avdesk.inc.php");
require_once($full_home_path."/_rootinc/privatapi.inc.php");
require_once($full_home_path."/_rootinc/ficora.inc.php");
require_once($full_home_path."/_rootinc/pdf.inc.php");
require_once($full_home_path."/_rootinc/ventrilo.inc.php");
require_once($full_home_path."/_rootinc/internetx.inc.php");
@include_once($full_home_path."/_rootinc/vamshop.inc.php");
@include_once($full_home_path."/_rootinc/wordpress.inc.php");
@include_once($full_home_path."/_rootinc/modx.inc.php");
@include_once($full_home_path."/_rootinc/modxevo.inc.php");
@include_once($full_home_path."/_rootinc/joomla.inc.php");
@include_once($full_home_path."/_rootinc/shopos.inc.php");
$_1_2[1][russian] = "РѕРґРЅР° ";
$_1_2[2][russian] = "РґРІРµ ";
$_1_2[1][ukrainian] = "РѕРґРЅР° ";
$_1_2[2][ukrainian] = "РґРІС– ";
$_1_19[1][russian] = "РѕРґРёРЅ ";
$_1_19[2][russian] = "РґРІР° ";
$_1_19[3][russian] = "три ";
$_1_19[4][russian] = "четыре ";
$_1_19[5][russian] = "пять ";
$_1_19[6][russian] = "шесть ";
$_1_19[7][russian] = "семь ";
$_1_19[8][russian] = "восемь ";
$_1_19[9][russian] = "девять ";
$_1_19[10][russian] = "десять ";
$_1_19[11][russian] = "одиннацать ";
$_1_19[12][russian] = "двенадцать ";
$_1_19[13][russian] = "тринадцать ";
$_1_19[14][russian] = "четырнадцать ";
$_1_19[15][russian] = "пятнадцать ";
$_1_19[16][russian] = "шестнадцать ";
$_1_19[17][russian] = "семнадцать ";
$_1_19[18][russian] = "восемнадцать ";
$_1_19[19][russian] = "девятнадцать ";
$_1_19[1][ukrainian] = "РѕРґРЅР° ";
$_1_19[2][ukrainian] = "РґРІС– ";
$_1_19[3][ukrainian] = "три ";
$_1_19[4][ukrainian] = "чотири ";
$_1_19[5][ukrainian] = "п'ять ";
$_1_19[6][ukrainian] = "шість ";
$_1_19[7][ukrainian] = "СЃС–Рј ";
$_1_19[8][ukrainian] = "РІС–СЃС–Рј ";
$_1_19[9][ukrainian] = "дев'ять ";
$_1_19[10][ukrainian] = "десять ";
$_1_19[11][ukrainian] = "одинадцять ";
$_1_19[12][ukrainian] = "дванадцять ";
$_1_19[13][ukrainian] = "тринадцять ";
$_1_19[14][ukrainian] = "чотирнадцять ";
$_1_19[15][ukrainian] = "п'ятнадцять ";
$_1_19[16][ukrainian] = "шістнадцять ";
$_1_19[17][ukrainian] = "сімнадцять ";
$_1_19[18][ukrainian] = "вісімнадцять ";
$_1_19[19][ukrainian] = "дев'ятнадцять ";
$des[2][russian] = "двадцать ";
$des[3][russian] = "тридцать ";
$des[4][russian] = "СЃРѕСЂРѕРє ";
$des[5][russian] = "пятьдесят ";
$des[6][russian] = "шестьдесят ";
$des[7][russian] = "семьдесят ";
$des[8][russian] = "восемдесят ";
$des[9][russian] = "девяносто ";
$des[2][ukrainian] = "двадцять ";
$des[3][ukrainian] = "тридцять ";
$des[4][ukrainian] = "СЃРѕСЂРѕРє ";
$des[5][ukrainian] = "п'ятдесят ";
$des[6][ukrainian] = "шістдесят ";
$des[7][ukrainian] = "сімдесят ";
$des[8][ukrainian] = "вісімдесят ";
$des[9][ukrainian] = "дев'яносто ";
$hang[1][russian] = "сто ";
$hang[2][russian] = "двести ";
$hang[3][russian] = "триста ";
$hang[4][russian] = "четыреста ";
$hang[5][russian] = "пятьсот ";
$hang[6][russian] = "шестьсот ";
$hang[7][russian] = "семьсот ";
$hang[8][russian] = "восемьсот ";
$hang[9][russian] = "девятьсот ";
$hang[1][ukrainian] = "сто ";
$hang[2][ukrainian] = "двісті ";
$hang[3][ukrainian] = "триста ";
$hang[4][ukrainian] = "чотириста ";
$hang[5][ukrainian] = "п'ятсот ";
$hang[6][ukrainian] = "шістсот ";
$hang[7][ukrainian] = "СЃС–РјСЃРѕС‚ ";
$hang[8][ukrainian] = "РІС–СЃС–РјСЃРѕС‚ ";
$hang[9][ukrainian] = "дев'ятсот ";
$namecur[RUB][1][russian] = "рубль ";
$namecur[RUB][2][russian] = "рубля ";
$namecur[RUB][3][russian] = "рублей ";
$namecur[UAH][1][russian] = "РіСЂРёРІРЅР° ";
$namecur[UAH][2][russian] = "РіСЂРёРІРЅС‹ ";
$namecur[UAH][3][russian] = "гривен ";
$namecur[RUB][1][ukrainian] = "рубль ";
$namecur[RUB][2][ukrainian] = "рубля ";
$namecur[RUB][3][ukrainian] = "рублів ";
$namecur[UAH][1][ukrainian] = "РіСЂРёРІРЅСЏ ";
$namecur[UAH][2][ukrainian] = "РіСЂРёРІРЅС– ";
$namecur[UAH][3][ukrainian] = "гривень ";
$nametho[1][russian] = "тысяча ";
$nametho[2][russian] = "тысячи ";
$nametho[3][russian] = "тысяч ";
$nametho[1][ukrainian] = "тисяча ";
$nametho[2][ukrainian] = "тисячі ";
$nametho[3][ukrainian] = "тисяч ";
$namemil[1][russian] = "миллион ";
$namemil[2][russian] = "миллиона ";
$namemil[3][russian] = "миллионов ";
$namemil[1][ukrainian] = "мільйон ";
$namemil[2][ukrainian] = "мільйони ";
$namemil[3][ukrainian] = "мільйонів ";
$namemrd[1][russian] = "миллиард ";
$namemrd[2][russian] = "миллиарда ";
$namemrd[3][russian] = "миллиардов ";
$namemrd[1][ukrainian] = "мільярд ";
$namemrd[2][ukrainian] = "мільярди ";
$namemrd[3][ukrainian] = "мільярдів ";
$kopeek[1][russian] = "копейка ";
$kopeek[2][russian] = "копейки ";
$kopeek[3][russian] = "копеек ";
$kopeek[1][ukrainian] = "РєРѕРїС–Р№РєР° ";
$kopeek[2][ukrainian] = "РєРѕРїС–Р№РєРё ";
$kopeek[3][ukrainian] = "РєРѕРїС–Р№РѕРє ";
?>