Файл: 4mast/profmas.ru/modules/settings.php
Строк: 54
<?php
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
if ( $us == false ) {
header( 'location: /login/auth' );
exit;
}
H( 'Мои настройки', 'Мои настройки' );
echo '<div class="list1"><form method="post" action="/modules/settings.php?style">Дизайн:<br/><select name="style">';
////////////////////////////////////////////////////////////
$profmas= DB::$dbs->querySingle( "SELECT COUNT(*) FROM `us` WHERE (`style` = 'prfmas')" );
echo '<option value="profmas"';
if ( $us[ 'style' ] == "profmas" ) echo 'selected';
echo '>PROFMAS(' . $profmas. ')</option>';
////////////////////////////////////////////////////////////
$oran = DB::$dbs->querySingle( "SELECT COUNT(*) FROM `us` WHERE (`style` = 'oran')" );
echo '<option value="oran"';
if ( $us[ 'style' ] == "oran" ) echo 'selected';
echo '>Orange (' . $oran . ')</option>';
////////////////////////////////////////////////////////////
$s_wm_pasha963 = DB::$dbs->querySingle( "SELECT COUNT(*) FROM `us` WHERE (`style` = 'wm_pasha963')" );
echo '<option value="wm_pasha963"';
if ( $us[ 'style' ] == "wm_pasha963" ) echo 'selected';
echo '>WM by PASHA963 (' . $s_wm_pasha963 . ')</option>';
////////////////////////////////////////////////////////////
$s_by_mayk = DB::$dbs->querySingle( "SELECT COUNT(*) FROM `us` WHERE (`style` = 'by_mayk')" );
echo '<option value="by_mayk"';
if ( $us[ 'style' ] == "by_mayk" ) echo 'selected';
echo '>Touch Mayk (' . $s_by_mayk . ')</option>';
////////////////////////////////////////////////////////////
$s_zomboy_style = DB::$dbs->querySingle( "SELECT COUNT(*) FROM `us` WHERE (`style` = 'zomboy_style')" );
echo '<option value="zomboy_style"';
if ( $us[ 'style' ] == "zomboy_style" ) echo 'selected';
echo '>FORMAST blue (' . $s_zomboy_style . ')</option>';
////////////////////////////////////////////////////////////
$s_defaults = DB::$dbs->querySingle( "SELECT COUNT(*) FROM `us` WHERE (`style` = 'defaults')" );
echo '<option value="defaults"';
if ( $us[ 'style' ] == "defaults" ) echo 'selected';
echo '>Стандартный (' . $s_defaults . ')</option>';
////////////////////////////////////////////////////////////
echo '</select><br/><input type="submit" value="Установить"/></form></div>';
if ( isset( $_GET[ 'style' ] ) ) {
DB::$dbs->query( "UPDATE `us` SET `style` = ? WHERE `id` = ?", array(
$_POST[ 'style' ],
$us[ 'id' ]
) );
header( 'location: /modules/settings.php' );
echo '<div class="access">Успешно обновлён</div>';
}
echo '<div class="block">Прикрепление файлов: <a href="/modules/settings.php?f">[' . ( $us[ 'file' ] == 1 ? 'выкл' : 'вкл' ) . ']</a></div>';
echo '<div class="block">Логотип сайта на главной: <a href="/modules/settings.php?logo">[' . ( $us[ 'logo' ] == 1 ? 'выкл' : 'вкл' ) . ']</a></div>';
echo '<div class="block">Анкетные данные: <a href="/modules/settings.php?mod=opt&ank">[' . (($us['ank'] == 0) ? 'Показывать' : 'Скрывать'). ']</a></div>';
if (isset ($_GET['ank'])) {
DB :: $dbs -> query ("UPDATE `us` SET `ank`='" . ($us['ank'] == 1 ? 0 : 1) . "' WHERE (`id`='" . $us['id'] . "')");
header( 'location: /modules/settings.php' );
echo '<div class="access">Сохранено</div>';
}
if ( isset( $_GET[ 'f' ] ) ) {
DB::$dbs->query( "UPDATE `us` SET `file`='" . ( $us[ 'file' ] == 1 ? 0 : 1 ) . "' WHERE (`id`='" . $us[ 'id' ] . "')" );
header( 'location: /modules/settings.php' );
echo '<div class="access">Сохранено</div>';
}
if ( isset( $_GET[ 'logo' ] ) ) {
DB :: $dbs->query( "UPDATE `us` SET `logo` = '" . ( $us[ 'logo' ] == 1 ? 0 : 1 ) . "' WHERE (`id`='" . $us[ 'id' ] . "')" );
header( 'location: /modules/settings.php' );
echo '<div class="access">Сохранено</div>';
}
require_once('../includes/Footers.php');
?>