Файл: adm_panel/referals.php
Строк: 47
<?php
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/adm_check.php';
require_once '../sys/inc/user.php';
user_access('adm_ref', null, 'index.php?' . SID);
adm_check();
$set['title'] = 'Рефералы'; // заголовок страницы
require_once '../sys/inc/thead.php';
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(distinct(`url`)) FROM `user_ref`"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if ($k_post == 0) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет рефералов";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT COUNT(`url`) AS `count`, MAX(`time`) AS `time`, `url` FROM `user_ref` GROUP BY `url` ORDER BY `count` DESC LIMIT $start, $set[p_str]");
while ($ref = mysql_fetch_assoc($q)) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "URL: <a target='_blank' href='/go.php?go=" . base64_encode("http://$ref[url]") . "'>" . htmlentities($ref['url']) . "</a><br />n";
echo "Переходов: $ref[count]<br />n";
echo "Последний: " . vremja($ref['time']) . "<br />n";
echo "</td></tr></table>";
}
if ($k_page > 1) {
str("?", $k_page, $page);
}
if (user_access('adm_panel_show')) {
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/left.png' /> <a href = '/adm_panel/'>Панель управления</a>";
echo "</div>";
}
require_once '../sys/inc/tfoot.php';