File size: 1.64Kb
<?php
// выводим верх страницы
include 'verh.php';
$a = mysql_query("SELECT * FROM `inet_sites` WHERE `in`>=1 AND resultat!='off' ORDER BY `in` DESC LIMIT 10");
echo "<div class=\"main_copyright\"><p align=\"center\"><b>ТОП 10</b><br/></p>";
echo "</div><div class=\"b\">";
if(mysql_affected_rows() == 0)
{
echo("Сайтов нет.<br />\n");
}
while($site = mysql_fetch_array($a)) {
$id = $site['id'];
$name = $site['name'];
$in = $site['in'];
$out = $site['out'];
$opis = $site['opis'];
$url = $site['url'];
echo "<a href='out.php?id=$id'><b>$name</b></a>";
if (file_exists("images/$id.gif")) {echo " <img src='images/$id.gif' alt=''/>";}
if (file_exists("images/$id.jpg")) {echo " <img src='images/$id.jpg' alt=''/>";}
if (file_exists("images/$id.png")) {echo " <img src='images/$id.png' alt=''/>";}
if(@$_SESSION['pass']==$adminpass) {
echo " <a href='adminka/view.php?id=$id'>[admin]</a>";
}
echo "<br/>$opis<br/>";
echo "<a href='out.php?id=$id'>$url</a><br/>";
echo "Переходы: <a href=\"info.php?id=$id\">[stat]</a><br/>
in: $in / out: $out<br/>
</div><div class=\"b\">";
}
echo "<div class=\"b\" align=\"center\">
Категории:<br/>
<form action='top.php' method='get'><select name='category'>";
$cat=mysql_query("SELECT * FROM inet_category ORDER BY position ASC");
while($category = mysql_fetch_array($cat)) {
echo "<option value=\"".$category['id']."\">".$category['name']."</option>";
}
echo "</select><br/><input type='submit' value='Перейти'/></form>";
echo "</div><div class=\"b\">";
echo "»<a href=\"index.php\">На главную</a><br/>";
// выводим низ страницы
include 'niz.php';
?>