Файл: magazin/koni.php
Строк: 284
<?
require_once '../core/system.php';
echo only_reg();
$cenakon = 200;
$cenakon2 = 500;
$cenakon3 = 1000;
$cenakon4 = 1500;
$cenakon5 = 2000;
$cenakon6 = 2500;
$param = $user[sila] + $user[max_health] + $user[lovk] + $user[zashit];
$header = 'Покупка Скакуна';
require_once '../core/head.php';
switch($act) {
case 'kon':
if($user[idkon] < 1){
if($user[gold] < $cenakon){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-$cenakon)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `avakon` = '".($user['avakon']=1)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `idkon` = '".($user['idkon']=1)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `speed` = '".($user['speed']=110)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `vinos` = '".($user['vinos']=110)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `sila` = '".($user['sila']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_health` = '".($user['max_health']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `lovk` = '".($user['lovk']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `zashit` = '".($user['zashit']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_mana` = '".($user['max_mana']+20)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Вы Успешно приобрели скакуна !';
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'У вас уже есть такой скакун';
exit();
}
break;
case 'kon2':
if($user[idkon] < 2){
if($user[gold] < $cenakon2){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-$cenakon2)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `avakon` = '".($user['avakon']=2)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `idkon` = '".($user['idkon']=2)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `speed` = '".($user['speed']=265)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `vinos` = '".($user['vinos']=265)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `sila` = '".($user['sila']+120)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_health` = '".($user['max_health']+120)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `lovk` = '".($user['lovk']+120)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `zashit` = '".($user['zashit']+120)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_mana` = '".($user['max_mana']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Вы Успешно приобрели скакуна !';
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'У вас уже есть такой скакун';
exit();
}
break;
case 'kon3':
if($user[idkon] < 3){
if($user[gold] < $cenakon3){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-$cenakon3)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `avakon` = '".($user['avakon']=3)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `idkon` = '".($user['idkon']=3)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `speed` = '".($user['speed']=495)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `vinos` = '".($user['vinos']=495)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `sila` = '".($user['sila']+230)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_health` = '".($user['max_health']+230)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `lovk` = '".($user['lovk']+230)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `zashit` = '".($user['zashit']+230)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_mana` = '".($user['max_mana']+70)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Вы Успешно приобрели скакуна !';
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'У вас уже есть такой скакун';
exit();
}
break;
case 'kon4':
if($user[idkon] < 4){
if($user[gold] < $cenakon4){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-$cenakon4)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `avakon` = '".($user['avakon']=4)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `idkon` = '".($user['idkon']=4)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `speed` = '".($user['speed']=610)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `vinos` = '".($user['vinos']=610)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `sila` = '".($user['sila']+300)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_health` = '".($user['max_health']+300)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `lovk` = '".($user['lovk']+300)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `zashit` = '".($user['zashit']+300)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_mana` = '".($user['max_mana']+120)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Вы Успешно приобрели скакуна !';
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'У вас уже есть такой скакун';
exit();
}
break;
case 'kon5':
if($user[idkon] < 5){
if($user[gold] < $cenakon5){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-$cenakon5)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `avakon` = '".($user['avakon']=5)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `idkon` = '".($user['idkon']=5)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `speed` = '".($user['speed']=885)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `vinos` = '".($user['vinos']=885)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `sila` = '".($user['sila']+400)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_health` = '".($user['max_health']+400)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `lovk` = '".($user['lovk']+400)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `zashit` = '".($user['zashit']+400)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_mana` = '".($user['max_mana']+170)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Вы Успешно приобрели скакуна !';
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'У вас уже есть такой скакун';
exit();
}
break;
case 'kon6':
if($user[idkon] < 6){
if($user[gold] < $cenakon6){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-$cenakon6)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `avakon` = '".($user['avakon']=6)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `idkon` = '".($user['idkon']=6)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `speed` = '".($user['speed']=1135)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `vinos` = '".($user['vinos']=1135)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `sila` = '".($user['sila']+500)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_health` = '".($user['max_health']+500)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `lovk` = '".($user['lovk']+500)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `zashit` = '".($user['zashit']+500)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `max_mana` = '".($user['max_mana']+270)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Вы Успешно приобрели скакуна !';
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'У вас уже есть такой скакун';
exit();
}
break;
break;
default;
/////
echo "<div class='player'>";
echo "<p><img src='/style/koni/1.png ' width='80' height='100' alt=''/align='left'>
<b> <font color=white> Славный Жеребец</font> </b>
<br/ >
<img src='/images/icon/str.png' alt='str'/> Скорость: <font color=#a0ffff > 110</font> <br/ >
<img src='/images/icon/vit.png' alt='str'/> Выносливость: <font color=#a0ffff > 110</font> <br/ ><br/ >
<a class='btn' href='?act=kon'><span class='end'><span class='label'> Купить скакуна за <img src='/images/icon/gold.png'><font color=#ffc040> $cenakon </font></span></span></a></p>";
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<br>";
/////////
/////
echo "<div class='player'>";
echo "<p><img src='/style/koni/2.png ' width='80' height='100' alt=''/align='left'>
<b> <font color=white> Арабский Скакун</font> </b>
<br/ >
<img src='/images/icon/str.png' alt='str'/> Скорость: <font color=#a0ffff > 265</font> <br/ >
<img src='/images/icon/vit.png' alt='str'/> Выносливость: <font color=#a0ffff > 265</font> <br/ ><br/ >
<a class='btn' href='?act=kon2'><span class='end'><span class='label'> Купить скакуна за <img src='/images/icon/gold.png'><font color=#ffc040> $cenakon2 </font></span></span></a></p>";
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<br>";
/////////
/////
echo "<div class='player'>";
echo "<p><img src='/style/koni/3.png ' width='80' height='100' alt=''/align='left'>
<b> <font color=white> Белый Топот</font> </b>
<br/ >
<img src='/images/icon/str.png' alt='str'/> Скорость: <font color=#a0ffff > 495</font> <br/ >
<img src='/images/icon/vit.png' alt='str'/> Выносливость: <font color=#a0ffff > 495</font> <br/ ><br/ >
<a class='btn' href='?act=kon3'><span class='end'><span class='label'> Купить скакуна за <img src='/images/icon/gold.png'><font color=#ffc040> $cenakon3 </font></span></span></a></p>";
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<br>";
/////////
/////
echo "<div class='player'>";
echo "<p><img src='/style/koni/4.png ' width='80' height='100' alt=''/align='left'>
<b> <font color=white> Единорогий</font> </b>
<br/ >
<img src='/images/icon/str.png' alt='str'/> Скорость: <font color=#a0ffff > 610</font> <br/ >
<img src='/images/icon/vit.png' alt='str'/> Выносливость: <font color=#a0ffff > 610</font> <br/ ><br/ >
<a class='btn' href='?act=kon4'><span class='end'><span class='label'> Купить скакуна за <img src='/images/icon/gold.png'><font color=#ffc040> $cenakon4 </font></span></span></a></p>";
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<br>";
/////////
/////
echo "<div class='player'>";
echo "<p><img src='/style/koni/5.png ' width='80' height='100' alt=''/align='left'>
<b> <font color=white> Скакун Рыцаря</font> </b>
<br/ >
<img src='/images/icon/str.png' alt='str'/> Скорость: <font color=#a0ffff > 885</font> <br/ >
<img src='/images/icon/vit.png' alt='str'/> Выносливость: <font color=#a0ffff > 885</font> <br/ ><br/ >
<a class='btn' href='?act=kon5'><span class='end'><span class='label'> Купить скакуна за <img src='/images/icon/gold.png'><font color=#ffc040> $cenakon5 </font></span></span></a></p>";
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<br>";
/////////
/////
echo "<div class='player'>";
echo "<p><img src='/style/koni/6.png ' width='80' height='100' alt=''/align='left'>
<b> <font color=white> Конь Титана</font> </b>
<br/ >
<img src='/images/icon/str.png' alt='str'/> Скорость: <font color=#a0ffff > 1135</font> <br/ >
<img src='/images/icon/vit.png' alt='str'/> Выносливость: <font color=#a0ffff > 1135</font> <br/ ><br/ >
<a class='btn' href='?act=kon6'><span class='end'><span class='label'> Купить скакуна за <img src='/images/icon/gold.png'><font color=#ffc040> $cenakon6 </font></span></span></a></p>";
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<br>";
/////////
echo "</div>";
echo "<div class='dot-line'></div>";
echo "<div class='player'><img src='/images/icon/str.png'> Ваши параметры: $param <br/></div>";
}
require_once '../core/foot.php';
?>