Changeset 265 for trunk/client/modules/Elezioni/blocchi/pie_affluenze.php
- Timestamp:
- Apr 13, 2019, 8:05:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/blocchi/pie_affluenze.php
r116 r265 21 21 // numero sezioni scrutinate 22 22 23 $res2 = mysql_query("select t1.* from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos",$dbi); 24 $sezioni=mysql_num_rows($res2); 23 $sql="select t1.* from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos"; 24 $res2 = $dbi->prepare("$sql"); 25 $res2->execute(); 25 26 26 $res = mysql_query("select orario,data from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' order by data desc,orario desc limit 1", $dbi); 27 $sezioni=$res2->fetch(PDO::FETCH_NUM); 28 29 $sql="select orario,data from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' order by data desc,orario desc limit 1"; 30 $res = $dbi->prepare("$sql"); 31 $res->execute(); 32 27 33 if($res){ 28 34 29 while(list($orario,$data) = mysql_fetch_row($res)) {35 while(list($orario,$data) = $res->fetch(PDO::FETCH_NUM)) { 30 36 list ($ore,$minuti,$secondi)=explode(':',$orario); 31 37 list ($anno,$mese,$giorno)=explode('-',$data); … … 33 39 34 40 35 $res1 = mysql_query("select t3.* 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 group by t3.id_sez ",$dbi); 36 $numero=mysql_num_rows($res1); 41 $sql="select t3.* 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 group by t3.id_sez "; 42 $resl = $dbi->prepare("$sql"); 43 $resl->execute(); 44 45 $numero=$res1->rowCount(); 37 46 38 47 echo "<h5>Ultime Affluenze</h5>"; … … 44 53 # $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); 45 54 #modifica del 26giugno 09 per gestione circoscrizionali 46 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); 47 else 48 $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); 55 if($genere==0) { $sql="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 " ; 56 $resl = $dbi->prepare("$sql"); 57 $resl->execute(); 58 59 }else{ 60 $sql="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"; 61 $resl = $dbi->prepare("$sql"); 62 $resl->execute(); 63 } 49 64 #fine modifica 50 65 … … 53 68 54 69 55 while(list($voti_t, $num_gruppo,$id_gruppo) = mysql_fetch_row($res1)) {70 while(list($voti_t, $num_gruppo,$id_gruppo) = $res1->fetch(PDO::FETCH_NUM)) { 56 71 57 $ 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";72 $sql="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"; 58 73 if ($genere==0){$query.=" and t3.id_gruppo=$id_gruppo";} 59 $res_aff=mysql_query($query, $dbi); 60 $voti_numero=mysql_num_rows($res_aff); 74 $res_aff = $dbi->prepare("$sql"); 75 $res_aff->execute(); 76 77 $voti_numero=$res_aff->rowCount(); 61 78 62 $ 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";79 $sql="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"; 63 80 64 81 if ($genere==0){$query.=" and id_gruppo=$id_gruppo";} 65 $res1234=mysql_query($query, $dbi); 66 list($tot)=mysql_fetch_row($res1234); 82 $res1234 = $dbi->prepare("$sql"); 83 $res1234->execute(); 84 85 list($tot)=$res1234->fetch(PDO::FETCH_NUM); 67 86 if ($tot) 68 87 $perc=number_format($voti_t*100/$tot,2);
Note:
See TracChangeset
for help on using the changeset viewer.