Файл: sys/fnc/aut.php
Строк: 192
<?php
/* DCMS Special
* Дата последнего редактирования 10.12.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 list-group-item-warning'>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' /> " . toOutput($post['msg']) . "<br />";
echo "</div>";
}
}
echo "<nav class='navbar navbar-light' style='
background-color: #FFF;
border: 1px #e1e8ed solid;'>";
echo "<ul class='nav navbar-nav'>";
echo "<li class='nav-item'><a class='nav-link' href='/info.php'><i class='fa fa-user fa-fw'></i> " . gradient("$user[nick]", "$user[ncolor]", "$user[ncolor2]") . "</a></li>";
#уведомления о сообщениях
$mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_kont` = '$user[id]' AND `read` = '0' AND `deleted` != '$user[id]' AND `deleted` != '-1' AND `flaggedTo` = 'inbox'"), 0);
if ($mail != 0) {
echo "<li class='nav-item'><a href='/user/mail/' class='nav-link'><i class='fa fa-envelope fa-fw'></i> $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'><i class='fa fa-user fa-fw'></i> $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/' class='nav-link'><i class='fa fa-bell fa-fw'></i> $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"><i class="fa fa-home fa-fw"></i> Главная</a>
<a class="list-group-item" href="/?umenu"><i class="fa fa-cogs fa-fw"></i> Кабинет</a>
<a class="list-group-item" href="/user/settings.php"><i class="fa fa-cog fa-fw"></i> Настройки</a>
<a class="list-group-item" href="/user/mail/"><i class="fa fa-envelope fa-fw"></i> Сообщения</a>
<a class="list-group-item" href="/user/notification/"><i class="fa fa-bell fa-fw"></i> Уведомления</a>
<?php
if (access('adm_menu')) {
echo "<a class='list-group-item' href='/panel/'><i class='fa fa-th fa-fw'></i> Панель управления</a>";
}
?>
<a class="list-group-item" href="/exit.php"><i class="fa fa-power-off fa-fw"></i> Выход</a>
</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) . " ";
}
?>
<span class="fa fa-bars"></span>
</a>
</span>
</div>
</ul>
</nav>
<?php
//if ($user['welcome'] != NULL) {
//echo "<small><i>" . toOutput($user['welcome']) . "</i></small><br />";
//}
} else {
only_unreg();
if ($set['guest_select'] == '1') {
msg("Авторизуйтесь пожалуйста");
echo "<div class = 'label label-danger'>Технические работы</div>";
}
?>
<nav class="navbar navbar-light" style='
background-color: #FFF;
border: 1px #e1e8ed solid;'>
<ul class='nav navbar-nav'>
<div class="bd-example">
<?php
if (IS_WEB) {
echo "<a class='btn btn-primary' href='/user/aut.php' data-toggle='modal' data-target='#aut'>Авторизация</a> ";
echo "<a class='btn btn-primary' href='/user/reg.php' data-toggle='modal' data-target='#reg'>Регистрация</a>";
} else {
echo "<a class='btn btn-primary' href='/user/aut.php'>Авторизация</a> ";
echo "<a class='btn btn-primary' href='/user/reg.php'>Регистрация</a>";
}
?>
<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">×</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"><i class="fa fa-key fa-fw"></i> Забыли пароль?</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">×</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
}
}