Просмотр файла top/index.php

Размер файла: 3.29Kb
<?

header ("Content-type:text/vnd.wap.wml; charset=utf-8");
require ("db.php");

$arr = mysql_query("select * from top where today>0 order by today desc;");
$i = mysql_num_rows($arr);

while ($data = mysql_fetch_array($arr))
{
if($id == $data['id'])
$start = count($ids);
$title[] = $data['title'];
$link[] = $data['link'];
$ids[] = $data['id'];
$opis[] = $data['opis'];
$today[] = $data['today'];
$all[] = $data['all'];
$cin[] = $data['cin'];
$out[] = $data['out'];
$tops = $data['tops'];

}

function go()

{
print "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title=\"AmLet - top\">";
$H1=date("H",time())+1;
$i=date("i",time());
$s=date("s",time());
$time=date("$H1:i:s",time());
print "<p align=\"center\">
<small><small>$time</small></small></p>";
print "<p align=\"left\">";

$query_allcount = @mysql_query("select `id` from `top`;");
$result = mysql_query("select * from `top` where today>0 order by today desc");
$v = @mysql_num_rows($result);


if($v==0){print "<small>&#1053;&#1072; &#1076;&#1072;&#1085;&#1085;&#1099;&#1081; &#1084;&#1086;&#1084;&#1077;&#1085;&#1090; &#1074; &#1090;&#1086;&#1087;&#1077; &#1087;&#1091;&#1089;&#1090;&#1086; :))</small><br/>";}else{
print "<small><b>&#1059;&#1095;&#1072;&#1089;&#1090;&#1074;&#1091;&#1102;&#1090; $v &#1080;&#1079; ".@mysql_num_rows($query_allcount)."</b></small><br/>";}
};

function ending()
{
print "</card></wml>";
};

go();
$count=$i;
$count1=$count;
if(empty($start))
$start=0;
$start=intval($start);
if($start<0)
$start=0;
if($count>$start+5) $count=$start+5;
for($i=$start;$i<$count;$i++)
{
$tops=$i+1;


@mysql_query("UPDATE `top` SET `tops` = '$tops' WHERE `id` ='$ids[$i]' LIMIT 1 ;");
print "<small><b>$tops::</b></small>
    <small><a href=\"info.php?id=$ids[$i]\">[i]</a></small>
    <small>||<a href=\"out.php?id=$ids[$i]\">$title[$i]</a></small><br/>";
    print "<small><u>&#1054;&#1087;&#1080;&#1089;&#1072;&#1085;&#1080;&#1077;:</u> $opis[$i]</small><br/>
    <small><u>&#1057;&#1077;&#1075;&#1086;&#1076;&#1085;&#1103;:</u>  $today[$i]</small><br/>
    <small><u>&#1042;&#1089;&#1077;&#1075;&#1086;:</u> $all[$i]</small><br/>
    <small><u>&#1048;&#1079; &#1090;&#1086;&#1087;&#1072;:</u>  $out[$i]</small><br/>
    <small><u>&#1042; &#1090;&#1086;&#1087;:</u>  $cin[$i]</small><br/>
    <small><b>:::::</b></small><br/>";}


if($start!=0)
{
print "<br/><small><a href=\"index.php?start=".($start-5)."\">&#1055;&#1088;&#1077;&#1076;.5</a></small>";
}
if($count1>$start+5)
{
print "<br/><small><a href=\"index.php?start=".($start+5)."\">C&#1083;&#1077;&#1076;.5</a></small>";
}

print "<br/><small><a href=\"enter.php\">&#1055;&#1088;&#1086;&#1092;&#1080;&#1083;&#1100;</a></small><br/>";
print "<small><a href=\"reg.wml\">&#x0420;&#x0435;&#x0433;&#x0438;&#x0441;&#x0442;&#x0440;&#x0430;&#x0446;&#x0438;&#x044F;</a></small><br/>";
print "<small><a href=\"../index.php\">amlet.com.ru</a></small><br/>";
print "<a href=\"http://amlet.com.ru/top/in.php?id=1\"><img src=\"http://amlet.com.ru/top/c.php?id=1\" alt=\"AmLet\"/></a>";
print "</p>";


ending();

@mysql_close();
?>