Файл: my/guests.php
Строк: 38
<?php
define('GCMS',true);
define('ROOT','../');
require_once ('../system/power.php');
if($aut==true){
switch($do) {
case 'clear':
$db -> query("DELETE FROM `reit` WHERE `komy` = '".$ya['id']."' and `where`='guest'");
header('location: guests.php');
break;
//////////////
default:
$diz -> head('Мои гости');
$diz -> title('Мои гости');
echo '<div class="menu"><a href="?do=clear" class="menutuch">Очистить список</a></div>';
$count = $db -> dbcount('COUNT(`id`)','reit',"`komy` = '".$ya['id']."' and `where`='guest'");
if ($count > 0) {
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
$sql = $db -> query("SELECT * FROM `reit` where `komy` = '".$ya['id']."' and `where`='guest' ORDER BY `time` DESC LIMIT ".$start.",".$num);
while ($arr = $sql -> fetch_assoc()) {
echo '<a href="/id'.$arr['kto'].'" class="mail"><table width=100%><tr><td width=10%>
'.$func->avatar($arr['kto']).'</td><td>
'.$func->famname($arr['kto'],0).'</br>Посещение:';
if($arr['rei']==1){
echo'</br><span style="count">'.$func -> vremja($arr['time']).'</span></div>';
$db -> query("UPDATE `reit` SET `rei`='0' WHERE `id` = '".(int)$arr['id']."'");
}else{
echo '</br>'.$func -> vremja($arr['time']).'</div>';
}
echo '</td></tr></table></a>';
}
$act = '?';
echo $func -> pagenav($act,$page,$total);
} else echo '<div class="fon">На вашей страничке не было гостей</div>';
}
echo '<div class="levo"><a href="./" class="levo_tuch">'.$diz -> img('back.png').' Личный кабинет</a></div>
<div class="levo"><a href="'.ROOT.'" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
}else
?>