File size: 1.91Kb
<?php
require_once ($_SERVER['DOCUMENT_ROOT'].'/system/connections/core.php');
access('users');
$count = intval(get('type'));
if (ajax() == true){
require_once (ROOT.'/users/account/mail/plugins/mail.php');
?>
<div class='web-dialog-modal-title'>
<?=lg('Список диалогов')?>
<a class='web-dialog-modal-title-close2' href='/account/mail/'><?=icons('object-group', 20)?></a>
<button class='web-dialog-modal-title-close' onclick="open_or_close('web-dialog-modal', 'close')"><?=icons('times', 25)?></button>
</div>
<div class='content-mess-dialog' style='height: 408px'>
<?
$s = 0;
$data = db::get_string_all("SELECT * FROM `MAIL` WHERE `MY_ID` = ? ORDER BY `TIME` DESC LIMIT 10", [user('ID')]);
while ($list = $data->fetch()){
$msg_count = db::get_column("SELECT COUNT(*) FROM `MAIL_MESSAGE` WHERE `MY_ID` = ? AND `USER_ID` = ? AND `USER` = ? AND `READ` = '0'", [$list['USER_ID'], user('ID'), user('ID')]);
$s++;
?>
<a ajax='no' id='dialog_modal_mess_open' user='<?=$list['USER_ID']?>' count='<?=$count?>'>
<div class='list-menu hover' style='position: relative'>
<?=user::avatar($list['USER_ID'], 35, 1)?>
<span style='position: absolute; top: 21px; left: 62px'><?=user::login($list['USER_ID'])?></span>
<?=($msg_count > 0 ? "<span class='count' style='position: absolute; top: 21px; right: 15px; padding: 0px 1em; background-color: #F93872'>".$msg_count."</span>" : null)?>
</div>
</a>
<?
}
if ($s == 0) {
?>
<div class='list3'>
<span><?=icons('comments', 84)?></span>
<div><?=lg('Нет контактов')?></div>
</div>
<?
}
?></div></div><?
if (user('MESSAGES_PRINTS') > 0){
db::get_set("UPDATE `USERS` SET `MESSAGES_PRINTS` = '0' WHERE `ID` = ? LIMIT 1", [user('ID')]);
}
}else{
echo lg('Не удалось установить соединение');
}