Файл: inc/referal.php
Строк: 51
<?php
include 'inc/account.php';
$qs = mysql_query("SELECT * FROM `referals` WHERE `refs` = '$account[id]' AND `yes` = 'yes'");
while ($fs = mysql_fetch_array($qs))
{
$ad = mysql_fetch_array(mysql_query("SELECT * FROM `referals` WHERE `ids` = '$fs[ids]' AND `yes` = 'yes' LIMIT 1"));
$req = mysql_query("SELECT `lvl` FROM `account` WHERE `id` = '$fs[ids]'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo'Ошибка!';
include ("inc/nogi.php");
exit;
}
$ussdata = mysql_fetch_array($req);
$req = mysql_query("SELECT * FROM `referals` WHERE `ids` = '$fs[ids]'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo'Ошибка!';
include ("inc/nogi.php");
exit;
}
$usdata = mysql_fetch_array($req);
if($ussdata['lvl']>='10' and $usdata['yes']!='not'){
mysql_query("UPDATE `referals` SET `yes` = 'not' WHERE `refs` = '$account[id]' and `ids` = '$fs[ids]' LIMIT 1");
echo"Ваш друг ";
$req = mysql_query("SELECT `status`,`login`,`sex` FROM `account` WHERE `id` = '$fs[ids]'");
$pic = mysql_fetch_array($req);
if($pic['status']=="gm"){
$nik = gradient(''.$pic[login].'','00FF00', '00CC00');
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="/infa.php?id='.$fs['ids'].'">'.$nik.'</a>';
}else{
if($pic['status']=="moder"){
$nik = gradient(''.$pic[login].'','0066CC', 'AB82FF');
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="/infa.php?id='.$fs['ids'].'">'.$nik.'</a>';
}else{
if($pic['status']=="bot"){
$nik = gradient(''.$pic[login].'','FFCC00', 'FF9933');
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="/infa.php?id='.$fs['ids'].'">'.$nik.'</a>';
}else{
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="/infa.php?id='.$fs['ids'].'">'.$pic[login].'</a>';
}}}
echo" которого вы пригласили по реферальской ссылке получил 10 <img src='/pic/main/up.png' alt='*'/> уровень!<br>Вам зачислено 1,000 <img src='/pic/main/zoloto.gif' alt='*'/> Золота.<br>";
mysql_query("UPDATE `account` SET `zoloto`= `zoloto` + '1000' WHERE `id`='$account[id]'");
}}
?>