<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
$set['title']='Бармен онлайн';
include_once '../sys/inc/thead.php';
title();
aut();

if(!isset($user)){
  echo "Вы не зарегистрированы";
  include_once '../sys/inc/tfoot.php';
  break;
}

include_once 'inc/start.php';

if(isset($_POST['submit'])){
$diz=abs(intval($_POST['diz']));
if(!in_array($diz,array(0,1)))$diz=0;
$name=mysql_real_escape_string($_POST['name']);
mysql_query("UPDATE `bar_user` SET `name`='".$name."',`setting_diz`='".$diz."' WHERE `id_u`='".$user_id."'");
bar_msg($diz['msg'],'Настройки успешно обновленны');
}

echo "
<div class='".$diz['main']."'>
<div class='".$diz['title2']."'>Настройки</div>
<form method='post' action='setting.php?".mt_rand()."'>
Дизайн:<br/>
<select name='diz'>
<option value='0' ".($bar_user['setting_diz']==0 ? "selected='select'" : "").">Бармен</option>
<option value='1' ".($bar_user['setting_diz']==1 ? "selected='select'" : "").">Стандартный</option>
</select>
<br/>
Название бара:<br/>
<input name='name' value='".bar_output($bar_user['name'])."'/>
<br/>
<input type='submit' name='submit' value='Изменить'/></form>
";

echo "</div>";
ret($diz['ret'],'Мой бар','index.php');
 include_once '../sys/inc/tfoot.php';
?>
