<?
require_once '../core/system.php';
echo only_reg();
$header = 'Покупка Аватара!';
require_once H.'core/head.php';
if(isset($_GET['id'])) {
if($user[gold] < 50){
header('Location: ?');
$_SESSION['err'] = 'Нужно больше золота!';
exit();
}else{
mysql_query("UPDATE `user` SET `avatar` = '".$_GET['id']."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `gold` = '".($user['gold']-50)."' WHERE `id` = '$user[id]' LIMIT 1");
header('Location: ?');
$_SESSION['message'] = 'Аватарка установлена!';
exit();
}
}
//Первый
echo "<div class='player menuList'>";
echo "<li><a href='?id=1'><img src='/images/icon/arrow.png'>Купить Аватар <img src='/images/icon/gold.png'>50</a></li>";
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player'>";
echo "<img src='/style/avatar/".($user['pol'] == 0 ? "zj" : "m")."/1.png' width='120' height='160' alt=''/>";
echo "</div>";
//Второй
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='?id=2'><img src='/images/icon/arrow.png'>Купить Аватар <img src='/images/icon/gold.png'>50</a></li>";
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player'>";
echo "<img src='/style/avatar/".($user['pol'] == 0 ? "zj" : "m")."/2.png' width='120' height='160' alt=''/>";
echo "</div>";
//Третий
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='?id=3'><img src='/images/icon/arrow.png'>Купить Аватар <img src='/images/icon/gold.png'>50</a></li>";
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player'>";
echo "<img src='/style/avatar/".($user['pol'] == 0 ? "zj" : "m")."/3.png' width='120' height='160' alt=''/>";
echo "</div>";

//Четвертый
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='?id=4'><img src='/images/icon/arrow.png'>Купить Аватар <img src='/images/icon/gold.png'>50</a></li>";
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player'>";
echo "<img src='/style/avatar/".($user['pol'] == 0 ? "zj" : "m")."/4.png' width='120' height='160' alt=''/>";
echo "</div>";

echo "</div>";

//Четвертый
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='?id=5'><img src='/images/icon/arrow.png'>Купить Аватар <img src='/images/icon/gold.png'>50</a></li>";
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player'>";
echo "<img src='/style/avatar/".($user['pol'] == 0 ? "zj" : "m")."/5.png' width='120' height='160' alt=''/>";
echo "</div>";
require_once H.'core/foot.php';
?>