File size: 2.82Kb
<?php
###########################################################################
## -=FERNUS=- ##
## --------------- ##
## http://sekis.us ##
## *-*-*-* ##
## *Колян* ##
## ICQ: 42-11-04-014 ##
## - - - - - ##
## Скрипт: Опроса/Голосований ##
## - - - - - ##
## Любые изменения кода скрипта, его перепродажа (СКРИПТ ВЫЛОЖЕН ##
## БЕСПЛАТНО)-ЗАПРЕЩЕННО и приследуется Мной и Законом об ##
## Авторских Правах!!! ##
###########################################################################
//START TIMER
list($msec, $sec) = explode(chr(32), microtime());
$headtime = $sec + $msec;
//ERROR REPORTING LEVEL
error_reporting(0);
//MySQL
include("cfg.php");
//TITLE
$title = "Рейтинг";
@$id = intval($_GET['id']);
@$mod = $_GET['mod'];
///////////////////////////////////////////////////////
//WML VERSION
///////////////////////////////////////////////////////
header("Content-type: text/vnd.wap.wml; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version='1.0' encoding='UTF-8'?>\n";
echo "<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.3//EN' 'http://www.wapforum.org/DTD/wml13.dtd'><wml>\n";
echo "<head><meta http-equiv='Cache-Control' content='no-cache' forua='true'/></head>\n";
echo "<card id='catalogue' title='".$title."'>\n<p align='left'><small>\n";
echo "<b>Рейтинг:</b><br/><br/>";
$sql2 = mysql_query("SELECT * FROM `".$opros."` ORDER BY `golos` DESC;");
if(mysql_affected_rows() == 0)
{
echo "Контендентов нет!<br/>\n";
}
$sql3 = mysql_query("SELECT SUM(`golos`) FROM `".$opros."`;");
$a = mysql_result($sql3, 0);
while($opr2 = mysql_fetch_array($sql2))
{
$name = $opr2['name'];
$gl = $opr2['golos'];
@$pro = $gl/$a*100;
@$pro = round($pro, 1);
echo "<u>".$name."</u>: <b>".$gl."</b> / <b>".$pro."%</b><br/>";
}
echo "- - -<br/><a href=\"./index.php\">Назад</a><br/>";
//STOP TIMER
list($msec, $sec) = explode(chr(32), microtime());
echo "<small>[".round(($sec + $msec) - $headtime, 5)."]</small><br/>\n";
echo "</small></p></card></wml>";
?>