Файл: tankon.mobi/tanks/fra.php
Строк: 272
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
include_once '../sys/inc/thead.php';
err();
aut();
echo '<link rel="stylesheet" href="style.css" type="text/css" />';
include_once 'function.php';
if(isset($_GET['id'])){
$coding_tanks = mysql_fetch_array(mysql_query("SELECT * FROM `tanks_magazin` WHERE `id`='".intval($_GET['id'])."'"));
if($coding_tanks['strana']==4){
if(isset($_GET['ok'])){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `tanks_angar` WHERE `user` = '".$tanks_code['id_u']."' AND `tank` = '".$coding_tanks['id']."'"), 0)==0){
if ($angar_result<$tanks_code['angars']){
if ($coding_tanks['level']<=$tanks_code['level']){
if ($tanks_code['skidka']>=time()){
$cena_tank=$coding_tanks['price']*0.5;
$prod_tank=$coding_tanks['prod_tank']*0.5;
}else{
$cena_tank=$coding_tanks['price'];
$prod_tank=$coding_tanks['prod_tank'];
}
if($tanks_code['serebro']>=$cena_tank) {
$q_s = mysql_query("SELECT * FROM `tanks_sclad` where `saletank`='0' AND `tank`='".$coding_tanks['id']."'");
while ($ank_s = mysql_fetch_assoc($q_s))
{
mysql_query("UPDATE `tanks_sclad` SET `saletank` = '1' WHERE `id`='".$ank_s['id']."'");
}
mysql_query("UPDATE `tanks` SET `tank`='".$coding_tanks['id']."',`e1`='0',`e2`='0',`e3`='0',`e4`='0',`serebro`=`serebro`-$cena_tank,`prod_tank`=".$prod_tank.", `leveltank`='".$coding_tanks['level']."' WHERE `id_u`='".$user['id']."'");
mysql_query("INSERT INTO `tanks_angar` (`user`,`leveltank`,`tank`) VALUES ('$tanks_code[id_u]','$coding_tanks[level]','$coding_tanks[id]')");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'1' WHERE `id_user`='".$user['id']."' AND `type`='7'");
header("Location: /");
}
else{
err_game('У вас недостаточно средств на покупку танка '.$coding_tanks['name'].'');
}
}else{
err_game('Уровень мал для '.$coding_tanks['name'].'');
}
}
else{
err_game('У вас нет места в ангаре');
}
}
else{
err_game('У вас в ангаре есть такой танк');
}
}
$coding_tanko = mysql_fetch_array(mysql_query("SELECT * FROM `tanks_magazin` WHERE `id`='".intval($_GET['id'])."'"));
if ($tanks_code['skidka']>=time()){
$cena_tanko=$coding_tanko['price']*0.5;
}else{
$cena_tanko=$coding_tanko['price'];
}
echo '<div class="trnt-block p5" style="margin-bottom:3px">
<div class="small bold cD2 cntr sh_b pb5 pt5">'.$coding_tanko['name'].'</div>
<table >
<tbody>
<tr>
<td>
<img class="tank-img" style="width:140px; height:140px;" alt="tank" src="/web/tanks/'.$coding_tanko['screen'].'">
</td><td style = " width : 125px ; " ><div class="white small sh_b bold mb10"><img src="/images/levels.png" width="14" height="14"> '.$coding_tanko['level'].' уровень<br><img src="/tanks/images/atack.png" width="14" height="14"> '.$coding_tanko['ataka'].' атака<br><img src="/tanks/images/bron.png" width="14" height="14"> '.$coding_tanko['bron'].' броня<br><img src="/tanks/images/toch.png" width="14" height="14"> '.$coding_tanko['toch'].' точность<br><img src="/tanks/images/proch.png" width="14" height="14"> '.$coding_tanko['proch'].' прочность<br><img src="/tanks/images/tank_magaz.png" width="14" height="14"> '.$coding_tanko['type'].'</div></td>
</tr>
</tbody>
</table>'; echo' </div>
</div>
</div></div></div>
</div></div>
</div>';
echo '<div class="trnt-block p5" style="margin-bottom:3px">
<div class="white medium bold cntr">Описание</div>
<div class="white small bold">'.$coding_tanko['opis'].'</div>
<div class="white small bold"><img class="ico vm" src="/tanks/images/icons/silver.png" alt="Серебро" title="Серебро"> Цена: <font color="green">'.rating($cena_tanko).'</font></div>
</div>
';
if ($angar_result<$tanks_code['angars']){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `tanks_angar` WHERE `user` = '".$tanks_code['id_u']."' AND `tank` = '$coding_tanko[id]'"), 0)==0){
if ($coding_tanko['level']<=$tanks_code['level']){
echo'</div><div class="bot"><a class="simple-but border" href="?id='.$coding_tanko['id'].'&ok"><span><span>Купить</span></span></a>';}
}
}
echo'<a class="simple-but gray mb10" href="/store&france"><span><span>Назад к выбору</span></span></a></div>';
include_once'foots.php';
exit;
}else{err_game('Такого танка нет в этой нации');}
}
echo'<center><a class="simple-but green " href="/premtank"><span><span><img width="14" height="14" src="/images/levels.png"><img width="14" height="14" src="/images/levels.png"><img width="14" height="14" src="/images/levels.png"> Премиум танки <img width="14" height="14" src="/images/levels.png"><img width="14" height="14" src="/images/levels.png"><img width="14" height="14" src="/images/levels.png"></span></span></a></center>';
echo'<table style="width:100%;margin-bottom:3px;border-collapse:collapse;border-spacing:0;"><tr>
<td style="width:25%;">
<div style="position:relative;">
<a class="simple-but mb5 gray" w:id="selectGermany" href="store"><span><span>Германия</span></span></a>
</div>
</td>
<td style="width:25%;">
<div style="position:relative;">
<a class="simple-but mb5 gray" w:id="selectUssr" href="store&sssr"><span><span>СССР</span></span></a>
</div>
</td></tr>
<tr>
<td style="width:25%;">
<div style="position:relative;">
<a class="simple-but mb5 gray" w:id="selectUsa" href="store&usa"><span><span>США</span></span></a>
</div>
</td>
<td style="width:25%;">
<div style="position:relative;">
<div class="simple-but mb5 blue" w:id="selectUsa" href="store&france"><span><span>Франция</span></span></div>
</div>
</td>
</tr></table>
';
$tank_1 = mysql_query("SELECT * FROM `tanks_magazin` WHERE `strana`='4' ORDER BY (level+0) asc");
if($_SESSION['style']!='wap.css'){
echo'<table >';}$i = 0;
while($tanks = mysql_fetch_array($tank_1)) {
$i++;
if ($i==1 || $i==3 || $i==5 || $i==7 || $i==9 || $i==11 || $i==13 || $i==15 || $i==17 || $i==19 || $i==21 || $i==23 || $i==25 || $i==27 || $i==29){echo'<tr>';}
echo '<td class="w50"><a href="?id='.$tanks['id'].'"><div class="trnt-block p5" style="margin-bottom:3px">
<div class="small bold cD2 cntr sh_b pb5 pt5">'.$tanks['name'].' , <font color="yellow">'.$tanks['level'].' ур.</font></div><br>
<center>';
echo'<img class="tank-img" style="width:140px; height:140px;" alt="tank" src="/web/tanks/'.$tanks['screen'].'">';
echo'</center></a>';
echo' </div>
</div></div>
</div></div>
</div></td>';
if ($i==2 || $i==4 || $i==6 || $i==8 || $i==10 || $i==12 || $i==14 || $i==16 || $i==18 || $i==20 || $i==22 || $i==24 || $i==26 || $i==28 || $i==30){echo'</tr>';}
}
echo'</tbody></table>';
echo'</div>';
include_once'foots.php';
?>