<?
# Автор движка: InstalScript
# vk.com/k.karamin  - Я Вк
# bymas.ru/id3741  - Я на бумасе
# Специально для обитателей bymas.ru
# Ток на бумасе можно найти моды для данного движка
require_once($_SERVER['DOCUMENT_ROOT']."/instalscript/game/inc/function.php");
head("Улучшение танка",$uid); # Голова
$tnk = mysql_fetch_assoc(mysql_query("SELECT * FROM `utank` WHERE `uid` = '".$uid."' AND `id` = '".abs($is['1'])."' "));

$lmp = '30';





function pimp($level){
if($level=="1"){$silver="6";$gold="3";$stat="2";}
if($level=="2"){$silver="12";$gold="6";$stat="4";}
if($level=="3"){$silver="18";$gold="9";$stat="6";}
if($level=="4"){$silver="24";$gold="12";$stat="8";}
if($level=="5"){$silver="30";$gold="15";$stat="10";}
if($level=="6"){$silver="36";$gold="18";$stat="12";}
if($level=="7"){$silver="42";$gold="21";$stat="14";}
if($level=="8"){$silver="48";$gold="24";$stat="16";}
if($level=="9"){$silver="54";$gold="27";$stat="18";}
if($level=="10"){$silver="60";$gold="30";$stat="20";}
if($level=="11"){$silver="66";$gold="33";$stat="22";}
if($level=="12"){$silver="72";$gold="36";$stat="24";}
if($level=="13"){$silver="78";$gold="39";$stat="26";}
if($level=="14"){$silver="84";$gold="42";$stat="28";}
if($level=="15"){$silver="90";$gold="45";$stat="30";}
if($level=="16"){$silver="96";$gold="48";$stat="32";}
if($level=="17"){$silver="102";$gold="51";$stat="34";}
if($level=="18"){$silver="108";$gold="54";$stat="36";}
if($level=="19"){$silver="114";$gold="57";$stat="38";}
if($level=="20"){$silver="120";$gold="60";$stat="40";}
if($level=="21"){$silver="126";$gold="63";$stat="42";}
if($level=="22"){$silver="132";$gold="66";$stat="44";}
if($level=="23"){$silver="138";$gold="69";$stat="46";}
if($level=="24"){$silver="144";$gold="72";$stat="48";}
if($level=="25"){$silver="150";$gold="75";$stat="50";}
if($level=="26"){$silver="156";$gold="78";$stat="52";}
if($level=="27"){$silver="162";$gold="81";$stat="54";}
if($level=="28"){$silver="168";$gold="84";$stat="56";}
if($level=="29"){$silver="174";$gold="87";$stat="58";}
if($level=="30"){$silver="180";$gold="90";$stat="60";}
return "$silver/$gold/$stat";
}









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:
if($tnk == null){
echo "Танк не найден";
}else{


$gun = explode("/",pimp($tnk['gun']));
$gun_silver = $gun['0'];
$gun_gold = $gun['1'];
$gun_stat = $gun['2'];

$frame = explode("/",pimp($tnk['frame']));
$frame_silver = $frame['0'];
$frame_gold = $frame['1'];
$frame_stat = $frame['2'];

$optronics = explode("/",pimp($tnk['optronics']));
$optronics_silver  = $optronics['0'];
$optronics_gold  = $optronics['1'];
$optronics_stat  = $optronics['2'];

$fragshield = explode("/",pimp($tnk['fragshield']));
$fragshield_silver  = $fragshield['0'];
$fragshield_gold  = $fragshield['1'];
$fragshield_stat  = $fragshield['2'];


if($is['2'] == 'gun'){
if($gun_silver <= $user['silver'] && $gun_gold <= $user['gold']){
mysql_query("UPDATE `utank` SET `gun` = `gun` + '1',`ha` = `ha` + '".$gun_stat."'  WHERE `id` = '".$tnk['id']."' ");
mysql_query("UPDATE `users` SET `gold` = `gold` - '".$gun_gold."',`silver` = `silver` - '".$gun_silver."' WHERE `id` = '".$uid."' ");
}else{logi("Нехватает средств");}
header("Location:/pimp/".$tnk['id']."/");
exit();
}

if($is['2'] == 'frame' && $tnk['frame'] < $lmp){
if($frame_silver <= $user['silver'] && $frame_gold <= $user['gold']){
mysql_query("UPDATE `utank` SET `frame` = `frame` + '1',`ho` = `ho` + '".$frame_stat."'  WHERE `id` = '".$tnk['id']."' ");
mysql_query("UPDATE `users` SET `gold` = `gold` - '".$frame_gold."',`silver` = `silver` - '".$frame_silver."' WHERE `id` = '".$uid."' ");
}else{logi("Нехватает средств");}
header("Location:/pimp/".$tnk['id']."/");
exit();
}

if($is['2'] == 'optronics' && $tnk['optronics'] < $lmp){
if($optronics_silver <= $user['silver'] && $optronics_gold <= $user['gold']){
mysql_query("UPDATE `utank` SET `optronics` = `optronics` + '1',`hc` = `hc` + '".$optronics_stat."'  WHERE `id` = '".$tnk['id']."' ");
mysql_query("UPDATE `users` SET `gold` = `gold` - '".$optronics_gold."',`silver` = `silver` - '".$optronics_silver."' WHERE `id` = '".$uid."' ");
}else{logi("Нехватает средств");}
header("Location:/pimp/".$tnk['id']."/");
exit();
}

if($is['2'] == 'fragshield' && $tnk['fragshield'] < $lmp){
if($fragshield_silver <= $user['silver'] && $fragshield_gold <= $user['gold']){
mysql_query("UPDATE `utank` SET `fragshield` = `fragshield` + '1',`hb` = `hb` + '".$fragshield_stat."'  WHERE `id` = '".$tnk['id']."' ");
mysql_query("UPDATE `users` SET `gold` = `gold` - '".$fragshield_gold."',`silver` = `silver` - '".$fragshield_silver."' WHERE `id` = '".$uid."' ");
}else{logi("Нехватает средств");}
header("Location:/pimp/".$tnk['id']."/");
exit();
}



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

echo "<table>";
echo "
<td>
<img src = '/instalscript/images/icons/damage.jpg'>Урон <span class = 'green2'>".$tnk['ha']."</span><br>
<img src = '/instalscript/images/icons/armor.jpg'>Броня <span class = 'green2'>".$tnk['hb']."</span><br>
<img src = '/instalscript/images/icons/durability.jpg'>Прочность <span class = 'green2'>".$tnk['ho']."</span><br>
<img src = '/instalscript/images/icons/accuracy.jpg'>Точность <span class = 'green2'>".$tnk['hc']."</span><br>
</td>
";

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

echo "
<div w:id='modules'>


<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'>
<div class = 'mb5 inbl'>
<div class = 'thumb fl'><img src = '/instalscript/images/pimp/Gun.jpg' alt = 'Орудие' title = 'Орудие'><span class = 'mask2'>&nbsp;</span></div>
<div class = 'ml58 small white sh_b bold'>
<span class = 'green2'>Орудие</span><br>
Атака: ".$tnk['ha']."";
if($tnk['gun'] < $lmp){
echo "<span class = 'green1'>+".$gun_stat."</span><br>";
}
echo "</div>
<div class = 'clrb'></div>
</div>

<div class = 'bot'>";

if($tnk['gun'] < $lmp){
echo "<a class = 'simple-but border mb5' href = '/pimp/".$tnk['id']."/gun/'>
<span><span>
Улучшить за";
if($gun_silver > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/silver.png' alt = 'Серебро' title = 'Серебро'> ".$gun_silver." ";}
if($gun_gold > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/gold.png' alt = 'Золото' title = 'Золото'> ".$gun_gold." ";}
echo "</span></span></a>";
}
else{
echo "<span class = 'simple-but border'><span><span>Модуль улучшен</span></span></span>";
}










echo "
</div>

</div>
</div></div></div></div></div></div></div></div>
</div>



<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'>
<div class = 'mb5 inbl'>
<div class = 'thumb fl'><img src = '/instalscript/images/pimp/Frame.jpg' alt = 'Корпус' title = 'Корпус'><span class = 'mask2'>&nbsp;</span></div>
<div class = 'ml58 small white sh_b bold'>
<span class = 'green2'>Корпус</span><br>
Прочность: ".$tnk['ho']."";
if($tnk['frame'] < $lmp){echo "<span class = 'green1'>+".$frame_stat."</span><br>";}
echo "</div>
<div class = 'clrb'></div>
</div>

<div class = 'bot'>";


if($tnk['frame'] < $lmp){
echo "<a class = 'simple-but border mb5' href = '/pimp/".$tnk['id']."/frame/'>
<span><span>
Улучшить за";
if($frame_silver > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/silver.png' alt = 'Серебро' title = 'Серебро'> ".$frame_silver."";}
if($frame_gold > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/gold.png' alt = 'Золото' title = 'Золото'> ".$frame_gold."";}
echo "</span></span></a>";
}
else{
echo "<span class = 'simple-but border'><span><span>Модуль улучшен</span></span></span>";
}

echo "
</div>

</div>
</div></div></div></div></div></div></div></div>
</div>



<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'>
<div class = 'mb5 inbl'>
<div class = 'thumb fl'><img src = '/instalscript/images/pimp/Optronics.jpg' alt = 'Оптика' title = 'Оптика'><span class = 'mask2'>&nbsp;</span></div>
<div class = 'ml58 small white sh_b bold'>
<span class = 'green2'>Оптика</span><br>
Точность: ".$tnk['hc']."";
if($tnk['optronics'] < $lmp){echo "<span class = 'green1'>+".$optronics_stat."</span><br>";}
echo "</div>
<div class = 'clrb'></div>
</div>

<div class = 'bot'>
";

if($tnk['optronics'] < $lmp){
echo "<a class = 'simple-but border mb5' href = '/pimp/".$tnk['id']."/optronics/'><span><span>Улучшить за";
if($optronics_silver > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/silver.png' alt = 'Серебро' title = 'Серебро'> ".$optronics_silver."";}
if($optronics_gold > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/gold.png' alt = 'Золото' title = 'Золото'> ".$optronics_gold."";}
echo "</span></span></a>";
}
else{
echo "<span class = 'simple-but border'><span><span>Модуль улучшен</span></span></span>";
}


echo "
</div>

</div>
</div></div></div></div></div></div></div></div>
</div>



<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'>
<div class = 'mb5 inbl'>
<div class = 'thumb fl'><img src = '/instalscript/images/pimp/FragShield.jpg' alt = 'Противоосколочный подбой' title = 'Противоосколочный подбой'><span class = 'mask2'>&nbsp;</span></div>
<div class = 'ml58 small white sh_b bold'>
<span class = 'green2'>Противоосколочный подбой</span><br>
Броня: ".$tnk['hb']."";
if($tnk['fragshield'] < $lmp){echo "<span class = 'green1'>+".$fragshield_stat."</span><br>";}
echo "
</div>
<div class = 'clrb'></div>
</div>

<div class = 'bot'>";


if($tnk['fragshield'] < $lmp){
echo "<a class = 'simple-but border mb5' href = '/pimp/".$tnk['id']."/fragshield/'>
<span><span>
Улучшить за";
if($frame_silver > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/silver.png' alt = 'Серебро' title = 'Серебро'> ".$fragshield_silver."";}
if($frame_gold > '0'){echo "<img class = 'ico vm' src = '/instalscript/images/icons/gold.png' alt = 'Золото' title = 'Золото'> ".$fragshield_gold."";}
echo "</span></span></a>";
}
else{
echo "<span class = 'simple-but border'><span><span>Модуль улучшен</span></span></span>";
}


echo "
</div>

</div>
</div></div></div></div></div></div></div></div>
</div>


</div>
";


echo "<div class = 'bot'><a class = 'simple-but gray mb5' href = '/angar/'><span><span>Вернуться в ангар</span></span></a></div>";

}



break;
}
echo "
</div>
</div></div></div></div></div></div></div></div>
</div>
";
foot($uid); # Ноги

?>