Файл: billing/_rootbill/_partner.inc.php
Строк: 388
<?
_head('utf-8',$_lang[PartnerTitle]);
print "<H1 class=pagetitle>".$_lang[PartnerTitle]."</H1><hr class=hr>";
if (GetSetting("partnerEnable")) {
$partnerMoney = GetUserPartnerMoney($_SESSION["userId"]);
$minOut = GetSetting("partnerMinMoneyOut");
$moneyOut=floatval($moneyOut);
if ($sub == "out") {
$moneyOut=floatval($moneyOut); $moneyOut = round($moneyOut/CURK,2);
if ($moneyOut <= $minOut) { print "<font color=red>".$_lang[PartnerErrorMinOut]." ".round($minOut*CURK,2)." ".CURS."</font><br><br>"; }
else if ($moneyOut > $partnerMoney) { print "<font color=red>".$_lang[PartnerErrorNoMoneyOnPartner]."</font><br><br>"; }
else if (!$paymethod) { print "<font color=red>".$_lang[PartnerErrorNoPayMethod]."</font><br><br>"; }
# else if (!$schet) { print "<font color=red>".$_lang[PartnerNoPurse]."</font><br><br>"; }
else {
@mysql_query("update users set partnerMoney=partnerMoney-$moneyOut where id=".$_SESSION["userId"]) or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
addUserLog($_SESSION['userId'], "moneyOut", $_lang[PartnerMoneyOut]." ".round($moneyOut*CURK,2)." ".CURS." via $paymethod ($schet)");
$subject = "Заказ на вывод средств [".$_SESSION["userLogin"].", ".round($moneyOut*CURK,2)." ".CURS."]";
$message = "Пользователь ".$_SESSION["userLogin"]." заказал вывод средств с партнерского счета.rnrnСумма: ".round($moneyOut*CURK,2)." ".CURS."rnСпособ вывода: $paymethodrnНомер счета/кошелька: $schetrnrnИмейте ввиду, что средства уже сняты с партнерского счета клиента.";
$admEmails=GetAdminEmailsWhereTrueParam("sendmoneyout");
if (count($admEmails) > 0) {
WriteMailLog($subject,$message);
}
sendmail($manager_email,'',$manager_email,$subject,$message);
print $_lang[PartnerMoneyOutSuccess]."<br><br>";
$partnerMoney = GetUserPartnerMoney($_SESSION["userId"]);
}
}
print $_lang[PartnerPartnerSchet].": ".round($partnerMoney*CURK,2)." ".CURS."<br><BR>";
$refs1array = array();
$refs2array = array();
$referals = GetUserReferalsArray($_SESSION["userId"]);
while (list($id,$refArray) = @each($referals)) {
$refs1array[$id] = $refArray[login];
$referals2 = GetUserReferalsArray($id);
while (list($id2,$refArray2) = @each($referals2)) {
$refs2array[$id2] = $refArray2[login];
}
}
$partnerProcentHosting=GetSetting("partnerProcentHosting");
$partnerProcentResseler=GetSetting("partnerProcentResseler");
$partnerProcentVds=GetSetting("partnerProcentVds");
$partnerProcentDedicated=GetSetting("partnerProcentDedicated");
$partnerProcentVpn=GetSetting("partnerProcentVpn");
$partnerProcentDomains=GetSetting("partnerProcentDomains");
$partnerProcentAddons=GetSetting("partnerProcentAddons");
$partnerProcentShop=GetSetting("partnerProcentShop");
$partnerProcentHosting2=GetSetting("partnerProcentHosting2");
$partnerProcentResseler2=GetSetting("partnerProcentResseler2");
$partnerProcentVds2=GetSetting("partnerProcentVds2");
$partnerProcentDedicated2=GetSetting("partnerProcentDedicated2");
$partnerProcentVpn2=GetSetting("partnerProcentVpn2");
$partnerProcentDomains2=GetSetting("partnerProcentDomains2");
$partnerProcentAddons2=GetSetting("partnerProcentAddons2");
$partnerProcentShop2=GetSetting("partnerProcentShop2");
print $_lang[PartnerReferalsLevel1].": ".count($refs1array)."<br>";
print $_lang[PartnerReferalsLevel2].": ".count($refs2array)."<br><br>";
print "<table width=600 border=1 bgcolor=#EEEEEE>";
print "<tr><th colspan=4 align=center><b>".$_lang[PartnerPartnerLink].":</b></th></tr>";
print "<tr><th align=center>Описание</th><th>Ссылка</th><th>L1</th><th>L2</th></tr>";
print "<tr><td width=40%>".$_lang[PartnerPartnerLinkHosting]."</td><td width=40%><b>".$full_www_path."pl.php?".$_SESSION["userId"]."</b></td><td align=center width=5%>$partnerProcentHosting%</td><td align=center width=5%>$partnerProcentHosting2%</td></tr>";
print "<tr><td width=40%>".$_lang[PartnerPartnerLinkReseller]."</td width=40%><td><b>".$full_www_path."plr.php?".$_SESSION["userId"]."</b></td><td align=center width=5%>$partnerProcentResseler%</td><td align=center width=5%>$partnerProcentResseler2%</td></tr>";
print "<tr><td width=40%>".$_lang[PartnerPartnerLinkVDS]."</td><td width=40%><b>".$full_www_path."plv.php?".$_SESSION["userId"]."</b></td><td align=center width=5%>$partnerProcentVds%</td><td align=center width=5%>$partnerProcentVds2%</td></tr>";
print "<tr><td width=40%>".$_lang[PartnerPartnerLinkDedicated]."</td><td width=40%><b>".$full_www_path."ple.php?".$_SESSION["userId"]."</b></td><td align=center width=5%>$partnerProcentDedicated%</td><td align=center width=5%>$partnerProcentDedicated2%</td></tr>";
print "<tr><td width=40%>".$_lang[PartnerPartnerLinkDomain]."</td><td width=40%><b>".$full_www_path."pld.php?".$_SESSION["userId"]."</b></td><td align=center width=5%>$partnerProcentDomains%</td><td align=center width=5%>$partnerProcentDomains2%</td></tr>";
// print "<tr><td width=40%>".$_lang[PartnerPartnerLinkShop]."</td><td width=40%><b>".$full_www_path."pls.php?".$_SESSION["userId"]."</b></td><td align=center width=5%>$partnerProcentShop%</td><td align=center width=5%>$partnerProcentShop2%</td></tr>";
print "</table><br>";
print "<b>".$_lang[PartnerZakazatVivod].":</b><br>";
print "<form method=post><table class='rpTableBlank' border=1 align=center>";
print "<input type=hidden name=do value=$do>";
print "<input type=hidden name=sub value=out>";
print "<tr><th>".$_lang[PartnerSumma].", ".CURS.":</th><td><input class=input type=text name=moneyOut value=".round($partnerMoney*CURK,2)." size=5></td></tr>";
print "<tr><th>".$_lang[PartnerSposobVivoda].":</th><td>"; printPayMethodsSelect(1); print "</td></tr>";
print "<tr><th>".$_lang[PartnerPurse].":</th><td><input class=input type=text name=schet size=13></td></tr>";
print "<tr><th colspan=2 align=center><input class=button type=submit value='".$_lang[PartnerZakazatVivodButton]."'></td></tr>";
print "</table></form>";
$handle=opendir("./_rootimages/banners/");
while ($file = readdir($handle)) {
$f = mb_split(".",$file);
if ($file != "." and $file != ".." and $file != "" and !preg_match("/.code$/iu", $file) and (preg_match ("/gif/ui", $f[1]) or preg_match ("/jpg/ui", $f[1]) or preg_match ("/jpeg/ui", $f[1]) or preg_match ("/png/ui", $f[1]) or preg_match ("/swf/iu", $f[1]))) {$files[] = $file;}
}
closedir($handle);
@sort($files);
$cnt=count($files);
if ($cnt > 0) {
print "<table class='rpTable' border=1 width=95% align=center><tr><th align=center bgcolor=$font_head><B>".$_lang[PartnerOurBanners]."</b></th></tr>";
while (list($k,$v) = @each($files)) {
$code = GetBannerCodeByFileName($v,$full_www_path."pl.php?".$_SESSION["userId"]);
getfont();
print "<tr align=center><td>$code<br><textarea class=input cols=50 rows=4 readonly>$code</textarea><br><Br></td></tr>";
}
print "</table>";
}
} else {
print $_lang[PartnerErrorPartnerOff];
}
_foot('utf-8');
?>