Файл: adm_panel/referals.php
Строк: 29
<?
require_once ("../core/cuctema/core.php");require_once ("../core/cuctema/adm_check.php");
user_access('adm_ref',null,'index.php?'.SID);
adm_check();
$set['title']='Рефералы'; // заголовок страницы
require_once ("../core/cuctema/head.php");
title();
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 " <td class='hide'>n";
echo "Нет рефераловn";
echo " </td>n";
}
$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 " <div class='d1'>n";
echo "URL: <a target='_blank' href='/go.php?go=".base64_encode("http://$ref[url]")."'>".htmlentities($ref['url'])."</a><br />n";
echo " </div>n";
echo " <div class='d2'>n";
echo "Переходов: $ref[count]<br />n";
echo "Последний: ".vremja($ref['time'])."<br />n";
echo " </div>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
if (user_access('adm_panel_show'))echo "<div class='d1'>n";
echo "«<a href='/adm_panel/'>В админку</a><br />n";
echo "</div>n";
require_once ("../core/cuctema/foot.php");
?>