\n"; echo "\n\n"; echo "\n"; echo "".htmlspecialchars($descr_com)." - $descr_cons\n"; echo "".htmlspecialchars($siteurl)."\n"; echo "".$sitename."\n"; echo "it-IT\n"; echo "".$adminmail."\n"; echo "".$now."\n\n"; echo "hourly\n"; echo "1\n"; echo "".$now."\n\n"; list ($gruppo,$pro)=grupporss(); for($x=0;$x\n"; echo "".$gruppo[$x]." ".$pro[$x] ."% \n"; echo "$siteurl/modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index\n"; echo "\n"; //echo "noreply@ciao.it\n"; echo "".$titolo."\n"; echo "".$date."\n"; echo "Postato da ".$sitename."\n"; echo "\n\n"; } echo "\n"; echo "\n"; // gruppo function grupporss(){ global $admin, $bgcolor1, $bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$id_cons_gen,$id_comune,$id_circ,$tipo_cons,$w,$l,$op,$siteistat,$flash; if ($genere!=0){$tab="ele_voti_gruppo";} if ($genere==4){$tab="ele_voti_lista";} if ($votog){$tab="ele_voti_lista";} $res = mysql_query("select * from ".$prefix."_$tab where id_cons='$id_cons' group by id_sez ",$dbi); if ($res) $numero=mysql_num_rows($res);else $numero=0; $res = mysql_query("select t2.* from ".$prefix."_ele_sezioni as t2, ".$prefix."_ele_sede as t1 where t2.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circondt1",$dbi); if ($res) $sezioni=mysql_num_rows($res);else $sezioni=0; if ($numero>0){ if ($genere!=0){ // tot voti if (!$circo) $restotv = mysql_query("select sum(voti) from ".$prefix."_$tab where id_cons=$id_cons ", $dbi); if ($votog) $restotv = mysql_query("select sum(voti) from ".$prefix."_ele_voti_lista where id_cons=$id_cons ", $dbi); list($tot) = mysql_fetch_row($restotv); $i=0; // lista o gruppo if ($genere!=4){ if ($votog){ $res = mysql_query("select t1.id_gruppo, t1.num_gruppo, t1.descrizione, sum(t2.voti) as somma from ".$prefix."_ele_gruppo as t1, ".$prefix."_ele_voti_lista as t2, ".$prefix."_ele_lista as t3 where t1.id_cons='$id_cons' and t2.id_lista=t3.id_lista and t1.id_gruppo=t3.id_gruppo group by t1.id_gruppo order by somma desc", $dbi);$cosa='id_gruppo'; }else{ $res = mysql_query("select t1.id_gruppo, t1.num_gruppo, t1.descrizione, sum(t2.voti) as somma from ".$prefix."_ele_gruppo as t1 left join ".$prefix."_$tab as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons $circondt1 group by t2.id_gruppo order by somma desc", $dbi);$cosa='id_gruppo'; } }else{ $res = mysql_query("select t1.id_lista, t1.num_lista, t1.descrizione, sum(t2.voti) as somma from ".$prefix."_ele_lista as t1 left join ".$prefix."_$tab as t2 on (t1.id_lista=t2.id_lista) where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t2.id_lista order by somma desc", $dbi);$cosa='id_lista'; } $gruppinum=mysql_num_rows($res); $altrivoti=0; while (list($id,$num,$descrizione,$voti) = mysql_fetch_row($res)){ // funz per il taglio corretto della frase 13 feb 2007 $gruppo[$i]=substr($descrizione,0,25); //if (strlen($descrizione)>25) $gruppo[$i].="..."; $pro[$i]=number_format($voti*100/$tot,2); $i++; } $titolo=""._PERCE." "._VOTIE.""; return array($gruppo,$pro); } } } ?>