Файл: user/settings/time.php
Строк: 58
<?php
/* Мод "Время"
* Версия v0.0.1
* Дата последнего редактирования 20.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Файл time.php
* Описание: настройки времени и даты
*/
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';
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;
}
}
title();
aut();
err();
echo "<form name = 'settings' class = 'razd' action = '?$passgen' method = 'POST'>";
echo "Время<br/>";
echo "<div class = 'inputs'>";
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 = 'input-icon'>" . img16('clock.png') . "</div>";
echo "</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 sign-ins'>" . img16('save.png') . " Сохранить";
echo "</button></form>";
if (isset($_SESSION['refer']) && $_SESSION['refer'] != NULL && otkuda($_SESSION['refer'])) {
echo "<div class = 'razd'><a class = 'add' href = '$_SESSION[refer]'>" . img16('left.png') . " " . otkuda($_SESSION['refer']) . "</a></div>";
}
echo "<div class = 'razd'><a class = 'add' href = '/umenu.php'>" . img16('left.png') . " Кабинет</a></div>";
require_once H . 'sys/inc/tfoot.php';