<?php
include "./../ini3.php";
include "./../includes/header$h.php";
$id=cyr(htmlspecialchars(stripslashes(trim($id))));
$pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
if(!empty($id))
{
$q = mysql_query("select login,band,level,cars,id,pass,money,zav,lsd,ban from users where id='".$id."';");
}
else
{
die ($lang['empty_login']."</body></html>");
}
$data = mysql_fetch_array($q);
$id=$data['id'];
$login=$data['login'];
$money=$data['money'];
$cars=$data['cars'];
$level=$data['level'];
$band=$data['band'];
$zav=$data['zav'];
$lsd=$data['lsd'];
$ban=$data['ban'];
if(md5($pass)!=$data['pass'])
{
die ($lang['empty_login']."</body></html>");
}
mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
if($ban==0)
{
switch ($mode)
{
case "kup":
$band_q=mysql_query("select * from bands where name='".$band."';");
$band_array=mysql_fetch_array($band_q);
$bname=$band_array['name'];
$boss=$band_array['boss'];
$members=$band_array['members'];
$blvl=$band_array['blvl'];
$obwak=$band_array['kazna'];
$bcars=$band_array['cars'];
$bguns=$band_array['guns'];
$bmoney=$band_array['money'];
$bgold=$band_array['gold'];
$osobnyak=$band_array['osobnyak'];
$band_members = explode(".", $members);
$count_members=count($band_members);
if($osobnyak>=1) die ($lang['os_uje']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
case "my":
list($osobnyak)=mysql_fetch_array(mysql_query("select osobnyak from bands where name='".$band."';"));
list($members,$bname,$boss,$bmoney,$bgold,$beuro,$blvl)=mysql_fetch_array(mysql_query("select members,name,boss,money,gold,euro,blvl from bands where name='".$band."';"));
if(empty($osobnyak))die ($lang['error']."</body></html>");
if($osobnyak==1) $znak='<b>+</b>';
elseif($osobnyak==2) $znak='<b>*</b>';
elseif($osobnyak==3) $znak='<b>!</b>';
elseif($osobnyak==4) $znak='<b>$</b>';
print '[<u>'.$bname.'</u> '.$znak.']<br/>';
print $lang['os_mes'];
if(!empty($obed))
{
$band_members = explode(".", $members);
$count_members=count($band_members);
$rand=rand(5,80);
if($beuro>=$rand){
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set energy='100' where login='".$band_members[$i]."';");
}
print "Энергия всей банды восстановлена<br/>";
if(($bmoney-$rand)<=0) $rand=$beuro;
mysql_query("update bands set euro='".$beuro."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.' евро</b><br/>';
}else{
print "В общаке банды недостаточно евро, чтобы заплатить налог на пользование особняком<br/>";
}
}
if(!empty($vrach))
{
if($osobnyak<2)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set health='150' where login='".$band_members[$i]."';");
}
print $lang['os_health'];
$rand=rand(1,500);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($grim))
{
if($osobnyak<3)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set police='0' where login='".$band_members[$i]."';");
}
print $lang['os_police'];
$rand=rand(1,700);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($voodoo))
{
if($osobnyak<3)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set voodoo='' where login='".$band_members[$i]."';");
}
print $lang['os_voodoo'];
$rand=rand(1,1000);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($lev))
{
if($osobnyak<4)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
$level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
mysql_query("update users set level='".$level_ar['level']."'+'10' where login='".$band_members[$i]."';");
}
print "Авторитет всех членов банды повышен на 10 единиц<br/>";
$rand=rand(1,2000);
if($bmoney>$rand)
{
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';}else{
print 'В общаке не хватает денег,чтобы заплатить налог на пользование особняоком<br/>';}
}
if(!empty($health))
{
if($osobnyak<4)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
$rand=rand(1,50);
if($beuro>$rand)
{
mysql_query("update bands set euro='".$beuro."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.' евро</b><br/>';
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set health='3000' where login='".$band_members[$i]."';");
}
print "Теперь вся банда здорова на 3000 единиц<br/>";
}else{
print 'В общаке не хватает евро,чтобы заплатить налог на пользование особняоком<br/>';}
}
if(!empty($obraz))
{
if($osobnyak<4)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
$rand=rand(200,500);
if($beuro>$rand)
{
mysql_query("update bands set euro='".$beuro."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.' евро</b><br/>';
for($i=0;$i<$count_members;$i++)
{
$school=rand(2,3);
$s_time=time()+604800;
mysql_query("update users set school='".$school."',school_time='".$s_time."' where id='".$id."';");
}
if($school==2)print "Ты изучил среднее образование<br/>";
elseif($school==3)print "Ты изучил высшее образование<br/>";
}else{
print 'В общаке не хватает евро,чтобы заплатить налог на пользование особняоком<br/>';}
}
if($osobnyak>=1)
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&obed=1\">Восстановить энергию</a><br/>";
if($osobnyak>=2)
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&vrach=1\">".$lang['os_vrach']."</a><br/>";
if($osobnyak>=3)
{
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&grim=1\">".$lang['os_grim']."</a><br/>";
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&voodoo=1\">".$lang['os_prokl']."</a><br/>";
}
if($osobnyak>=4)
{
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&lev=1\">Повысить авторитет банды</a><br/>";
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&health=1\">Восстановить здоровье банды</a><br/>";
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&obraz=1\">Изменить свое образование</a><br/>";
}
print "><a href=\"band_panel.php?id=$id&pass=$pass\">Твоя банда</a><br/>";
break;
default:
print "<u>[".$lang['el_2avenu']."]</u><br/>";
print $lang['os_enter'];
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=kup\">".$lang['os_nedvij']."</a><br/>";
break;
}
print "<br/>>><a href=\"./../game.php?id=$id&pass=$pass\">".$lang['menu']."</a></body></html>";
mysql_close();
}
elseif($ban==1)
{
die ($lang['empty_login']."</body></html>");
}
?>