Файл: chats/city1/black_sale.php
Строк: 149
<?php
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
include "./../includes/header.php";
include "../includes/inc_online.php";
include "../russian/lang_main.php"; //языковой файл
if(!empty($id))
{
$q = mysql_query("select secur,golod,voodoo,nums,guns,cars,id,login,pass,mafcredits,level,police,health from users where id='".$id."';");
}
$data = mysql_fetch_array($q);
$id=$data['id'];
$login=$data['login'];
$mafcredits=$data['mafcredits'];
$level=$data['level'];
$police=$data['police'];
$stage=$data['stage'];
$health=$data['health'];
$cars=$data['cars'];
$guns=$data['guns'];
$nums=$data['nums'];
$voo_por=$data['voodoo'];
$golod=$data['golod'];
$secur=$data['secur'];
if($pass!=$data['pass'])
{
die ($lang['empty_login']."</small></p></card></wml>");
}
mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
include "./../includes/inc_secur.php";
include "./../includes/inc_golod.php";
include "./../includes/inc_hospital.php";
include "./../includes/inc_police.php";
include "./../includes/inc_die.php";
include "./../includes/inc_voodoo.php";
include "./../includes/inc_attack.php";
include "./../includes/inc_mes.php";
print "<div><b>".$lang['game_city1']."</b></div>";
switch ($mode)
{
case "skupka":
if(empty($car_sale))
{
if(!empty($cars))
{
$cars_count = explode(".", $cars);
$count_cars=count($cars_count);
echo "<form method="post" action="black_sale.php?id=$id&pass=$pass&mode=skupka">";
print $lang['game_cars']." <b>($count_cars)</b>:<br/></small><select name="car_sale">";
for($i=0;$i<$count_cars;$i++)
{
print "<option value="".$cars_count[$i]."">".$cars_count[$i]."</option>";
}
echo "<input value="Взять" type="submit" class="cp">rn</form>";
//print "</select><small><br/>";
//print "<anchor>".$lang['ok']."<go href="black_sale.php?id=$id&pass=$pass&mode=skupka" method="post">
//<postfield name="car_sale" value="$(car_sale)"/>
//</go></anchor>";
}
else
{
print $lang['bs_error'];
}
}
else
{
$check=mysql_fetch_array(mysql_query("select cars from users where id='".$id."';"));
$ch_cars_ar=$check['cars'];
$ch_cars=explode('.',$ch_cars_ar);
if(!in_array($car_sale,$ch_cars)) print $lang['error'];
else
{
$car_sale=cyr(htmlspecialchars(stripslashes(trim($car_sale))));
if($car_sale==$lang['car1'] && !empty($cars))
{
$mafcredits=$mafcredits+40;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car2'] && !empty($cars))
{
$mafcredits=$mafcredits+200;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car3'] && !empty($cars))
{
$mafcredits=$mafcredits+350;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car4'] && !empty($cars))
{
$mafcredits=$mafcredits+500;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car5'] && !empty($cars))
{
$mafcredits=$mafcredits+700;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car6'] && !empty($cars))
{
$mafcredits=$mafcredits+1000;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car7'] && !empty($cars))
{
$mafcredits=$mafcredits+1500;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
elseif($car_sale==$lang['car8'] && !empty($cars))
{
$mafcredits=$mafcredits+1700;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
$cars_array = explode(".", $cars);
if(count($cars_array)<=1)
{
$cars=str_replace("$car_sale","","$cars");
mysql_query("update users set cars='$cars' where id='$id';");
}
elseif(count($cars_array)>1 && $cars_array[0]!=$car_sale)
{
$cars=str_replace(".$car_sale","","$cars");
mysql_query("update users set cars='$cars' where id='$id';");
}
elseif(count($cars_array)>1 && $cars_array[0]==$car_sale)
{
$cars=str_replace("$car_sale.","","$cars");
mysql_query("update users set cars='$cars' where id='$id';");
}
print $lang['bs_car_saled']." ".$mafcredits." $$!<br/>";
}
}
print "<br/>><a href="black_sale.php?id=$id&pass=$pass">".$lang['sl_black_sale']."</a><br/>";
break;
case "nap":
print "<u>[".$lang['bs_nap']."]</u><br/>";
print $lang['bs_nap_mes']."<br/>";
if(!empty($p) && ($p==1 || $p==2 || $p=3))
{
$val=rand(1,4);
if($p==$val)
{
$val=$val*4;
print $lang['bs_nap_yes1']." ".$p." ".$lang['bs_nap_yes2']." ".$val."$$<br/>";
$mafcredits=$mafcredits+$val;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
}
else
{
$mafcredits=$mafcredits-($p+$p);
if($mafcredits<=0) print $lang['voo_no_mafcredits'];
else
{
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
print $lang['bs_nap_false']." ".$mafcredits."$$<br/>";
}
}
}
print "-<a href="black_sale.php?id=$id&pass=$pass&mode=nap&p=1">".$lang['bs_nap_stakan']." 1</a><br/>";
print "-<a href="black_sale.php?id=$id&pass=$pass&mode=nap&p=2">".$lang['bs_nap_stakan']." 2</a><br/>";
print "-<a href="black_sale.php?id=$id&pass=$pass&mode=nap&p=3">".$lang['bs_nap_stakan']." 3</a><br/>";
print "><a href="black_sale.php?id=$id&pass=$pass">".$lang['sl_black_sale']."</a><br/>";
break;
default:
print "<u>[".$lang['sl_black_sale']."]</u><br/>";
print $lang['bs_mes']."<br/>";
print "<a href="black_sale.php?id=$id&pass=$pass&mode=skupka">".$lang['bs_skup_krad']."</a><br/>";
print "<a href="black_sale.php?id=$id&pass=$pass&mode=nap">".$lang['bs_nap']."</a><br/>";
break;
}
include("./../includes/inc_in_city.php");
echo "<br/><a href="../enter.php?id={$id}&pass={$pass}&ref={$ref}">Прихожка</a><br/>";
mysql_close();
include "./../includes/footer.php";
?>