<?
# Автор движка: InstalScript
# vk.com/k.karamin  - Я Вк
# bymas.ru/id3741  - Я на бумасе
# Специально для обитателей bymas.ru
# Ток на бумасе можно найти моды для данного движка

require_once($_SERVER['DOCUMENT_ROOT']."/instalscript/game/inc/function.php");
head("Ангар",$uid);

echo "
<div class = 'trnt-block'>
<div class = 'wrap1'><div class = 'wrap2'><div class = 'wrap3'><div class = 'wrap4'><div class = 'wrap5'><div class = 'wrap6'><div class = 'wrap7'><div class = 'wrap8'>
<div class = 'wrap-content'>
";


echo logs();
logn();

switch($is['1']){
default:
echo "<table>
<tbody><tr>";

$mytank = mysql_fetch_assoc(mysql_query("SELECT * FROM `tank` WHERE `id` = '".$tid."' "));
if($mytank != null){
echo "<td class = 'small white bold sh_b w100'>";
echo "
Уровень <span class = 'green2'>".$mytank['level']."</span><br>
Тип <span class = 'green2'>".ttype($mytank['type'])."</span><br>
Страна <span class = 'green2'><img src = '".country($mytank['country'],'img')."'>".country($mytank['country'],'text')."</span><br>
<img src = '/instalscript/images/icons/damage.jpg'>Урон <span class = 'green2'>".$my_tank['ha']."</span><br>
<img src = '/instalscript/images/icons/armor.jpg'>Броня <span class = 'green2'>".$my_tank['hb']."</span><br>
<img src = '/instalscript/images/icons/durability.jpg'>Прочность <span class = 'green2'>".$my_tank['ho']."</span><br>
<img src = '/instalscript/images/icons/accuracy.jpg'>Точность <span class = 'green2'>".$my_tank['hc']."</span><br>";
echo "</td>";
}

echo "
<td class = 'ta_r cntr'>
<a class = 'inbl thumb' href = '/profile/'>
<img alt='avatar' w:id='avatarImage' src = '/instalscript/images/avatars/".$user['ava']."'>
<span class = 'mask1'>&nbsp;</span></a>
";

echo "<div class = 'clrb'></div>";
echo "<a class = 'lh1 blck small sh_b' href = '/profile/'>профиль";
if($msg_new != null){echo "<span class = 'plus'>+</span>";}
echo "</a>";
echo "</td>";
echo "</tr>";
echo "</tbody></table>";


if($mytank != null){
echo "<div class = 'cntr'><img class = 'tank-img' src = '/tankimage_".$my_tank['tid']."_1.jpg'></div>";
if($user['fuel'] >= '30'){
echo "<div class = 'mt5 mb5 small green1 cntr'>Готов к бою</div>";
}else{
echo "<div class = 'mt5 mb5 small red1 cntr'>Недостаточно топлива</div>";
}
}else{echo "У вас нет выбранного танка";}

echo "<div class = 'cntr mb5'>";

# ocenka($tid);
# echo "<img src = '/instalscript/images/icons/starEmpty.png' height='14' width='14'>";



echo "</div>";
echo "<div class = 'bot'>";
if($my_tank != null){
echo "
<table>
<tbody><tr>
<td colspan='3'><a class = 'simple-but border mb2' href = '/modification/".$my_tank['id']."/'><span><span>Модификация</span></span></a></td>
</tr>
<tr>
<td class = 'w50 pr1'><a class = 'simple-but border' href = '/pimp/".$my_tank['id']."/'><span><span>Улучшение</span></span></a></td>
<td class = 'w50 pl1'><a class = 'simple-but border' href = '/upgrade/".$my_tank['id']."/'><span><span>Апгрейд</span></span></a></td>
<td class = 'w50 pl1'><a class = 'simple-but border' href = '/angar/tank/'><span><span>Мои танки</span></span></a></td>
</tr>
</tbody></table>
";
}else{
echo "<table>";
echo "<td class = 'w50 pl1'><a class = 'simple-but border' href = '/newstore/'><span><span>Купить танк</span></span></a></td>";
echo "<td class = 'w50 pl1'><a class = 'simple-but border' href = '/angar/tank/'><span><span>Мои танки</span></span></a></td>";
echo "</table>";
}

echo "</div>";

echo "
</div>
</div></div></div></div></div></div></div></div>
</div>
";


echo "
<span w:id='navigation'>
<div class = 'brunches-block'>
<table>
<tbody><tr>";

echo "<td><a href = '/payments/'><span class = 'image'><img src = '/instalscript/images/icons/payment.jpg' alt='image'><span class = 'mask'>&nbsp;</span>";
if($user['silver'] > '100'){echo "<span class = 'digit'><span class = 'l'>&nbsp;</span><span class = 'm'>+</span><span class = 'r'>&nbsp;</span>";}
echo "</span></span>Золото</a></td>";


echo "<td><a href = '/missions/'><span class = 'image'><img src = '/instalscript/images/icons/missions.jpg'><span class = 'mask'>&nbsp;</span>"./*<span class = 'digit'><span class = 'l'>&nbsp;</span><span class = 'm'>+</span><span class = 'r'>&nbsp;</span></span>*/"</span>Миссии</a></td>";
echo "<td><a href = '/battle/pvp/'><span class = 'image'><img src = '/instalscript/images/icons/pvp.jpg' alt='image'><span class = 'mask'>&nbsp;</span></span>Битвы</a></td>";
echo "<td><a href = '/battle/pve/'><span class = 'image'><img src = '/instalscript/images/icons/pve.jpg' alt='image'><span class = 'mask'>&nbsp;</span></span>Сражения</a></td>";

echo "</tr><tr>";
echo "<td><a href = '/magazine/'><span class = 'image'><img src = '/instalscript/images/icons/magazine.jpg' alt='image'><span class = 'mask'>&nbsp;</span></span>Амуниция</a></td>";
echo "<td><a href = '/rating/'><span class = 'image'><img src = '/instalscript/images/icons/rating.jpg' alt='image'><span class = 'mask'>&nbsp;</span></span>Рейтинг</a></td>";

echo "<td><a href = '/cw/'><span class = 'image'><img src = '/instalscript/images/icons/cw.png' alt='image'><span class = 'mask'>&nbsp;</span>"./*<span class = 'digit'><span class = 'l'>&nbsp;</span><span class = 'm'>+</span><span class = 'r'>&nbsp;</span></span>*/"</span>Война</a></td>";
echo "<td><a href = '/newstore/'><span class = 'image'><img src = '/instalscript/images/icons/tanksmagazine.jpg' alt='image'><span class = 'mask'>&nbsp;</span></span>Танки</a></td>";

echo "</tr>
</tbody></table>";
break;
case 'amunition':

break;
case 'tank':

$count = mysql_result(mysql_query("SELECT COUNT(*) FROM  `utank` WHERE `uid` = '".$uid."' AND `act` = '0' "),0);
$str = '5'; # кол-во записей для вывода
$url = "/angar/tank"; # ссылка
$num = abs($is['2']); # текущая страница
$result = $count; # подсчёт

$q = mysql_query("SELECT * FROM `utank` WHERE `uid` = '".$uid."' AND `act` = '0' ORDER BY `time` DESC LIMIT ".page($num,$str,$result).",$str  "); # or die(mysql_error());
echo "<div class = 'ta_l'>";
while($a = mysql_fetch_assoc($q)){
echo "<a class = 'simple-but border mb1' href = '/angar/tank-info/".$a['id']."/'><span ><span style = 'text-align: left;'><img src = '".country(tank($a['tid'],'country'),'img')."'> ".tank($a['tid'],'name')."</span></span></a>";
}
echo "</div>";
if($result == '0'){echo "Танков нет!";}
ppage($url,$num,$str,$result);
echo "<div class = 'bot'><a class = 'simple-but border mb2' href = '/angar/'><span><span>Вернуться в ангар</span></span></a></span></div>";




break;
case 'tank-info':
$tnk = mysql_fetch_assoc(mysql_query("SELECT * FROM `utank` WHERE `id` = '".abs($is['2'])."' AND `uid` = '".$uid."' "));
if($tnk == null){echo "Нечего не найдено!";}else{
$tnk_act = mysql_fetch_assoc(mysql_query("SELECT * FROM `utank` WHERE `uid` = '".$uid."' AND `act` = '1' "));


if($is['3'] == 'sid'){
if($tnk_act != null){
mysql_query("UPDATE `utank` SET `act` = '0'  WHERE `id` = '".$tnk_act['id']."' ");
}
if($tnk_act['id'] != $tnk['id']){
mysql_query("UPDATE `utank` SET `act` = '1'  WHERE `id` = '".$tnk['id']."' ");
}

header("Location:/angar/tank-info/".$tnk['id']."/");
exit();
}


echo "
<table>
<tbody><tr>
<td class = 'small white bold sh_b w100'>
";
echo "
Уровень <span class = 'green2'>".tank($tnk['tid'],'level')."</span><br>
Тип <span class = 'green2'>".ttype(tank($tnk['tid'],'type'))."</span><br>
Страна <span class = 'green2'><img src = '".country(tank($tnk['tid'],'country'),'img')."'>".country(tank($tnk['tid'],'country'),'text')."</span><br>
<img src = '/instalscript/images/icons/damage.jpg'>Урон <span class = 'green2'>".tank($tnk['id'],'ha')."</span><br>
<img src = '/instalscript/images/icons/armor.jpg'>Броня <span class = 'green2'>".tank($tnk['id'],'hb')."</span><br>
<img src = '/instalscript/images/icons/durability.jpg'>Прочность <span class = 'green2'>".tank($tnk['id'],'ho')."</span><br>
<img src = '/instalscript/images/icons/accuracy.jpg'>Точность <span class = 'green2'>".tank($tnk['id'],'hc')."</span><br>




</tr>
</tbody></table>

<div class = 'cntr'>
<img class = 'tank-img' src = '/tankimage_".$tnk['tid']."_3.jpg'>
</div>";



echo "<div class = 'cntr mb5'>";


# ocenka($tnk['id']);



echo "</div>";
echo "<div class = 'bot'>";
echo "
<table>
<tbody>
<tr><td colspan = '2'><a class = 'simple-but border mb2' href = '/modification/".$tnk['id']."/'><span><span>Модификация</span></span></a></td></tr>
<tr>
<td class = 'w50 pr1'><a class = 'simple-but border' href = '/pimp/".$tnk['id']."/'><span><span>Улучшение</span></span></a></td>
<td class = 'w50 pl1'><a class = 'simple-but border' href = '/upgrade/".$tnk['id']."/'><span><span>Апгрейд</span></span></a></td>
</tr>
</tbody></table>
";

echo "</div>";

echo "
</div>
</div></div></div></div></div></div></div></div>
</div>



";

}

# echo "<span class = 'bot'>";
if($tnk_act['id'] != $tnk['id']){
echo "<a class = 'simple-but border mb2' href = '/angar/tank-info/".$tnk['id']."/sid/'><span><span>Выбрать</span></span></a></span>";
}else{
echo "<a class = 'simple-but border mb2' href = '/angar/tank-info/".$tnk['id']."/sid/'><span><span>Оставить</span></span></a></span>";
}

echo "<a class = 'simple-but border mb2' href = '/angar/tank/'><span><span>Вернуться к списку</span></span></a></span>";
# echo "</span>";
break;


}

echo "
</div>
</div></div></div></div></div></div></div></div>
</div>
";


foot($uid);

?>