Размер файла: 1.84Kb
<?
include $DOCUMENT_ROOT.'/inc/header.php';
include $DOCUMENT_ROOT.'/inc/db/config.php';
print '
<table border="1" columns="4">
<tr align="center">
<th>ID</th>
<th>'.rus('Страница').'</th>
<th>'.rus('Кол-во заходов').'</th>
</tr>
<tr align="center">
';
######################################################### Auyniea? ii?ad n?diee
if (empty($page)) $page = 0;
if ($page < 0) $page = 0;
#########################################################
######################################################### N?e?aa? iauaa eie-ai oin?ia
$count_query = 'select count(*) from page where 1 ;';
$total_mess = mysql_query ($count_query);
$total_count = mysql_fetch_array ($total_mess);
$count = $total_count ['count(*)'];
##########################################################
// Een?eia auaiaa oin?ia
$query = "SELECT * FROM page ORDER BY `count` DESC LIMIT ".$page.", ".$max_mess." ;";
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
while($otvet = mysql_fetch_array($result))
{
print_r('<td align="center"><small>'.$id = $otvet ['id_page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['count'].'</small></td>');
echo '</tr>';
echo '<tr>';
}
?>
</tr>
</table>
<?
####################################################### Nicaaiea nnueie
if ($page > 0) echo '<a href="'.$PHP_SELF.'?page='.($page - $max_mess).'">Предыдущие</a> ';
if ($count > $page + $max_mess) echo '<a href="'.$PHP_SELF.'?page='.($page + $max_mess).'">Следующие</a>';
#######################################################
include $DOCUMENT_ROOT.'/inc/footer_stat.php';
?>