Просмотр файла wkat/topmonth.php

Размер файла: 3.52Kb
<?
$start_time = microtime();
$start_array = explode(" ",$start_time);
$start_time = $start_array[1] + $start_array[0];
include "xconf.php";
If (!isset($_GET['c']) || !is_numeric($_GET['c']) || $_GET['c']<0) 
{
$title="Лучшие за месяц";
}
else {
$where_data=$_GET['c'];
$resa=mysql_query("select * from `cool_raz` where id='$where_data' ");
$title=mysql_result($resa,0,"text");
}
header("Cache-Control: no-cache");


include "header.php";
print $begin;
print $p_l;
print $sm;

print $d_fl;

$kolich_adm=5;
$where_data=$_GET['c'];
If (!isset($_GET['c']) || !is_numeric($_GET['c']) || $_GET['c']<0) 
{
$res=mysql_query("select * from `cool_site` where  activ<>'0' && ins>'0' order by `ins` desc ");
$kol=mysql_num_rows($res);
}
else {
$resax=mysql_query("select * from `cool_raz` where id='$where_data' ");
$row=mysql_num_rows($resax);
if ($row=="0")
{
print "O&#x0448;&#x0438;&#x0431;&#x043A;a!<br/>
<a href=\"topmonth.php?ver=$ver\">Ha&#x0437;a&#x0434;</a><br/>$endpage1";
exit;
}
$res=mysql_query("select * from `cool_site` where category='$where_data' &&  activ<>'0' && ins>'0' order by `ins` desc ");
$kol=mysql_num_rows($res);
}
If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])  || $_GET['page']<0  || $_GET['page']==0){
$page=1;
}else $page=$HTTP_GET_VARS['page'];
for ($i=($page-1)*$kolich_adm;$i<($kolich_adm*$page);$i++){
If ($i>=$kol) break;

$idss=mysql_result($res,$i,"id");
$link=mysql_result($res,$i,"link");
$title=mysql_result($res,$i,"title");
$about=mysql_result($res,$i,"about");
$tin=mysql_result($res,$i,"tin");
$toout=mysql_result($res,$i,"tout");
$ins=mysql_result($res,$i,"ins");
$outs=mysql_result($res,$i,"outs");
$link=str_replace("http://","", $link);
echo "$d_mz<b><a href=\"out.php?go=$idss\">$title</a></b>    [<a href=\"oper_in.php?c=$where_data&amp;id=$idss&amp;ver=$ver\">i</a>]<br/>[$link]<br/>$about<br/>Ce&#x0433;o&#x0434;&#x043D;&#x044F;:<br/>[out: $toout | in: $tin]<br/>&#x0417;a &#x043C;ec&#x044F;&#x0446;:<br/>[out: $outs | in: $ins]$d_e<br/>";
}
If ($page>1) {  $pagep=$page-1;  echo "
$d_mz<a href=\"topmonth.php?page=$pagep&amp;c=$where_data&amp;ver=$ver\">Ha&#x0437;a&#x0434;</a>$d_e<br/>"; }
If ((ceil($kol/$kolich_adm))>$page) { $page++;    
echo "$d_mz<a href=\"topmonth.php?page=$page&amp;c=$where_data&amp;ver=$ver\">&#x0414;a&#x043B;&#x044C;&#x0448;e</a>$d_e<br/>";}
$totalp=ceil($kol/5);
if ($totalp>1) {
if ($ver=="htm"){
 echo "</div><form action=\"topmonth.php\" method=\"get\"><div>страница<input type=\"text\" name=\"page\" size=\"2\" value=\"$totalp\"/></div>
<div><input name=\"c\" type=\"hidden\" value=\"$where_data\" /></div>
<div><input name=\"ver\" type=\"hidden\" value=\"$ver\" /></div>



<div><input type=\"submit\" class=\"ibutton\" value=\"&#x043F;epe&#x0439;&#x0442;&#x0438;\" /></div></form><div class=\"fl\">
<br/>$d_mzBce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: $totalp$d_e";
}
else {
echo "<br/>страница</small> <input type=\"text\" name=\"pg\" size=\"2\" value=\"$totalp\" format=\"*N\"/><small>
<anchor> перейти
<go href=\"topmonth.php?c=$where_data&amp;ver=$ver\" method=\"get\">
<postfield name=\"page\" value=\"$(pg)\"/>
</go>
</anchor><br/>Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: $totalp";
}
}
if ($totalp<2) {
print  "$d_mz Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: 1$d_e"; }
print "<br/>$d_mz<a href='index.php?ver=$ver'>Ha &#x0433;&#x043B;a&#x0432;&#x043D;y&#x044E;</a>$d_e<br/>
";
@include "ber.php"; 
print $endpage1;
?>