<?php
session_start();
include_once "inc/db_connect.php";
include_once "inc/fnc.php";
header('Content-Type: text/html;charset=utf8');
$err = "";
if(isset($_POST['regok'])){unset($_SESSION['reg_ok']);}
if(!isset($_SESSION['user'])){
	header("Location: index.php?");
	exit();
}else{
	$data_user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE nick='".$_SESSION['user']."'")) or die(mysql_error());
{
include 'head.php';
if($data_user['dostup']!=1)
{
echo "<img src='/img/dostup.png'>";
include 'foot.php';
exit;
}
echo '<div class="title">Смена должности</div>';
{
if(isset($_POST['ranked']))
{
	$rank = mysql_real_escape_string($_POST['userrank']);
	$userok = mysql_real_escape_string($_POST['usernick']);
	$datemsg = date("H:i:s");
	
mysql_query("UPDATE `users` SET status='".$rank."' WHERE id='".$userok."'");
echo "<div class='inform'><center>Okay,BOSS</center></div>";
}
echo "<div class='inform'>

<center>
<form action='' method='post'>
ID: <br/><input type='text' name='usernick' value='' /><br/>
<select name='userrank'>
<option value='Гонщик'>Гонщик</option>
<option value='VIP'>VIP</option>
<option value='Турнирщик'>Турнирщик</option>
<option value='Помощник'>Помощник</option>
<option value='Модератор'>Модератор</option>
<option value='Админ'>Админ</option>
</select><br>
<input type='submit' name='ranked' class='btn' value='Изменить' />
</form>
</center>
</div>";
}
?>
</div>
</div>
</body>
</html>
<?
}
}
include 'foot.php';
?>