Changeset 420 for trunk/client/modules/Elezioni/blocchi/gom_affluenze.php
- Timestamp:
- Jun 3, 2024, 10:32:50 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/blocchi/gom_affluenze.php
r412 r420 33 33 34 34 35 $sql="select t3.id_sez 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 "; 35 $sql="select t3.id_sez 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 "; 36 36 $res1 = $dbi->prepare("$sql"); 37 37 $res1->execute(); … … 65 65 while(list($voti_t, $num_gruppo,$id_gruppo) = $res1->fetch(PDO::FETCH_NUM)) { 66 66 67 $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";67 $sql="select 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"; 68 68 if ($genere==0){$sql.=" and t3.id_gruppo='$id_gruppo'";} 69 69 $res_aff = $dbi->prepare("$sql"); … … 72 72 $voti_numero=$res_aff->rowCount(); 73 73 74 $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"; 75 74 $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"; 76 75 if ($genere==0){$sql.=" and id_gruppo='$id_gruppo'";} 77 76 $res1234 = $dbi->prepare("$sql"); 78 77 $res1234->execute(); 79 80 list($tot)=$res1234->fetch(PDO::FETCH_NUM); 81 if ($tot) 78 list($tot)=$res1234->fetch(PDO::FETCH_NUM); 79 if ($tot) 82 80 $perc=number_format($voti_t*100/$tot,2); 83 81 else {$tot=0;$perc="0.00";} 84 if($voti_t<=$tot){ 85 82 if($voti_t<=$tot){ 86 83 $resto=100-$perc; 87 84 if ($genere==0){echo "<div style=\"text-align:center;margin-left: 10px;\"><hr/>referendum n. $num_gruppo</div>";} 88 echo "<div >sezioni n. $numero su $sezioni</div>";85 echo "<div style=\"text-align:center;\">sezioni n. $voti_numero su $sezioni</div><br/>"; 89 86 echo "<div style=\"text-align:center;\">"; 90 87 ##########################<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script> … … 94 91 google.charts.setOnLoadCallback(drawGauge); 95 92 96 var gaugeOptions = {min: 0, max: 100, yellowFrom: 100, yellowTo: 100,97 redFrom: 100, redTo: 100, minorTicks: 5};93 var gaugeOptions = {min: 0, max: 100, greenFrom: 0, greenTo: $perc, 94 yellowFrom: $perc, yellowTo: 100, minorTicks: 5}; 98 95 var gauge; 99 96 … … 104 101 gaugeData.setCell(0, 0, $perc); 105 102 106 gauge = new google.visualization.Gauge(document.getElementById('gauge_div '));103 gauge = new google.visualization.Gauge(document.getElementById('gauge_div$num_gruppo')); 107 104 gauge.draw(gaugeData, gaugeOptions); 108 105 } 109 106 </script>"; 110 echo "<div id=\"gauge_div \" style=\"width:130px; height: 130px; ;margin-left: 30px\"></div> <a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=affluenze_graf\">Tutte le affluenze</a>107 echo "<div id=\"gauge_div$num_gruppo\" style=\"width:130px; height: 130px;margin-left: auto;margin-right:auto;\"></div> <a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=affluenze_graf\">Tutte le affluenze</a> 111 108 </div>"; 112 109
Note:
See TracChangeset
for help on using the changeset viewer.