View file panel/logs.php

File size: 1.45Kb
<?php
// by Mike O. (mides), coolcms.org

require_once '../includes/sys.php';
require_once '../includes/auth_a.php';
require_once '../includes/header.php';

if (!access(3)) {
    redirect(HTTPHOME);
}

switch ($act) {
    default:
		tp('<a href="index.php">АДМ</a>&raquo; Логи');
		echo '
		
		<div class="row"><a href="?act=from">Кто откуда</a></div>
		
		<div class="body"><a href="index.php">АДМ</a>&raquo; Логи</div>';
	break;
	
	case 'from':
		tp('<a href="index.php">АДМ</a>&raquo; <a href="?">Логи</a>&raquo; Кто откуда');
		
		$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `logs_from`"), 0);
		
		$pages = ceil($total / $config['onpage']);
		if ($page > $pages or $page == 0) {
				$page = 1;
		}
		$begin = ($page - 1) * $config['onpage'];
		
		$logs_r = mysql_query("SELECT * FROM `logs_from` ORDER BY `time` DESC LIMIT $begin, $config[onpage]");
		while ($log = mysql_fetch_assoc($logs_r)) {
			echo '<div class="row"><a href="http://'.$log['url'].'" target="_blank" />Сайт: <b>'.$log['url'].'</b>, переходов: '.$log['per'].'<br />Последний с IP: <u>'.$log['ip'].'</u> в '.ccdate($log['time']).'</a></div>';
		}
		
		echo '<div class="body">';
        
		navig($page, '?act=from', $pages);

		echo '<a href="index.php">АДМ</a>&raquo; <a href="?">Логи</a>&raquo; Кто откуда</div>';
	break;
}

require_once '../includes/tail.php';
?>