<?php

require '../system/start.php';
require '../system/functions.php';
reg();
$str['mesto'] = 'Тема';
$str['block'] = $set['site'].' / Стиль сайта';
include '../style/'.$style.'/head.php';
if(isset($_POST['theme']) and !empty($_POST['theme']))
{
	mysql_query("update `users` set `style` = '".protect($_POST['theme'])."' where `id` = ".$user['id']."");
	echo '<div class="mess">Настройки успешно изменены!</div>';
}
echo '<div class="on">
<form action="settings.php" method="post">';
echo "Тема оформления:<br />\n<select name=\"theme\">\n";
$opendirthem=opendir('../style');
while ($themes=readdir($opendirthem)){
if (is_dir("../style/$themes") && $themes!='.' && $themes!='..'){
if ($style==$themes)$check=' selected="selected"';else $check=NULL;
echo "<option$check value=\"$themes\">$themes</option>\n";}}
echo "</select><br />\n";

echo "<input value=\"Изменить\" type=\"submit\" />\n";
echo "</div></form></div>\n";
include '../style/'.$style.'/foot.php';
?>