Вход Регистрация
Файл: sys/fnc/aut.php
Строк: 218
<?php
/* DCMS S (Special)
 * Версия файла 0.0.1
 * Дата последнего редактирования 20.11.2015
 * Модифицировал densnet
 */

function aut() {
    global 
$set;
    global 
$passgen;
    global 
$time;
    global 
$user;

    
$rekl mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `sel` = '1'"), 0);
    if (
$rekl 0) {
        echo 
"<div class = 'list-group-item'>n";
        
rekl(1);
        echo 
"</div>n";
    }

    if (isset(
$user)) {
        if (@
$_GET['del'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `mess` WHERE `id` = '" intval($_GET['del']) . "'"), 0) == 1) {
            
$post mysql_fetch_assoc(mysql_query("SELECT * FROM `mess` WHERE `id` = '" intval($_GET['del']) . "' LIMIT 1"));
            
mysql_query("DELETE FROM `mess` WHERE `id` = '$post[id]'");
        }
        
$q mysql_result(mysql_query("SELECT COUNT(*) FROM `mess` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
        if (
$q != 0) {
            
$k_post mysql_result(mysql_query("SELECT COUNT(*) FROM `mess` WHERE `id_kont` = '" $user['id'] . "'"), 0);
            
$k_page k_page($k_post$set['p_str']);
            
$page page($k_page);
            
$start $set['p_str'] * $page $set['p_str'];

            
$qis mysql_query("SELECT * FROM `mess` WHERE `id_kont` = '" $user['id'] . "' ORDER BY id DESC LIMIT 1");
            while (
$post mysql_fetch_array($qis)) {
                echo 
"<div class = 'new'>";
                echo 
"<div style = 'float:right' id = 'hide'>";
                echo 
"<a href = '?del=$post[id]' title = 'Удалить'><img src = '/style/icons/del.png' /></a>";
                echo 
"</div>";
                echo 
"<img src = '/style/icons/mail.png' /> " text::toOutput($post['msg']) . "<br />";
                echo 
"</div>";
            }
        }


        echo 
"<nav class='navbar navbar-light' style='
        background-color: #e3f2fd;
        border: 1px #ccc solid;
        margin-bottom: -1px;'>"
;
        echo 
"<ul class='nav navbar-nav'>";
        echo 
"<li class='nav-item'><a class='nav-link' href='/info.php'><span class='fa fa-user'></span> " text::gradient("$user[nick]""$user[ncolor]""$user[ncolor2]") . "</a></li>";

        
#уведомления о сообщениях
        
$mail mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$user[id]' AND `type` = 'to' AND `read` = '0'"), 0);

        if (
$mail != 0) {
            echo 
"<li class='nav-item'><a href='/user/mail/' class='nav-link'><span class='fa fa-envelope'></span> $mail</a></li>";
        }

        
$friends mysql_result(mysql_query("SELECT COUNT(*) FROM `friends_new` WHERE `to` = '$user[id]'"), 0);
        
#уведомления о предложениях в друзья
        
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `friends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0) {
            echo 
"<li class='nav-item'><a href='/user/friends/new.php?' class='nav-link'><span class='fa fa-user'></span> $friends</a></li>";
        }

        
$jn mysql_result(mysql_query("SELECT COUNT(*) FROM `notification` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
        
$jns mysql_result(mysql_query("SELECT COUNT(*) FROM `notifications` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
        
$jnf mysql_result(mysql_query("SELECT COUNT(*) FROM `f_journal` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0);

        
$not $jn $jns $jnf;

        if (
$not 0) {
            echo 
"<li class='nav-item'><a href='/user/notification.php' class='nav-link'><span class='fa fa-bell'></span> $not</a></li>";
        }
        
?>


        <div class="modal fade bd-example-modal-sm" id='menu_aut' tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <a class="list-group-item" href="/index.php"><span class="fa fa-home fa-fw"></span> Главная</a>
                    <a class="list-group-item" href="/?umenu"><span class="fa fa-cogs fa-fw"></span> Кабинет</a>
                    <a class="list-group-item" href="/user/settings.php"><span class="fa fa-cog fa-fw"></span> Настройки</a>
                    <a class="list-group-item" href="/user/mail/"><span class="fa fa-envelope-o fa-fw"></span> Сообщения</a>
                    <a class="list-group-item" href="/user/notification.php"><span class="fa fa-bell-o fa-fw"></span> Уведомления</a>
                    <?php
                    
if (user::access('adm_menu')) {
                        echo 
"<a class='list-group-item' href='/?panel'><span class='fa fa-th fa-fw'></span> Панель управления</a>";
                    }
                    
?>
                    <li class='dropdown-item'><a class="dropdown-item" href="/exit.php"><span class="fa fa-power-off fa-fw"></span> Выход</a></li>
                </div>
            </div>
        </div>
        <div class="dropdown" style="float: right;">
            <span data-toggle='tooltip' data-placement='left' title='Меню'><a data-toggle='modal' data-target='#menu_aut' class="nav-link">
                    <?php
                    
if (isset($user) && $user['set_times'] == 1) {
                        echo 
date("G:i"$time $user['set_timesdvig'] * 60 60) . " &nbsp;  ";
                    }
                    
?>
                    <span class="fa fa-bars"></span>
                </a>

            </span>
        </li>
        </ul>

        </nav>


        <?php
        
//if ($user['welcome'] != NULL) {
        //echo "<small><i>" . text::toOutput($user['welcome']) . "</i></small><br />";
        //}
    
} else {
        
user::only_unreg();

        if (
$set['guest_select'] == '1') {
            
msg("Авторизуйтесь пожалуйста");
            echo 
"<div class = 'label label-danger'>Технические работы</div>";
        }
        
?>
        <nav class="navbar navbar-light" style='
             background-color: #e3f2fd;
             border: 1px #ccc solid;
             margin-bottom: -1px;'>
            <ul class='nav navbar-nav'>
                <div class="bd-example">
                    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#aut">Авторизация</button> 
                    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#reg">Регистрация</button>

                    <div class="modal fade" id="aut" tabindex="-1" role="dialog" aria-labelledby="aut" aria-hidden="true">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                        <span class="sr-only">Close</span>
                                    </button>
                                    <h5 class="modal-title" id="exampleModalLabel">Авторизация</h5>
                                </div>
                                <div class="modal-body">
                                    <form method='post' action='/user/login.php'>

                                        <div class='input-group'>
                                            <div class='input-group-addon'>
                                                <span class="fa fa-user"></span>
                                            </div>
                                            <input class='form-control' title='Введите логин' name='nick' placeholder='Введите логин' maxlength='32' type='text' />
                                        </div>
                                        <br />
                                        <div class='input-group'>
                                            <div class='input-group-addon'>
                                                <span class="fa fa-lock"></span>
                                            </div>
                                            <input class='form-control' title='Введите пароль' name='pass' placeholder='Введите пароль' maxlength='32' type='password' />
                                        </div>
                                        <br />

                                        <label class="c-input c-checkbox">
                                            <input type="checkbox" name='aut_save' value='1'>
                                            <span class="c-indicator"></span>
                                            Не выходить из системы
                                        </label>

                                        <div class="modal-footer">
                                            <a href="/?pass" class="btn btn-secondary"><span class="fa fa-key"></span> Забыли пароль?</a>
                                            <button class="btn btn-success">Войти</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="reg" aria-hidden="true">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                        <span class="sr-only">Close</span>
                                    </button>
                                    <h5 class="modal-title" id="exampleModalLabel">Регистрация</h5>
                                </div>
                                <div class="modal-body">
                                    <?php
                                    
echo "<form method='post' action='/user/reg.php?$passgen'>";
                                    
?>

                                    <input data-toggle='tooltip' data-placement='bottom' class='form-control' title='Введите логин' name='nick' placeholder='Введите логин' maxlength='32' type='text' />

                                    <br />
                                    <small>Регистрируясь, вы соглашаетесь с нашими <a href='/modules/info/rules.php'>Условиями использования</a> и подтверждаете, что ознакомились с нашей <a href='/modules/info/rules.php'>Правилами данного ресурса</a>, включая использование файлов «cookie».</small>

                                    <div class="modal-footer">
                                        <button class="btn btn-success">Продолжить</button>
                                    </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </ul>
        </nav>
        <?php
    
}
}
Онлайн: 0
Реклама