Просмотр файла superkat/katalog.php

Размер файла: 3.28Kb
<?php
$start = gettime();
include "xconf.php";
If (!isset($_GET['c']) || !is_numeric($_GET['c']) || $_GET['c']<0) 
{
$names="Bce ca&#x0439;&#x0442;&#x044B;";
}
else {
$where_data=$_GET['c'];

$resa=mysql_query("select * from `cool_raz` where id='$where_data' ");
$names=mysql_result($resa,0,"text");
}
header("Cache-Control: no-cache");
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
include "filtr.php";
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; 

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 
print '
<wml>

<card title="Xkat.Ru - '.$names.'">';

 print '<p><small>';

  
  $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='1' && tin>'0' order by `tin` 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=\"katalog.php\">Ha&#x0437;a&#x0434;</a><br/></small></p></card></wml>";
exit;
}

$res=mysql_query("select * from `cool_site` where category='$where_data' &&  activ='1' && tin>'0' order by `tin` desc ");
$kol=mysql_num_rows($res);
}

  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$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,"toout");
$ins=mysql_result($res,$i,"ins");
$outs=mysql_result($res,$i,"outs");

echo "<b><a href=\"out.php?go=$idss\">$title</a></b>    <a href=\"oper_in.php?c=$where_data&amp;id=$idss\">[+]</a><br/>[$link]<br/>$about<br/>
<u>&#x0417;a &#x043C;ec&#x044F;&#x0446;:    B: $ins | &#x0418;&#x0437;: $outs</u><br/><u>Ce&#x0433;o&#x0434;&#x043D;&#x044F;:    B: $tin | &#x0418;&#x0437;: $toout</u><br/><br/>";
}

If ($page>1) {  $pagep=$page-1;  echo "
<a href=\"katalog.php?page=$pagep&amp;c=$where_data\">Ha&#x0437;a&#x0434;</a><br/>"; }
If ((ceil($kol/$kolich_adm))>$page) { $page++;    echo "

<a href=\"katalog.php?page=$page&amp;c=$where_data\">&#x0414;a&#x043B;&#x044C;&#x0448;e</a><br/>";}

$totalp=ceil($kol/5);
if ($totalp>1) {
  echo "<br/>страница</small> <input type=\"text\" name=\"pg\" size=\"2\" value=\"$totalp\" format=\"*N\"/><small>
<anchor> перейти
<go href=\"katalog.php?c=$where_data\" method=\"get\">
<postfield name=\"page\" value=\"$(pg)\"/>
</go>
</anchor><br/>Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: $totalp";
  }
  if ($totalp<2) {
 print  'Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: 1'; }

print '<br/><br/><a href="index.php">Ha &#x0433;&#x043B;a&#x0432;&#x043D;y&#x044E;</a><br/><br/>';
function gettime()
{
     $part_time = explode(' ', microtime());
     $real_time = $part_time[1].substr($part_time[0], 1);
     return $real_time;
}

$end = gettime();


   echo "[".round(($end - $start), 4)."] ";
   print '
</small>
</p>'; 
?></card></wml>