<?php
include_once "./#sys/bd.php";
//


// Проверка модуля
if(isset($_GET['l']))
{
$l=ft_nic($_GET['l']);
}else{
$l='main';
}

// авторизация
include_once SYS."/aut.php";
if (!$user)$l='main';
if($user['fight']>0) // Привязка к бою
{
$check_f=mysql_fetch_array(mysql_query("SELECT * FROM `fight` WHERE `id`='$user[fight]' LIMIT 1"),MYSQL_ASSOC);
  if($check_f)
  {
  header("Location: pv$check_f[fighttype].php"); exit;  
  }
}
//  Загрузка страниц
if(file_exists(H."/#page/".$l.".php") and is_file(H."/#page/".$l.".php"))
{
$inc_files=H."/#page/".$l.".php";
include_once $inc_files;
}else{
$l='main';
include_once H."/#page/main.php";
}

//
/*/
// DEBUG
#heads($headers_page, $set_ob_start);   //подключение шапки
echo "Массив _SESSION[]:<br />";
foreach ($_SESSION as $key => $value)
{
echo ($key." = ".$value." <br />");
}


echo "\$_SERVER['QUERY_STRING']:<br />";
echo "$_SERVER[QUERY_STRING]";
echo "Массив \$_GET[]:<br />";
foreach ($_GET as $key => $value)
{
echo ($key." = ".$value." <br />");
}

echo "Массив \$user[]:<br />";
if(is_array($user))
{
  foreach ($user as $key => $value)
  {
  echo ($key." = ".$value." <br />");
  }
}

echo "Массив \$_COOKIE:<br />";
if(is_array($_COOKIE))
{
  foreach ($_COOKIE as $key => $value)
  {
  echo ($key." = ".$value." <br />");
  }
}
// END DEBUG
/*/
if($user){  //`emission`='$jump[emission]',
if(isset($locat['emission']) and $locat){$n_em=intval($locat['emission']);}else{$n_em=intval($user['emission']);} 
mysql_query("UPDATE `user` SET `energy`='$user[energy]', `live`='$user[live]', `emission`='$n_em', `exp`='$user[exp]', `uptime`='$s_time' WHERE `id`='$user[id]' LIMIT 1"); //*
}
closed_page($headers_page,$set_ob_start);  //ноги
?>
