<?php

require_once('conf/dbc.php');
require_once('conf/session_start.php');
require_once('conf/ban.php');
if ((!isset($_SESSION['id'])) or (!isset($_SESSION['nick'])))  {
?>
<script type="text/javascript">
  document.location.href = "login.php";
</script>
<?php
}
$user_id=abs(intval($_SESSION['id']));
$user=$dbc->query("SELECT * FROM `users` WHERE`id`='$user_id' LIMIT 1")->fetch_assoc();
switch($_GET[l]){
default:
header('location: zonas.php');
break;
case '1':
if($user['zonas']>=1) {
header('location: zonas.php');
}else{
$dbc->query("UPDATE `users` SET  `zonas_loc` = 'baza'  WHERE `id` ='".$user_id."' LIMIT 1");
header('location: zonas.php');
exit();}
break;
case '2':
if($user['zonas']>=1) {
header('location: zonas.php');
}else{
$dbc->query("UPDATE `users` SET  `zonas_loc` = 'shevchenkovo'  WHERE `id` ='".$user_id."' LIMIT 1");
header('location: zonas.php');
exit();}
break;
case '3':
if($user['zonas']>=1) {
header('location: zonas.php');
}else{
$dbc->query("UPDATE `users` SET `zonas_loc` = 'hutor'  WHERE `id` ='".$user_id."' LIMIT 1");
header('location: zonas.php');
exit();}
break;
case '4':
if($user['zonas']>=1) {
header('location: zonas.php');
}else{
$dbc->query("UPDATE `users` SET  `zonas_loc` = 'zemsnaryad'  WHERE `id` ='".$user_id."' LIMIT 1");
header('location: zonas.php');
exit();}
break;
case '5':
if($user['zonas']>=1) {
header('location: zonas.php');
}else{
$dbc->query("UPDATE `users` SET  `zonas_loc` = 'port_kran'  WHERE `id` ='".$user_id."' LIMIT 1");
header('location: zonas.php');
exit();}
break;
case '6':
if($user['zonas']>=1) {
header('location: zonas.php');
}else{
$dbc->query("UPDATE `users` SET  `zonas_loc` = 'izumrudnoe'  WHERE `id` ='".$user_id."' LIMIT 1");
header('location: zonas.php');
exit();}
break;
}
  ?>