
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0" />

        <link rel="shortcut icon" href="/style/icons/special.png" />

        <title><?= $set['title'] ?></title>

        <link rel="stylesheet" href="/style/touch/font-awesome.css">
        <link rel="stylesheet" href="/style/touch/style.css"> 
        <link rel="stylesheet" href="/style/touch/bootstrap.css">  
        <link rel="stylesheet" href="/style/touch/hint.css">

        <script src="/style/js/jquery.js"></script>    

        <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/js/tether.min.js" integrity="sha384-Plbmg8JY28KFelvJVai01l8WyZzrYWG825m+cZ0eDDS1f7d/js6ikvy1+X+guPIB" crossorigin="anonymous"></script>
        <script src="/style/js/bootstrap.js"></script>    
        <script src="/style/js/pushy.js"></script>
        <script src="/modules/public/js/public.js"></script>    

    </head> 

    <body> 
        <style>
            .horiz-menu__link:hover{
                background: #<?php
                if (isset($user)) {
                    echo $user['colorbp'];
                } else {
                    echo 'fff';
                }
                ?>;
            }

            .count {
                margin: 2px 0 2px 2px;
                padding: 4px 6px;
                vertical-align: top;
                color: #<?php
                if (isset($user)) {
                    echo $user['color_counts'];
                } else {
                    echo '5b6e85';
                }
                ?>;
                background: #<?php
                if (isset($user)) {
                    echo $user['color_count'];
                } else {
                    echo 'd1d9e0';
                }
                ?>;
                font-weight: 700;
                font-size: 11px;
                line-height: 17px;
                height: 16px;
                border-radius: 2px;
                transition: background-color 200ms linear, color 200ms linear;
                float: right;
            }
        </style>
        <div class="body">
            <?php
            if (isset($user)) {
                echo "<div class='header' style='background-image: linear-gradient(to bottom, #$user[colorfp] 0%,#$user[colorbs] 100%);'></div>";
            } else {
                echo "<div class='header' style='background-image: linear-gradient(to bottom, #282b36 0%, #282b36 100%);'></div>";
            }
            ?>

            <div class="content">
                <div class="size">
                    <div class="cont_left pushy-left">
                        <?php
                        #Выводим содержимое левой панели
                        require 'panel_left.php';
                        ?>
                    </div>
                    <div class="site-overlay"></div>
                    <div class="site-overlay2"></div>
                    <div class="cont_center">
                        <div class="menu-btn">
                            <?php
                            if (isset($user)) {
                                if ($user['set_icon_panel'] == 1) {
                                    avatar($user['id'], 30, 30, 0, null);
                                } else {
                                    echo "<i class='fa fa-$user[icon_panel_left]' style='color: #$user[colorlp];'></i>";
                                }
                            } else {
                                echo "<i class='fa fa-sign-in' style='color: #fff;overflow: hidden;'></i>";
                            }
                            ?>
                        </div>
                        <div class="menu-btn_2">
                            <?php
                            #Меняем иконки для гостя
                            if (isset($user)) {
                                echo "<i class='fa fa-$user[icon_panel_right]' style='color: #$user[colorlp];'></i>";
                            } else {
                                echo "<i class='fa fa-search' style='color: #fff;'></i>";
                            }
                            ?>
                        </div>
                        <div class="title">
                            <?php
                            #Цвет текста заголовка
                            if (isset($user)) {
                                echo "<font color='#$user[colorbp]'>$set[title]</font>";
                            } else {
                                echo "<font color='#fff'>$set[title]</font>";
                            }
                            ?>
                        </div>
                        <?php
                        #Предупреждение об ограничение сайта гостем
                        if (isset($user)) {
                            echo "";
                        } else {
                            echo "<div class='list-group-item-null list-group-item-warning'>Доступ ограничен - <a href='/aut.php'>авторизуйтесь</a></div>";
                        }
                        ?>

                        <div class="cont">
                            <header>
                                <?php
                                #Выводим сообщение, уведомление
                                if (isset($_SESSION['message']{0})) {
                                    echo "<div class='bg-success-msg'>" . toOutput($_SESSION['message']) . "</div>";
                                    unset($_SESSION['message']);
                                }
                                if (isset($_SESSION['err']{0})) {
                                    echo "<div class='bg-danger'>" . toOutput($_SESSION['err']) . "</div>";
                                    unset($_SESSION['err']);
                                }
                                ?>
                            </header>

                            <?php
                            #Показывает при рассылке сообщений
                            if (isset($user)) {
                                if (isset($_GET['del'])) {
                                    $l = $db->super_query("SELECT COUNT(*) as count FROM `mess` WHERE `id` = '" . intval($_GET['del']) . "'");
                                    if ($l['count'] == 1) {

                                        $post = $db->get_row($db->query("SELECT * FROM `mess` WHERE `id` = '" . intval($_GET['del']) . "' LIMIT 1"));
                                        $db->query("DELETE FROM `mess` WHERE `id` = '$post[id]'");
                                    }
                                }

                                $query = $db->super_query("SELECT COUNT(*) as count FROM mess WHERE id_kont = '$user[id]' AND `read` = '0'");

                                if ($query['count'] != 0) {

                                    $k_post = $db->super_query("SELECT COUNT(*) as count FROM mess WHERE id_kont = '$user[id]'");
                                    $k_page = k_page($k_post['count'], $set['p_str']);
                                    $page = page($k_page);
                                    $start = $set['p_str'] * $page - $set['p_str'];

                                    $q = $db->query("SELECT * FROM `mess` WHERE `id_kont` = '" . $user['id'] . "' ORDER BY id DESC LIMIT 1");
                                    while ($post = $db->get_row($q)) {
                                        echo "<div class='list-group-item-null list-group-item-info'>";
                                        echo "<div style='float:right'>";
                                        echo "<a href = '?id=$post[id]' class='hint--left' data-hint='" . lang('Очистить') . "'><i class='fa fa-trash-o'></i></a>";
                                        echo "</div>";
                                        echo toOutput($post['msg']) . "<br />";
                                        echo "</div>";
                                    }
                                    unset($q);
                                }
                                unset($query);
                            }

                            $rekl_1 = $db->super_query("SELECT COUNT(*) as count FROM rekl WHERE sel = 1");
                            if ($rekl_1['count'] > 0) {
                                rekl(1);
                            }



                            