<?php 
$location = true; 
require_once($_SERVER['DOCUMENT_ROOT']."/core/func.php"); 
head("Таверна",$uid);  
//
//
$go = number($_GET['go']);
//
//
if($go == 1 && $tavern['id_quest'] == 1){
qry("UPDATE `users` SET `metal` = `metal` + ?, `tkan` = `tkan` + ?  WHERE `id` = ? LIMIT 1", array(10,10,$uid)); 
qry("UPDATE `tavern` SET `level` = ?  WHERE `id_user` = ? LIMIT 1", array(2,$uid)); 
header('location:?');
exit();
}
//
//
if($go == 2 && $tavern['id_quest'] == 2){
qry("UPDATE `users` SET `kamen` = `kamen` + ?  WHERE `id` = ? LIMIT 1", array(5,$uid)); 
qry("UPDATE `tavern` SET `level` = ?  WHERE `id_user` = ? LIMIT 1", array(3,$uid)); 
header('location:?');
exit();
}
//
//
if($go == 3 && $tavern['id_quest'] == 3){
//
//
qry("INSERT INTO `tavern_fight` SET `id_user` = ?, `bot_power` = ?, `bot_block` = ?, `bot_hp` = ?, `power` = ?, `block` = ?, `hp` = ?", array($uid,35,35,35,$user['power'],$user['block'],$user['health']));
//
//
qry("UPDATE `tavern` SET `level` = ?  WHERE `id_user` = ? LIMIT 1", array(4,$uid)); 
header('location:?');
exit();
}
//
// 
if($tavern['level'] !=4){
?>
<img style="top: 0" width="100%"src = "/images/tavern/logo.png">
<?
}
//
//
if($tavern['level'] == 1){
require_once($_SERVER['DOCUMENT_ROOT']."/templates/tavern/tavern1.php");
}
if($tavern['level'] == 2){
require_once($_SERVER['DOCUMENT_ROOT']."/templates/tavern/tavern2.php");
}
if($tavern['level'] == 3){
require_once($_SERVER['DOCUMENT_ROOT']."/templates/tavern/tavern3.php");
}
if($tavern['level'] == 4){
require_once($_SERVER['DOCUMENT_ROOT']."/templates/tavern/tavern4.php");
}
if($tavern['level'] == 5){
require_once($_SERVER['DOCUMENT_ROOT']."/templates/tavern/tavern5.php");
}
//
//
foot($uid);
?>