Ultime Affluenze"; echo "
"._ORE." $ore,$minuti "._DEL." $giorno/$mese/$anno
"; # $res1 = mysql_query("select sum(t1.voti_complessivi), t2.num_gruppo , t2.id_gruppo from ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.orario='$orario' and t1.data='$data' group by t2.num_gruppo,t2.id_gruppo order by t2.num_gruppo " , $dbi); #modifica del 26giugno 09 per gestione circoscrizionali if($genere==0) $res1 = mysql_query("select sum(t1.voti_complessivi), t2.num_gruppo , t2.id_gruppo from ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.orario='$orario' and t1.data='$data' group by t2.num_gruppo,t2.id_gruppo order by t2.num_gruppo " , $dbi); else $res1 = mysql_query("select sum(t3.voti_complessivi),0,0 from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos",$dbi); #fine modifica while(list($voti_t, $num_gruppo,$id_gruppo) = mysql_fetch_row($res1)) { $query="select sum(t3.voti_complessivi) from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos"; if ($genere==0){$query.=" and t3.id_gruppo=$id_gruppo";} $res_aff=mysql_query($query, $dbi); $voti_numero=mysql_num_rows($res_aff); $query="select sum(t1.maschi+t1.femmine) from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos"; if ($genere==0){$query.=" and id_gruppo=$id_gruppo";} $res1234=mysql_query($query, $dbi); list($tot)=mysql_fetch_row($res1234); if ($tot) $perc=number_format($voti_t*100/$tot,2); else {$tot=0;$perc="0.00";} $resto=100-$perc; if ($genere==0){echo "
referendum n. $num_gruppo\"Sample Tutte le affluenze "; } } } ?>