Файл: sys/fnc/aut.php
Строк: 206
<?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: #009688;
color: #fff;'>";
echo "<ul class='nav navbar-nav'>";
echo "<li class='nav-item'><a class='nav-link' href='/info.php'><i class='material-icons'>person</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='material-icons'>email</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='material-icons'>person_add</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='material-icons'>notifications</i> $not</a></li>";
}
?>
<div class="modal fade bd-example-modal-sm" id='menu_aut' tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="collection">
<a class="collection-item" href="/index.php"><i class="material-icons left">home</i> Главная</a>
<a class="collection-item" href="/?umenu"><i class="material-icons left">person_pin</i> Кабинет</a>
<a class="collection-item" href="/user/settings.php"><i class="material-icons left">settings</i> Настройки</a>
<a class="collection-item" href="/user/mail/"><i class="material-icons left">email</i> Сообщения</a>
<a class="collection-item" href="/user/notification/"><i class="material-icons left">notifications</i> Уведомления</a>
<?php
if (access('adm_menu')) {
echo "<a class='collection-item' href='/panel/'><i class='material-icons left'>storage</i> Панель управления</a>";
}
?>
<a class="collection-item" href="/exit.php"><i class="material-icons left">exit_to_app</i> Выход</a>
</div>
</div>
</div>
<div class="dropdown" style="float: right;">
<?php
if (IS_WEB) {
echo "<span data-toggle='tooltip' data-placement='left' title='Меню'><a data-toggle='modal' data-target='#menu_aut' class='nav-link'>";
} else {
echo "<span title='Меню'><a data-toggle='modal' data-target='#menu_aut' class='nav-link'>";
}
if (isset($user) && $user['set_times'] == 1) {
echo date("G:i", $time + $user['set_timesdvig'] * 60 * 60) . " ";
}
?>
<i class="material-icons">menu</i>
</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='waves-effect waves-light btn' href='/user/aut.php' data-toggle='modal' data-target='#aut'>Войти</a> ";
echo "<a class='waves-effect waves-light btn' href='/user/reg.php' data-toggle='modal' data-target='#reg'>Регистрация</a>";
} else {
echo "<a class='waves-effect waves-light btn' href='/user/aut.php'>Войти</a> ";
echo "<a class='waves-effect waves-light btn' 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="row">
<div class="input-field col s12">
<input id="name" name='nick' maxlength='32' type="text" class="validate">
<label for="name">Введите логин</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="pass" name='pass' maxlength='32' type='password' class="validate">
<label for="pass">Введите пароль</label>
</div>
</div>
<div class="switch">
<label>
<input type="checkbox" name='aut_save' value='1'>
<span class="lever"></span>
Не выходить из системы
</label>
</div>
<div class="modal-footer">
<a href="/user/pass.php" class="btn btn-secondary">Забыли пароль?</a>
<button class='waves-effect waves-light btn'><i class="material-icons">exit_to_app</i> Войти</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'>";
?>
<div class="row">
<div class="input-field col s12">
<input id="name" name='nick' maxlength='32' type="text" class="validate">
<label for="name">Введите логин</label>
</div>
</div>
<small>Регистрируясь, вы соглашаетесь с нашими <a href='/modules/info/rules.php'>Условиями использования</a> и подтверждаете, что ознакомились с нашей <a href='/modules/info/rules.php'>Правилами данного ресурса</a>, включая использование файлов «cookie».</small>
<div class="modal-footer">
<button class="waves-effect waves-light btn">Продолжить</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</ul>
</nav>
<?php
}
}