Файл: user/settings/time.php
Строк: 62
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 24.10.2015
* Модифицировал densnet
*/
require_once '../../sys/inc/start.php';
require_once H . 'sys/inc/compress.php';
require_once H . 'sys/inc/sess.php';
require_once H . 'sys/inc/settings.php';
require_once H . 'sys/inc/db_connect.php';
require_once H . 'sys/inc/ipua.php';
require_once H . 'sys/inc/fnc.php';
require_once H . 'sys/inc/user.php';
user::only_reg();
$set['title'] = 'Общие настройки';
require_once H . 'sys/inc/thead.php';
title();
aut();
err();
if (isset($_POST['save'])) {
$user['set_times'] = (isset($_POST['set_times']) && $_POST['set_times']) ? '1' : '0';
mysql_query("UPDATE `user` SET `set_times` = '" . mysql_real_escape_string($user['set_times']) . "' WHERE `id` = '$user[id]' LIMIT 1");
if (isset($_POST['set_timesdvig']) && (is_numeric($_POST['set_timesdvig']) && $_POST['set_timesdvig'] >= -12 && $_POST['set_timesdvig'] <= 12)) {
$user['set_timesdvig'] = intval($_POST['set_timesdvig']);
mysql_query("UPDATE `user` SET `set_timesdvig` = '$user[set_timesdvig]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Ошибка временной зоны';
}
if (!isset($err)) {
msg('Изменения успешно приняты');
header("Location: time.php?" . SID);
exit;
}
}
echo '<div class="busi_switcher"><table><tr><td style = "width: 20%;">';
echo "<a href = '/user/settings.php' class = 'brd'>Общие</a>";
echo '</td><td style = "width: 20%;">';
echo "<a href = '/user/settings/them.php' class = 'brd'>Вид</a>";
echo '</td><td style = "width: 20%;">';
echo "<a class = 'active brd'>Время</a>";
echo '</td><td style = "width: 20%;">';
echo "<a href = '/user/settings/private.php' class = 'brd'>Приватность</a>";
echo '</td><td style = "width: 20%;">';
echo "<a href = '/user/settings/password.php' class = 'brd'>Пароль</a>";
echo '</td></tr></table></div>';
echo "<form name = 'settings' class = 'comm' action = '?$passgen' method = 'POST'>";
echo "<span style = 'float:right;'><img src = '/style/icons/Timer-Watch.png' /></span>";
echo "Время<br/>";
echo "<select name = 'set_timesdvig'><br/>";
for ($i = - 12; $i < 12; $i++) {
echo "<option value = '$i'" . ($user['set_timesdvig'] == $i ? " selected = 'selected'" : null) . ">" . date("G:i", $time + $i * 60 * 60) . "</option>n";
}
echo "</select><br />";
echo "<div class = 'mtp'></div>";
echo "<label><input type = 'checkbox'" . ($user['set_times'] ? " checked = 'checked'" : null) . " name = 'set_times' value = '1' />Время и дата в заголовке</label><br/>";
echo "<button name = 'save' class = 'button-green'>Сохранить</button>";
echo "</form>";
if (isset($_SESSION['refer']) && $_SESSION['refer'] != NULL && otkuda($_SESSION['refer'])) {
echo "<div class = 'comm'><a href = '$_SESSION[refer]' style = 'color: #88C057;'><img src = '/style/icons/left.png'/> " . otkuda($_SESSION['refer']) . "</a></div>";
}
echo "<div class = 'comm'><a href = '/umenu.php' style = 'color: #88C057;'><img src = '/style/icons/left.png'/> Кабинет</a></div>";
require_once H . 'sys/inc/tfoot.php';