<?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';
echo '<div class="title">Смена оформления</div>';
{
if(isset($_POST['settheme']))
{
	$theme = mysql_real_escape_string($_POST['settheme1']);
mysql_query("UPDATE `users` SET theme='".$theme."' WHERE nick='".$_SESSION['user']."'");
echo "<div class='inform'><center>Тема изменена!</center></div>";
}
echo "<div class='inform'>
<center>
<form action='' method='post'>
<select name='settheme1'><option value='twotheme'>Голубая</option>
<option value='default'>Стандарт</option></select><br>
<input type='submit' name='settheme' class='btn' value='Изменить' />
</form>
</center>
</div>";
}
}
include 'foot.php';
?>