Changeset 139 for trunk/client/modules/Elezioni
- Timestamp:
- May 6, 2012, 8:53:42 PM (13 years ago)
- Location:
- trunk/client/modules/Elezioni
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/funzioni.php
r105 r139 493 493 } 494 494 495 # funzione per verifica se esiste il voto disgunto tra sindaco e lista nelle amministrative siciliane 496 function isdisgiunto(){ 497 global $prefix,$dbi,$id_cons,$limite,$fascia,$ops; 498 #voti di lista e di gruppo completamente disgiunti 499 $result = mysql_query("select infdisgiunto, supdisgiunto from ".$prefix."_ele_conf as t2 left join ".$prefix."_ele_cons_comune as t1 on t1.id_conf=t2.id_conf where id_cons = '$id_cons' ", $dbi); 500 $glsep=''; 501 if ($result) { 502 list($infdis,$supdis)=mysql_fetch_row($result); 503 if((($fascia>$limite and $supdis) or ($fascia<$limite and $infdis)) and $ops==3) 504 $glsep='_lista'; 505 } 506 return $glsep; 507 } 508 509 495 510 ?> -
trunk/client/modules/Elezioni/language/lang-en.php
r116 r139 23 23 define("_SOLO_GRUPPO","Ballots to the group only"); 24 24 define("_CONSIGLIO","Provincial Council"); 25 define("_ASOLO_GRUPPO","to the President only"); 25 26 break; 26 27 case 2: … … 43 44 define("_SOLO_GRUPPO","Ballots for candidate Mayor only"); 44 45 define("_CONSIGLIO","City Council"); 46 define("_ASOLO_GRUPPO","to the Mayor only"); 45 47 break; 46 48 case 4: … … 255 257 define("_CHIUSA","CLOSED"); 256 258 define("_ASOLA_LISTA","to the List"); 257 define("_ASOLO_GRUPPO","to the Groups only"); 259 260 define("_SOLO_LISTA","Only List"); 258 261 define("_COLLEGIO","district"); 259 262 define("_INFO","Information"); -
trunk/client/modules/Elezioni/language/lang-it.php
r129 r139 22 22 define("_A","a"); 23 23 define("_ASOLA_LISTA","Alle Liste"); 24 define("_ASOLO_GRUPPO","Ai Soli Gruppi"); 24 25 define("_SOLO_LISTA","Solo Lista"); 25 26 define("_UOMINI","Uomini"); 26 27 define("_DONNE","Donne"); … … 275 276 define("_VOTI_LISTA","Voti di lista"); 276 277 define("_CONSIGLIO","Consiglio Provinciale"); 278 define("_ASOLO_GRUPPO","Solo Presidente"); 277 279 break; 278 280 case 2: … … 297 299 define("_CONSIGLIO","Consiglio Comunale"); 298 300 define("_VOTI_LISTA","Voti di lista"); 301 define("_ASOLO_GRUPPO","Solo Sindaco"); 299 302 break; 300 303 case 4: -
trunk/client/modules/Elezioni/menu.php
r95 r139 26 26 27 27 // inizio tabella 28 echo "<table class=\"table-main\"> <tr>"; 29 28 echo "<table class=\"table-main\"><tr>"; 29 30 30 31 /*********************************** 31 32 Scelta Comune … … 35 36 { 36 37 $sqlcomu="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune and t2.chiusa<2 group by t1.id_comune,t1.descrizione order by t1.descrizione asc"; 38 37 39 $rescomu= mysql_query("$sqlcomu",$dbi); 38 40 $esiste_multi=mysql_num_rows($rescomu); -
trunk/client/modules/Elezioni/votanti.php
r127 r139 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' 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' 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' 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 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) = mysql_fetch_row($res)){ 271 299 // inserimento numeri di sez non scrutinate 272 300 while ($scrutinate < $num) { … … 274 302 $scrutinate++; 275 303 } 304 305 # voti sindaco, gruppo o presidente 306 $tab5="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id'"; 307 $res3 = mysql_query("$tab5", $dbi); 308 list($sindaco) = mysql_fetch_row($res3); 309 310 276 311 $scrutinate++; 277 312 // fine inserimento … … 281 316 list($votid,$votiu,$voti) = mysql_fetch_row($res2); 282 317 // $voti=$votiu+$votid; 318 $tot_gruppo+=$sindaco; 283 319 $tot_u+=$votiu; 284 320 $tot_d+=$votid; … … 290 326 $tot_bianchi+=$bianchi; 291 327 $tot_contestati+=$contestati; 328 $tot_sololista+=$sololista; 292 329 $righe .= "<tr class=\"bggray2\"> 293 330 <td>$num</td> … … 295 332 <td>".number_format($votid,0,',','.')."</td> 296 333 <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 334 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){ 335 $righe .= "<td>".number_format($si,0,',','.')."</td>"; 336 337 if(isdisgiunto()){ 338 $righe .= "<td>".number_format($sindaco,0,',','.')."</td>"; 339 $righe .= "<td>".number_format($sololista,0,',','.')."</td>"; 340 } 341 $righe .= "<td>".number_format($no,0,',','.')."</td>"; 342 343 344 } 345 346 301 347 $righe .= "<td>".number_format($validi,0,',','.')."</td> 348 302 349 <td>$nulli</td> 303 350 <td>$bianchi</td> … … 320 367 $righet .= "<td>"._SI."</td><td>"._NO."</td>"; 321 368 } elseif ((($genere==5) or ($genere==3)) and $pag==1){ 322 $righet .= "<td>"._ASOLA_LISTA."</td><td>"._ASOLO_GRUPPO."</td>"; 369 $righet .= "<td>Voti "._LISTE."</td>"; 370 if(isdisgiunto()){ 371 $righet .= "<td>Voti "._PRESI."</td>"; 372 $righet .= "<td>"._SOLO_LISTA."</td>"; 373 } // voto disgiunto 374 $righet .= "<td>"._ASOLO_GRUPPO."</td>"; 375 323 376 } 324 377 if($totel==0) $totelrip="0.00"; else $totelrip=number_format($tot_voti*100/$totel,2); … … 330 383 331 384 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>";385 <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 386 334 387 // se e' un referendum o una consultazione con raggruppamenti 335 388 336 389 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>"; 390 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){ 391 $righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(".number_format($tot_si*100/$tot_validi,2)."%)</i></td>"; 392 393 if(isdisgiunto()){ 394 $righet .="<td><b>".number_format($tot_gruppo,0,',','.')."</b><br /><i>(".number_format($tot_gruppo*100/$tot_validi,2)."%)</i></td>"; 395 $righet .="<td><b>".number_format($tot_sololista,0,',','.')."</b><br /><i>(".number_format($tot_sololista*100/$tot_validi,2)."%)</i></td>"; 396 } 397 398 399 $righet .="<td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(".number_format($tot_no*100/$tot_validi,2)."%)</i></td>"; 400 } 401 402 403 $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>" 404 .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 405 }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>"; 406 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){ 407 $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>";} 408 $righet .= "<td><b>0</b><br /><i>(0.00%)</i></td><td><b>" 409 .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 410 } 345 411 } … … 395 461 396 462 463 397 464 ############### stampa 398 465 if ($xls!='1' && $pdf!='1'){ … … 406 473 echo "$html \n"; 407 474 }elseif($pdf=='1'){ 475 476 408 477 $nomefile="$descr_cons votanti.pdf"; 409 410 $stampa ="$datipdf $html"; 478 479 480 481 482 483 484 $stampa ="<div style=\"margin:0 auto;text-align:center;\">$datipdf $html</div>"; 411 485 412 486 require_once('inc/hpdf403/html2pdf.class.php'); … … 414 488 $html2pdf->WriteHTML($stampa, isset($_GET['vuehtml'])); 415 489 $html2pdf->Output($nomefile); 416 } 490 491 492 } 493 494 417 495 418 496
Note:
See TracChangeset
for help on using the changeset viewer.