View file golos/index.php

File size: 800B
<?php
@session_start();


$title='Голосования';

require"../system/config.php";

require"../system/func.php";

require"../system/head.php";

require"../system/error.php";

echo'<div class="i">'.$title.'
</div>';
$arr=file('data.dat');
$c=count($arr);
if(SID) $si='&amp;'.SID; else $si=null;
function show($i){
 $na=explode('||',$GLOBALS['arr'][$i+1]);
 $va=explode('||',$GLOBALS['arr'][$i+2]);
 $c=count($na);
 $p=0;
 for($n=0;$n<$c;$n++){
  $p=$p+$va[$n];
 }
 $p=$p/100;
 print '<u>'.$GLOBALS['arr'][$i].'</u><br /><small>';
 for($n=0;$n<$c;$n++){
  print('<a href="vote.php?q='.($i/3).'&amp;v='.$n.$GLOBALS['si'].'">'.$na[$n].'</a>: '.round($va[$n]/$p,1).'%<br />');
 }
print '</small><hr />';
}
for($i=0;$i<$c;$i=$i+3){
 show($i);
}
$_SESSION['e']=true;

require"../system/foot.php";
?>