Файл: files/syst.php
Строк: 153
<?
$payment=mysql_query("SELECT * FROM `payments` WHERE `usr`='".$udata['id']."' and `status`='1'");
$num_payment=mysql_num_rows($payment);
if($num_payment!=0)
{
$f_pay=mysql_fetch_array($payment);
$j_pay=$f_pay['sum'];
$bon=0;
$bon_t='';
if($j_pay>=10){$bon=1;}
elseif($j_pay>=50){$bon=7;}
elseif($j_pay>=100){$bon=20;}
elseif($j_pay>=250){$bon=65;}
elseif($j_pay>=500){$bon=150;}
if($bon>0){$bon_t='А так же бонус: <img src=img/main/p13.png>'.$bon.' жемчуга';}
$jem_pay=$udata['jem']+$j_pay+$bon;
$vip=$udata['vip_exp']+$j_pay;
$text_ok='<font color=#cccccc>Спасибо за покупку. Вам было начислено: <img src=img/main/p13.png>'.$j_pay.' жемчуга. '.$bon_t.'</font>';
$rows21_ok=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$udata['id']."' and `usr2`='0'"));
if($rows21_ok==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$udata['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2_ok=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$udata['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$udata['id']."'");
}
$rows2_oks=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$udata['id']."'"));
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2_oks['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text_ok."',
`usr`='".$udata['id']."'
");
mysql_query("UPDATE `users` SET `jem`='".$jem_pay."', `vip_exp`='".$vip."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `payments` SET `status`='10' WHERE `id`='".$f_pay['id']."'");
}
$dost_us=mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'");
$dost_usr=mysql_fetch_array($dost_us);
$ds1=$dost_usr['hunter']+1;
$ds2=$dost_usr['killer']+1;
$ds3=$dost_usr['str']+1;
$ds4=$dost_usr['ohot']+1;
$ds5=$dost_usr['pdz']+1;
$ds6=$dost_usr['bz']+1;
$ds7=$dost_usr['alh']+1;
$ds8=$dost_usr['elic']+1;
$ds9=$dost_usr['kyzn']+1;
$ds10=$dost_usr['avan']+1;
$e1=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds1."'"));
$e2=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds2."'"));
$e3=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds3."'"));
$e3['exp']=$e3['exp']*3;
$e4=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds4."'"));
$e5=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds5."'"));
$e6=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds6."'"));
$e7=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds10."'"));
$e8=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds7."'"));
$e9=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds8."'"));
$e10=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost_exp` WHERE `lvl`='".$ds9."'"));
$e10['exp']=floor($e10['exp']/3);
if($dost_usr['hunter_exp']>=$e1['exp'] and $dost_usr['hunter']<5)
{
$l1=$dost_usr['hunter']+1;
$hp=$dost_usr['hp']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `hunter`='".$l1."', `hp`='".$hp."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Охотник<br>Награда: <img src=img/main/p3.png>+5 ".$j."'");
}
if($dost_usr['killer_exp']>=$e2['exp'] and $dost_usr['killer']<5)
{
$l1=$dost_usr['killer']+1;
$hp=$dost_usr['sila']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `killer`='".$l1."', `sila`='".$hp."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Убийца<br>Награда: <img src=img/main/p1.png>+5 ".$j."'");
}
if($dost_usr['str_exp']>=$e3['exp'] and $dost_usr['str']<5)
{
$l1=$dost_usr['str']+1;
$arm=$dost_usr['arm']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `str`='".$l1."', `arm`='".$arm."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Страж<br>Награда: <img src=img/main/p2.png>+5 ".$j."'");
}
if($dost_usr['ohot_exp']>=$e4['exp'] and $dost_usr['ohot']<5)
{
$l1=$dost_usr['ohot']+1;
$hp=$dost_usr['hp']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `ohot`='".$l1."', `hp`='".$hp."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Первопроходчик<br>Награда: <img src=img/main/p3.png>+5 ".$j."'");
}
if($dost_usr['pdz_exp']>=$e5['exp'] and $dost_usr['pdz']<5)
{
$l1=$dost_usr['pdz']+1;
$arm=$dost_usr['arm']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `pdz`='".$l1."', `arm`='".$arm."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Кладоискатель<br>Награда: <img src=img/main/p2.png>+5 ".$j."'");
}
if($dost_usr['bz_exp']>=$e6['exp'] and $dost_usr['bz']<5)
{
$l1=$dost_usr['bz']+1;
$sila=$dost_usr['sila']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `bz`='".$l1."', `sila`='".$sila."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Гладиатор<br>Награда: <img src=img/main/p1.png>+5 ".$j."'");
}
if($dost_usr['avan_exp']>=$e7['exp'] and $dost_usr['avan']<5)
{
$l1=$dost_usr['avan']+1;
$hp=$dost_usr['hp']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `avan`='".$l1."', `arm`='".$hp."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Защитник<br>Награда: <img src=img/main/p2.png>+5 ".$j."'");
}
if($dost_usr['alh_exp']>=$e8['exp'] and $dost_usr['alh']<5)
{
$l1=$dost_usr['alh']+1;
$hp=$dost_usr['hp']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `alh`='".$l1."', `hp`='".$hp."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Алхимик<br>Награда: <img src=img/main/p3.png>+5 ".$j."'");
}
if($dost_usr['elic_exp']>=$e9['exp'] and $dost_usr['elic']<5)
{
$l1=$dost_usr['elic']+1;
$sila=$dost_usr['sila']+5;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `elic`='".$l1."', `sila`='".$sila."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Живчик<br>Награда: <img src=img/main/p1.png>+5 ".$j."'");
}
if($dost_usr['kyzn_exp']>=$e10['exp'] and $dost_usr['kyzn']<5)
{
$l1=$dost_usr['kyzn']+1;
$sila=$dost_usr['sila']+2;
$hp=$dost_usr['hp']+2;
$arm=$dost_usr['arm']+2;
if($l1<4){$jem=0;$j='';}
elseif($l1==4){$jem=5;$j='<img src=img/main/p13.png>'.$jem.'';}
elseif($l1==5){$jem=10;$j='<img src=img/main/p13.png>'.$jem.'';}
$jem=$udata['jem']+$jem;
mysql_query("UPDATE `users` SET `jem`='".$jem."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `users_dost` SET `kyzn`='".$l1."', `sila`='".$sila."', `hp`='".$hp."', `arm`='".$arm."' WHERE `id`='".$dost_usr['id']."'");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вы получили ".$l1." уровень достижения: Кузнец<br>Награда: <img src=img/main/p1.png>+2 <img src=img/main/p2.png>+2 <img src=img/main/p3.png>+2 ".$j."'");
}
$kor=mysql_num_rows(mysql_query("SELECT * FROM `users_ships` WHERE `usr`='".$udata['id']."'"));
if($udata['lvl']>=10 and $kor==0)
{
$kor1=mysql_fetch_array(mysql_query("SELECT * FROM `users_ships_torg` WHERE `id`='1'"));
mysql_query("INSERT INTO `users_ships` SET
`id`='',
`usr`='".$udata['id']."',
`name`='".$kor1['name']."',
`img`='".$kor1['img']."',
`arm`='".$kor1['arm']."',
`sila`='".$kor1['sila']."',
`oryd`='".$kor1['oryd']."',
`parys`='".$kor1['parys']."',
`oryd_pr`='".$kor1['oryd_pr']."',
`parys_pr`='".$kor1['parys_pr']."',
`kom`='".$kor1['komanda']."',
`trym`='".$kor1['trum']."'
");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."',
`text`=' Подарок от Портового управления
<table>
<tr><td width=35%><img src=img/ships/1.png width=100%></td><td><img src=img/main/e30.png> <font color=#ff9900>Вы достигли 10 уровня, в честь этого вам полагается корабль: <font color=#ffffff>".$kor1['name']."</font>.<br>
<img src=img/main/e30.png> Испытай свои силы в</font> <a href=porp.png>Морском Пути</a>
</td></tr>
</table>'
");
}
$ezd=mysql_num_rows(mysql_query("SELECT * FROM `users_ezd` WHERE `usr`='".$udata['id']."'"));
if($udata['lvl']>=25 and $ezd==0)
{
mysql_query("INSERT INTO `users_ezd` SET
`id`='',
`usr`='".$udata['id']."',
`img`='".$udata['rasa']."',
`lvl`='1',
`cena`='100'
");
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."',
`text`=' Ездовое Животное
<table>
<tr><td width=35%><img src=img/ezd/".$udata['rasa'].".png width=100%></td><td><img src=img/main/e30.png> <font color=#ff9900>Вы достигли 25 уровня, в честь этого вам полагается ездовое животное</font>.
</td></tr>
</table>'
");
}
?>