<?php
require_once '../sys/core.php';
require_once '../sys/auth.php';
require_once '../sys/user.php';
require_once '../sys/func.php';
if (empty($user_id)) go(URL.'/load.php');
$title = 'Мои комнаты';
require_once '../sys/head.php';
require_once 'sys/new_room.php';
require_once 'sys/delete.php';
// оповищение о лимите
echo $stop;
// чат создать тут тип да @-@
echo '<table class="block_panel" cellpadding="0" cellspacing="0">
<td><a class="panel_link" href="/chat/">Все чаты</a></td>
<td><a class="panel_link" href="">Мои Подписки</a></td>
<td><a class="panel_link_ok" href="'.URL.'/chat/my_chat.php">Создать</a></td>
</table>';
echo '<div class="block">
<form id="form" method="post" action="'.URL.'/chat/my_chat.php">
<div class="input_title">Имя комнаты:</div>
<input class="input" type="text" name="name" value=""/>
<div class="input_title">Пароль:</div>
<input class="input" type="text" name="pass" value=""/>
<div class="input_title">Описание:</div>
<textarea style="height:100px;" id="textarea" class="input" name="ops" rows="3"></textarea>
<input class="button" type="submit" name="upl" value="Создать"/>
</form>
</div>';
//список моих комнат
echo '<div class="razd mt10"><span class="material-icons">question_answer</span> Мои чаты</div>';
$all = $mysqli->query("SELECT * FROM `chat_my`")->num_rows;
if ($all > 0)
{
$cp = ceil($all/10);
$p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp) ? $_GET['p'] : 1;
$start = $p*10-10;
$res = $mysqli->query("SELECT * FROM `chat_my` ORDER by `id` LIMIT $start,10");
while ($array = $res->fetch_array()){
echo '<a href="'.URL.'/chat/my_chat.php?id='.$array['id'].'">';
echo '<table class="chat_list" cellpadding="0" cellspacing="0">';
echo '<td class="chat_list_avatar"><img src="../style/img/'.chat_cover($array['id'], $array['user_id']).'"></td>';
echo '<td class="chat_list_content">';
echo '<div class="chat_list_title">'.$array['name'].'</div>';
echo '<div class="chat_list_msg">'.chat_sms($array['id']).'</div>';
echo '</td>';
echo '</table>';
echo '</a>';
echo '<div class="nav-floor">
<a href="'.URL.'/chat/my_chat.php?id='.$array['id'].'">'.$array['name'].'<span style="float: right;"><a class="chat_msg_del" href="'.URL.'/chat/my_chat.php?delet='.$array['id'].'"><span class="material-icons">clear</span></a>'.$array['cat'].'</span></a>
</div>';
}
navi($p,$cp,'/chat/my_chat.php?');
}
require_once '../sys/foot.php';
?>