- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/votanti.php
r127 r142 220 220 $tab3="_ele_voti_lista"; 221 221 if ($genere>0) { //se non e' un referendum 222 223 224 222 225 if (!($genere==4) and $pag==0){ //se non e' una lista uninominale ed e' la prima pagina 223 $tab="SELECT 0,t2.id_sez,t2.num_sez,t2.validi,'0',t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,'0' 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 order by t2.num_sez "; 226 227 $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 order by t2.num_sez "; 224 228 225 229 }else{ // e' una lista uninominale o la seconda pagina 226 $tab="SELECT '0',t1.id_sez,t1.num_sez,sum(t2.voti),t1.solo_gruppo,t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t1.id_sede,'0' 230 231 232 233 # voto disgiunto regione sicilia aggiunge il campo solo lista 234 if(isdisgiunto()){ 235 $tab="SELECT '0',t1.id_sez,t1.num_sez,sum(t2.voti),t1.solo_gruppo,t1.solo_lista,t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t1.id_sede,'0',t1.voti_nulli 227 236 FROM ".$prefix."_ele_sezioni as t1 left join ".$prefix.$tab3." as t2 on (t1.id_sez=t2.id_sez) 228 237 left join ".$prefix."_ele_sede as t4 on (t1.id_sede=t4.id_sede) 229 238 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t2.id_sez order by t1.num_sez "; 239 }else{ 240 241 $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 242 FROM ".$prefix."_ele_sezioni as t1 left join ".$prefix.$tab3." as t2 on (t1.id_sez=t2.id_sez) 243 left join ".$prefix."_ele_sede as t4 on (t1.id_sede=t4.id_sede) 244 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t2.id_sez order by t1.num_sez "; 245 } 230 246 } 231 247 248 249 232 250 $riga1 = ""; 233 251 if($pag==0)$riga1 .="<h2>"._DETTAGLIO." "._VOTIE."</h2>"; 234 else $riga1 .="<h 2>"._DETTAGLIO." "._VOTIE." "._ASOLA_LISTA."</h2>";235 236 }else{ // e' un referendum 237 $tab="SELECT t1.id_gruppo,t1.id_sez,t2.num_sez,t1.si,t1.no, t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t2.id_sede,t3.num_gruppo252 else $riga1 .="<h4>"._DETTAGLIO." "._VOTIE." "._ASOLA_LISTA."</h4>"; 253 254 }else{ // e' un referendum --> t3.id_gruppo vuota per allineare il while (da rifare con array) 255 $tab="SELECT t1.id_gruppo,t1.id_sez,t2.num_sez,t1.si,t1.no,'0',t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t2.id_sede,t3.num_gruppo,t1.voti_nulli 238 256 FROM ".$prefix."_ele_voti_ref as t1 left join ".$prefix."_ele_sezioni as t2 on (t1.id_sez=t2.id_sez) 239 257 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) … … 259 277 $riga3 .= "<td>"._SI."</td><td>"._NO."</td>"; 260 278 } elseif ((($genere==5) or ($genere==3)) and $pag==1){ 261 $riga3 .= "<td>"._ASOLA_LISTA."</td><td>"._ASOLO_GRUPPO."</td>"; 262 } 279 $riga3 .= "<td>Voti "._LISTE."</td>"; 280 if(isdisgiunto()){ 281 $riga3 .= "<td>Voti "._PRESI."</td>"; 282 $riga3 .= "<td>"._SOLO_LISTA."</td>"; 283 284 285 } // voto disgiunto 286 $riga3 .= "<td>"._ASOLO_GRUPPO."</td>"; 287 } 288 263 289 $riga3 .= "<td>"._VALIDI."</td><td>"._NULLI."</td><td>"._BIANCHI."</td><td>"._CONTESTATI."</td>" 264 290 ."</tr>\n"; … … 268 294 $scrutinate=1; 269 295 $tot_u=0;$tot_d=0;$tot_voti=0; $tot_si=0;$tot_no=0;$tot_validi=0;$tot_nulli=0;$tot_bianchi=0;$tot_contestati=0; 270 while (list($id_gruppo,$id,$num,$si,$no,$validi,$nulli,$bianchi,$contestati,$id_circ,$id_sede,$gruppo) = mysql_fetch_row($res)){ 296 $tot_sololista=0;$tot_gruppo=0; 297 #$si e $no sono valide anche per voti lista e solo gruppo per i non referendum 298 while (list($id_gruppo,$id,$num,$si,$no,$sololista,$validi,$nulli,$bianchi,$contestati,$id_circ,$id_sede,$gruppo,$votinulli) = mysql_fetch_row($res)){ 299 $nulli+=$votinulli; 271 300 // inserimento numeri di sez non scrutinate 272 301 while ($scrutinate < $num) { … … 274 303 $scrutinate++; 275 304 } 305 306 # voti sindaco, gruppo o presidente 307 $tab5="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id'"; 308 $res3 = mysql_query("$tab5", $dbi); 309 list($sindaco) = mysql_fetch_row($res3); 310 311 276 312 $scrutinate++; 277 313 // fine inserimento … … 281 317 list($votid,$votiu,$voti) = mysql_fetch_row($res2); 282 318 // $voti=$votiu+$votid; 319 $tot_gruppo+=$sindaco; 283 320 $tot_u+=$votiu; 284 321 $tot_d+=$votid; … … 290 327 $tot_bianchi+=$bianchi; 291 328 $tot_contestati+=$contestati; 329 $tot_sololista+=$sololista; 292 330 $righe .= "<tr class=\"bggray2\"> 293 331 <td>$num</td> … … 295 333 <td>".number_format($votid,0,',','.')."</td> 296 334 <td>".number_format($voti,0,',','.')."</td>"; 297 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){$righe 298 .= "<td>".number_format($si,0,',','.')."</td> 299 <td>".number_format($no,0,',','.')."</td>";} 300 335 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){ 336 $righe .= "<td>".number_format($si,0,',','.')."</td>"; 337 338 if(isdisgiunto()){ 339 $righe .= "<td>".number_format($sindaco,0,',','.')."</td>"; 340 $righe .= "<td>".number_format($sololista,0,',','.')."</td>"; 341 } 342 $righe .= "<td>".number_format($no,0,',','.')."</td>"; 343 344 345 } 346 347 301 348 $righe .= "<td>".number_format($validi,0,',','.')."</td> 349 302 350 <td>$nulli</td> 303 351 <td>$bianchi</td> … … 320 368 $righet .= "<td>"._SI."</td><td>"._NO."</td>"; 321 369 } elseif ((($genere==5) or ($genere==3)) and $pag==1){ 322 $righet .= "<td>"._ASOLA_LISTA."</td><td>"._ASOLO_GRUPPO."</td>"; 370 $righet .= "<td>Voti "._LISTE."</td>"; 371 if(isdisgiunto()){ 372 $righet .= "<td>Voti "._PRESI."</td>"; 373 $righet .= "<td>"._SOLO_LISTA."</td>"; 374 } // voto disgiunto 375 $righet .= "<td>"._ASOLO_GRUPPO."</td>"; 376 323 377 } 324 378 if($totel==0) $totelrip="0.00"; else $totelrip=number_format($tot_voti*100/$totel,2); … … 330 384 331 385 332 <tr class=\"td-vuotoc\"><td><b>"._TOT."</b></td><td><b>".number_format($tot_u,0,',','.')."</b><br /><i>(".$totmrip." %)</i></td><td><b>".number_format($tot_d,0,',','.')."</b><br /><i>(".$totfrip." %)</i></td><td><b>".number_format($tot_voti,0,',','.')."</b><br /><i>(".$totelrip."%)</i></td>";386 <tr class=\"td-vuotoc\"><td><b>"._TOT."</b></td><td><b>".number_format($tot_u,0,',','.')."</b><br /><i>(".$totmrip."%)</i></td><td><b>".number_format($tot_d,0,',','.')."</b><br /><i>(".$totfrip."%)</i></td><td><b>".number_format($tot_voti,0,',','.')."</b><br /><i>(".$totelrip."%)</i></td>"; 333 387 334 388 // se e' un referendum o una consultazione con raggruppamenti 335 389 336 390 if($tot_validi){ 337 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){$righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(".number_format($tot_si*100/$tot_validi,2)." %)</i></td><td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(".number_format($tot_no*100/$tot_validi,2)." %)</i></td>";} 338 $righet .= "<td><b>".number_format($tot_validi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_validi*100/$tot_voti,2):'0.00')." %)</i></td><td><b>" 339 .number_format($tot_nulli,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_nulli*100/$tot_voti,2):'0.00')." %)</i></td><td><b>".number_format($tot_bianchi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_bianchi*100/$tot_voti,2):'0.00')." %)</i></td><td><b>".number_format($tot_contestati,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_contestati*100/$tot_voti,2):'0.00')." %)</i></td></tr>"; 391 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){ 392 $righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(".number_format($tot_si*100/$tot_validi,2)."%)</i></td>"; 393 394 if(isdisgiunto()){ 395 $righet .="<td><b>".number_format($tot_gruppo,0,',','.')."</b><br /><i>(".number_format($tot_gruppo*100/$tot_validi,2)."%)</i></td>"; 396 $righet .="<td><b>".number_format($tot_sololista,0,',','.')."</b><br /><i>(".number_format($tot_sololista*100/$tot_validi,2)."%)</i></td>"; 397 } 398 399 400 $righet .="<td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(".number_format($tot_no*100/$tot_validi,2)."%)</i></td>"; 401 } 402 403 404 $righet .= "<td><b>".number_format($tot_validi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_validi*100/$tot_voti,2):'0.00')."%)</i></td><td><b>" 405 .number_format($tot_nulli,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_nulli*100/$tot_voti,2):'0.00')."%)</i></td><td><b>".number_format($tot_bianchi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_bianchi*100/$tot_voti,2):'0.00')."%)</i></td><td><b>".number_format($tot_contestati,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_contestati*100/$tot_voti,2):'0.00')."%)</i></td></tr>"; 340 406 }else{ 341 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){$righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(0.00 %)</i></td><td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(0.00 %)</i></td>";} 342 $righet .= "<td><b>0</b><br /><i>(0.00 %)</i></td><td><b>" 343 .number_format($tot_nulli,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_nulli*100/$tot_voti,2):'0,00')." %)</i></td><td><b>".number_format($tot_bianchi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_bianchi*100/$tot_voti,2):'0,00')." %)</i></td><td><b>".number_format($tot_contestati,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_contestati*100/$tot_voti,2):'0,00')." %)</i></td></tr>"; 407 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){ 408 $righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(0.00%)</i></td><td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(0.00%)</i></td>";} 409 $righet .= "<td><b>0</b><br /><i>(0.00%)</i></td><td><b>" 410 .number_format($tot_nulli,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_nulli*100/$tot_voti,2):'0,00')."%)</i></td><td><b>".number_format($tot_bianchi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_bianchi*100/$tot_voti,2):'0,00')."%)</i></td><td><b>".number_format($tot_contestati,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_contestati*100/$tot_voti,2):'0,00')."%)</i></td></tr>"; 344 411 } 345 412 } … … 395 462 396 463 464 397 465 ############### stampa 398 466 if ($xls!='1' && $pdf!='1'){ … … 406 474 echo "$html \n"; 407 475 }elseif($pdf=='1'){ 476 477 408 478 $nomefile="$descr_cons votanti.pdf"; 409 410 $stampa ="$datipdf $html"; 479 480 481 482 483 484 485 $stampa ="<div style=\"margin:0 auto;text-align:center;\">$datipdf $html</div>"; 411 486 412 487 require_once('inc/hpdf403/html2pdf.class.php'); … … 414 489 $html2pdf->WriteHTML($stampa, isset($_GET['vuehtml'])); 415 490 $html2pdf->Output($nomefile); 416 } 491 492 493 } 494 495 417 496 418 497
Note:
See TracChangeset
for help on using the changeset viewer.