<?php
require_once ('system/func.php');

require_once ('system/header.php');
auth();
access(2);
?>

<?
$id = num($_GET['id']);
$q = mysql_query("SELECT * FROM `users` WHERE `id` = ".intval($id)." LIMIT 1");$userACCESS = mysql_fetch_array($q);
if($userACCESS) {
echo "<font color='red'>Логин</font> : $userACCESS[login] <br>";
if($userACCESS[access] ==1) {
echo "<font color='lime'> Права : </font> Модератор";
}

if($userACCESS[access] ==3) {
echo "<font color='lime'> Права : </font> Старший модератор";
}
if($userACCESS[access] ==0) {
echo "<font color='lime'> Права : </font> Игрок ";
}
echo "<br><font color='green'>Золото </font>$userACCESS[gold]";
echo "<br><font color='orange'>Алмазы </font> : $userACCESS[almaz]";


}else{
echo "Такого игрока нет";
}
?>


<div id="pokazat">
<div class="block_zero center" style="padding-top:15px;"><div class="bigBtn"><a class="btn" href="#" onClick="document.getElementById('pokazat').style.display='none';document.getElementById('skryt').style.display='';return false;">

<span class="end"><span class="label"><span class="btn_grey">Изменить права</span></span></span></a></div></div>
</div>


<div id="skryt" style="display:none">
<div class="block_zero center" style="padding-top:15px;"><div class="bigBtn"><a class="btn" href="#" onClick="document.getElementById('skryt').style.display='none';document.getElementById('pokazat').style.display='';return false;">
<span class="end"><span class="label"><span class="btn_grey">Скрыть</span></span></span></a></div>
<p><div class='fight center'>

<a class='main_link center' href='?adm=1' size=1px>Модератор</a></center>
<br>




<a class='main_link center' href='?adm=2' size=1px>Старший модератор</a>
<br>

<a class='main_link center' href='?adm=3' size=1px>Игрок</a>

</form></div>






</div>
</p>
</div>
<?

if($_GET[adm]==1){
mysql_query("UPDATE `users` SET `access` = '1' WHERE `id` = ".$userACCESS['id']."");
header('location:?');
}
?>
<?

if($_GET[adm]==2){
mysql_query("UPDATE `users` SET `access` = '3' WHERE `id` = ".$userACCESS['id']."");
header('location:?');
}
?>
<?

if($_GET[adm]==3){
mysql_query("UPDATE `users` SET `access` = 0 WHERE `id` = ".$userACCESS['id']."");
header('location:?');
}
?>
<?
include './system/footer.php';
?>
