Changeset 384 for trunk/client/modules/Elezioni/votanti-inc.php
- Timestamp:
- Jan 24, 2023, 6:25:59 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/votanti-inc.php
r376 r384 19 19 if (isset($param['minsez'])) $minsez=intval($param['minsez']); else $minsez=''; 20 20 if (isset($param['id_lista'])) $id_lista=intval($param['id_lista']); else $id_lista=''; 21 if (isset($param['id_circ'])) $id_circ=intval($param['id_circ']); else $id_circ= '';21 if (isset($param['id_circ'])) $id_circ=intval($param['id_circ']); else $id_circ=0; 22 22 if (isset($param['csv'])) $csv=intval($param['csv']); else $csv=''; 23 23 if (isset($param['min'])) $min=intval($param['min']); else $min= 0; … … 52 52 $res->execute(); 53 53 list($tipo_cons,$genere,$id_cons) = $res->fetch(PDO::FETCH_NUM); 54 global $lang,$circo,$id_circ; 55 if(isset($circo)) $_SESSION['id_circ']=$id_circ; 56 if (isset($circo) and $circo) {$circos="and t2.id_circ='$id_circ'"; $circos4="and t4.id_circ='$id_circ'";} 57 else {$circos=''; $circos4='';} 54 58 if (isset($param['ops'])) $ops=$param['ops']; else $ops=''; 55 59 if (isset($param['pag'])) $pag=$param['pag']; else $pag=0; … … 69 73 //controllo_finale($id_cons); 70 74 71 global $ prefix, $dbi,$id_circ,$lang, $fascia, $limite, $votog;75 global $lang, $fascia, $limite, $votog; 72 76 include_once("modules/Elezioni/language/lang-$lang.php"); 73 77 # testata … … 176 180 $resg->execute(); 177 181 list($idg,$numg) = $resg->fetch(PDO::FETCH_NUM); 178 $sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede order by num_sez ";182 $sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circos order by num_sez "; 179 183 $res = $dbi->prepare("$sql"); 180 184 $res->execute(); 181 185 $max = $res->rowCount(); //quante sezioni? 182 $sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede order by num_sez ";186 $sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circos order by num_sez "; 183 187 $res = $dbi->prepare("$sql"); 184 188 $res->execute(); 185 189 $num_sez = $res->rowCount(); //quante sezioni? 186 for ($i=1;$i<=$num_sez;$i++){ 187 $sezione[$i]=$res->fetch(PDO::FETCH_BOTH); //inizializza l'array delle sezioni 188 $ar[$i]=0; 189 } 190 #for ($i=1;$i<=$num_sez;$i++){ 191 $i=1; 192 while ($sezione[$i] = $res->fetch(PDO::FETCH_BOTH)) $ar[$i++]=0; 193 194 # $sezione[$i]=$res->fetch(PDO::FETCH_BOTH); //inizializza l'array delle sezioni 195 196 #} 190 197 $tab3="_ele_voti_lista"; 191 198 if ($genere>0) { //se non e' un referendum 192 199 if (!($genere==4) and $pag==0){ //se non e' una lista uninominale ed e' la prima pagina 193 $tab="SELECT 0,t2.id_sez,t2.num_sez,t2.validi,'0','0',t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,'0',t2.voti_nulli FROM ".$prefix."_ele_sezioni as t2 left join ".$prefix."_ele_sede as t4 on (t2.id_sede=t4.id_sede) where t2.id_cons='$id_cons' and t2.validi+t2.nulli+t2.bianchi+t2.contestati>0 group by t2.id_sez,t2.num_sez,t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,t2.voti_nulli order by t2.num_sez ";200 $tab="SELECT 0,t2.id_sez,t2.num_sez,t2.validi,'0','0',t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,'0',t2.voti_nulli FROM ".$prefix."_ele_sezioni as t2 left join ".$prefix."_ele_sede as t4 on (t2.id_sede=t4.id_sede) where t2.id_cons='$id_cons' and t2.validi+t2.nulli+t2.bianchi+t2.contestati>0 $circos4 group by t2.id_sez,t2.num_sez,t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,t2.voti_nulli order by t2.num_sez "; 194 201 }else{ // e' una lista uninominale o la seconda pagina 195 202 # voto disgiunto regione sicilia aggiunge il campo solo lista … … 198 205 FROM ".$prefix."_ele_sezioni as t1 left join ".$prefix.$tab3." as t2 on (t1.id_sez=t2.id_sez) 199 206 left join ".$prefix."_ele_sede as t4 on (t1.id_sede=t4.id_sede) 200 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t1.id_sez,t1.num_sez,t1.solo_gruppo,t1.solo_lista,t1.validi,t1.nulli,t1.bianchi,t1.contestati,t4.id_circ,t1.id_sede,t1.voti_nulli order by t1.num_sez ";207 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons $circos4 group by t1.id_sez,t1.num_sez,t1.solo_gruppo,t1.solo_lista,t1.validi,t1.nulli,t1.bianchi,t1.contestati,t4.id_circ,t1.id_sede,t1.voti_nulli order by t1.num_sez "; 201 208 }else{ 202 209 $tab="SELECT '0',t1.id_sez,t1.num_sez,sum(t2.voti),t1.solo_gruppo,'0',t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t1.id_sede,'0',t1.voti_nulli 203 210 FROM ".$prefix."_ele_sezioni as t1 left join ".$prefix.$tab3." as t2 on (t1.id_sez=t2.id_sez) 204 211 left join ".$prefix."_ele_sede as t4 on (t1.id_sede=t4.id_sede) 205 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t1.id_sez,t1.num_sez,t1.solo_gruppo,t1.validi,t1.nulli,t1.bianchi,t1.contestati,t4.id_circ,t1.id_sede,t1.voti_nulli order by t1.num_sez ";212 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons $circos4 group by t1.id_sez,t1.num_sez,t1.solo_gruppo,t1.validi,t1.nulli,t1.bianchi,t1.contestati,t4.id_circ,t1.id_sede,t1.voti_nulli order by t1.num_sez "; 206 213 } 207 214 } … … 213 220 FROM ".$prefix."_ele_voti_ref as t1 left join ".$prefix."_ele_sezioni as t2 on (t1.id_sez=t2.id_sez) 214 221 left join ".$prefix."_ele_gruppo as t3 on (t1.id_gruppo=t3.id_gruppo) left join ".$prefix."_ele_sede as t4 on (t2.id_sede=t4.id_sede) 215 where t1.id_cons='$id_cons' and t1.id_gruppo='$idg' order by t2.num_sez ";222 where t1.id_cons='$id_cons' and t1.id_gruppo='$idg' $circos4 order by t2.num_sez "; 216 223 $riga1 = "<div style=\"margin:0px auto;text-align:center;\">"; 217 224 $riga1 .="<h2>"._DETTAGLIO." "._VOTIE."</h2></div>"; … … 257 264 $nulli+=$votinulli; 258 265 // inserimento numeri di sez non scrutinate 259 while ($s crutinate< $num) {260 $righe.= "<tr><td><span style=\"color: rgb(255, 0, 0);\"> $scrutinate</span></td></tr>\n";266 while ($sezione[$scrutinate][1] < $num) { 267 $righe.= "<tr><td><span style=\"color: rgb(255, 0, 0);\">".$sezione[$scrutinate][1]."</span></td></tr>\n"; 261 268 $scrutinate++; 262 269 } … … 308 315 <td>$contestati</td></tr>"; 309 316 } 310 if ($num<$num_sez) { 311 for (;$scrutinate<=$num_sez;$scrutinate++) { 312 $righe .= "<tr><td>"; 313 $righe .="<span style=\"color: rgb(255, 0, 0);\">$scrutinate</span></td></tr>"; 317 #if ($num<$num_sez) 318 if(isset($sezione[$scrutinate][1]) and $num<$sezione[$scrutinate][1]) { 319 while(isset($sezione[$scrutinate][1])) { 320 $righe .= "<tr><td align=\"center\">"; 321 $righe .="<span style=\"color: rgb(255, 0, 0);\">".$sezione[$scrutinate++][1]."</span></td></tr>"; 314 322 } 315 323 }
Note:
See TracChangeset
for help on using the changeset viewer.