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

Размер файла: 2.88Kb
<?
///////////////////////////////////////////////////////////////////////////////////////////
/////        
/////                            Made by   :  VANTUZ
/////                              E-mail  :  [email protected]        
/////                            WEB-site  :  http://www.pizdec.ru
/////                            WAP-site  :  http://wap.pizdec.ru
/////                             Skripts  :  http://wap.pizdec.ru/skripts
/////        
//////////////////////////////////////////////////////////////////////////////////////////////
Error_Reporting(E_ALL & ~E_NOTICE);
session_start("$HTTP_USER_AGENT");
header("Content-type:text/vnd.wap.wml;charset=utf-8");
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\">";
////////// запись данных
if(empty($_SESSION))
{
$_SESSION['username'] = $vote;		
$file = fopen("votes/$id.dat", "r+");
$data = file("votes/$id.dat");
list($g1,$g2,$g3,$g4,$g5,$g6,$g7,$g8,$g9,$g10) = explode("|", $data[0]);
if ($vote == "1") { $g1++;}
if ($vote == "2") { $g2++;}
if ($vote == "3") { $g3++;}
if ($vote == "4") { $g4++;}
if ($vote == "5") { $g5++;}
if ($vote == "6") { $g6++;}
if ($vote == "7") { $g7++;}
if ($vote == "8") { $g8++;}
if ($vote == "9") { $g9++;}
if ($vote == "10") { $g10++;}
$zapis = "$g1|$g2|$g3|$g4|$g5|$g6|$g7|$g8|$g9|$g10";
fputs($file, $zapis);
/////////// вывод данных
$file = fopen("votes/$id.dat", "r");
$data = file("votes/$id.dat");

list($g1,$g2,$g3,$g4,$g5,$g6,$g7,$g8,$g9,$g10) = explode("|", $data[0]);
$summa = $g1+$g2+$g3+$g4+$g5+$g6+$g7+$g8+$g9+$g10;
$procent1=round($g1*100/$summa); $procent2=round($g2*100/$summa); $procent3=round($g3*100/$summa); $procent4=round($g4*100/$summa);$procent5=round($g5*100/$summa); $procent6=round($g6*100/$summa); $procent7=round($g7*100/$summa); $procent8=round($g8*100/$summa);$procent9=round($g9*100/$summa); $procent10=round($g10*100/$summa);
$per2=round($g2*2); $per3=round($g3*3);  $per4=round($g4*4); $per5=round($g5*5);  
$per6=round($g6*6); $per7=round($g7*7);  $per8=round($g8*8); $per9=round($g9*9); $per10=round($g10*10);

$pertotal=round($g1+$per2+$per3+$per4+$per5+$per6+$per7+$per8+$per9+$per10);   
$per=round($pertotal/$summa,2);
print "<wml><card title=\"WAP.PIZDEC.RU\"><p align=\"left\">Ваша оценка принята!<br/>Проголосовало: $summa<br/>
Из них:<br/>
1 - $g1 ($procent1%)<br/>
2 - $g2 ($procent2%)<br/>
3 - $g3 ($procent3%)<br/>
4 - $g4 ($procent4%)<br/>
5 - $g5 ($procent5%)<br/>
6 - $g6 ($procent6%)<br/>
7 - $g7 ($procent7%)<br/>
8 - $g8 ($procent8%)<br/>
9 - $g9 ($procent9%)<br/>
10 - $g10 ($procent10%)<br/>	
	
<br/>Рейтинг: $per/$summa
</p></card></wml>"; }else {
print "<wml><card title=\"Error\"><p><small><b>Вы уже проголосовали! </b></small></p></card></wml>";
} exit;?>