Changeset 371 for trunk/client/modules/Elezioni/index.php
- Timestamp:
- Sep 3, 2022, 10:40:36 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/index.php
r370 r371 153 153 echo "<img src=\"modules.php?name=Elezioni&file=foto&id_comune=".$id_comune."\" alt=\"logo\" />"; 154 154 }else{ 155 echo "<img src=\"modules/Elezioni/images/logo.gif\" alt=\"logo\" />";155 echo "<img src=\"modules/Elezioni/images/logo.gif\" alt=\"logo\" height=\"100\" />"; 156 156 } 157 157 … … 459 459 $res1->execute(); 460 460 list($ind) = $res1->fetch(PDO::FETCH_NUM); 461 $indir=str_replace(" ","+",$ind." +".$descr_com."+".$cap);461 $indir=str_replace(" ","+",$ind.",+".$descr_com.",+".$cap); 462 462 echo "<br /><div><a href=\"https://maps.google.it/maps/place/".$indir."\"><img src=\"modules.php?name=Elezioni&file=foto&id_sede=".$id_sede."\" alt=\"mappa\" /></a></div>"; 463 463 }elseif($id_sede!='0' && $googlemaps=='1'){ … … 790 790 }else {$var1="";} 791 791 }else{ //referendum 792 $sql="select sum(si),sum(no),sum(validi),sum(bianchi),sum(nulli),sum(contestati) 792 $sql="select sum(si),sum(no),sum(validi),sum(bianchi),sum(nulli),sum(contestati) from ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_gruppo='$id_gruppo2'"; 793 793 $res_ref = $dbi->prepare("$sql"); 794 794 $res_ref->execute(); 795 list($voti_si,$voti_no,$validi,$bianchi,$nulli,$conte) = $res_ref->fetch(PDO::FETCH_NUM); 796 $sql="select t3.orario,t3.data from ".$prefix."_ele_rilaff as t1 left join ".$prefix."_ele_cons_comune as t2 on t1.id_cons_gen=t2.id_cons_gen left join ".$prefix."_ele_voti_parziale as t3 on t2.id_cons=t3.id_cons where t1.id_cons_gen='$id_cons_gen' and t2.id_cons='$id_cons' order by t3.data desc, t3.orario desc limit 0,1"; 797 $aff = $dbi->prepare("$sql"); 798 $aff->execute(); 799 list($ora,$data) = $aff->fetch(PDO::FETCH_NUM); 800 $sql="select sum(voti_complessivi) from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and orario='$ora' and data='$data' and id_gruppo='$id_gruppo2'"; 801 $tot_rel = $dbi->prepare("$sql"); 802 $tot_rel->execute(); 803 list($tot_relativo) = $tot_rel->fetch(PDO::FETCH_NUM); 795 if($res_ref->rowCount()) 796 list($voti_si,$voti_no,$validi,$bianchi,$nulli,$conte) = $res_ref->fetch(PDO::FETCH_NUM); 797 if(($voti_si+$voti_no+$validi+$bianchi+$nulli+$conte)>0) 798 { 799 $sql="select t3.orario,t3.data from ".$prefix."_ele_rilaff as t1 left join ".$prefix."_ele_cons_comune as t2 on t1.id_cons_gen=t2.id_cons_gen left join ".$prefix."_ele_voti_parziale as t3 on t2.id_cons=t3.id_cons where t1.id_cons_gen='$id_cons_gen' and t2.id_cons='$id_cons' order by t3.data desc, t3.orario desc limit 0,1"; 800 $aff = $dbi->prepare("$sql"); 801 $aff->execute(); 802 list($ora,$data) = $aff->fetch(PDO::FETCH_NUM); 803 $sql="select sum(voti_complessivi) from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and orario='$ora' and data='$data' and id_gruppo='$id_gruppo2'"; 804 $tot_rel = $dbi->prepare("$sql"); 805 $tot_rel->execute(); 806 list($tot_relativo) = $tot_rel->fetch(PDO::FETCH_NUM); 807 }else{ 808 $voti_si=0;$voti_no=0;$validi=0;$bianchi=0;$nulli=0;$conte=0;$tot_relativo=0; 809 } 804 810 // totale assoluto 805 811 $sql="select sum(maschi+femmine) from ".$prefix."_ele_sezioni where id_cons='$id_cons'"; … … 811 817 if($tot_assoluto) 812 818 $perc_tot=number_format(($tot_relativo*100)/$tot_assoluto,2); 813 819 else $perc_tot=0; 814 820 815 $tot_ref= 0;$tot_ref=$voti_si+$voti_no;821 $tot_ref=$voti_si+$voti_no; 816 822 if($tot_ref){ 817 $perc_si=number_format(($voti_si*100)/$tot_ref,2);818 $perc_no=number_format(($voti_no*100)/$tot_ref,2);823 $perc_si=number_format(($voti_si*100)/$tot_ref,2); 824 $perc_no=number_format(($voti_no*100)/$tot_ref,2); 819 825 }else{ $perc_si=0;$perc_no=0;} 820 826 $var1="<table class=\"table-80\" style=\"text-align: center;\">"; 821 if( $ora){827 if(isset($ora)){ 822 828 list ($ore,$minuti,$secondi)=explode(':',$ora); 823 829 $var1.= "<tr>
Note:
See TracChangeset
for help on using the changeset viewer.