Changeset 318 for trunk/client/modules
- Timestamp:
- Jun 2, 2019, 10:04:20 PM (5 years ago)
- Location:
- trunk/client/modules/Elezioni
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/blocchi/gom_affluenze.php
r279 r318 63 63 64 64 $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"; 65 if ($genere==0){$ query.=" and t3.id_gruppo=$id_gruppo";}65 if ($genere==0){$sql.=" and t3.id_gruppo=$id_gruppo";} 66 66 $res_aff = $dbi->prepare("$sql"); 67 67 $res_aff->execute(); … … 71 71 $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"; 72 72 73 if ($genere==0){$ query.=" and id_gruppo=$id_gruppo";}73 if ($genere==0){$sql.=" and id_gruppo=$id_gruppo";} 74 74 $res1234 = $dbi->prepare("$sql"); 75 75 $res1234->execute(); -
trunk/client/modules/Elezioni/consiglieri.php
r317 r318 637 637 $z=0; 638 638 $arvin[$x][$pos++]=$desliste[$lst]; 639 $sql = "SELECT concat(substring(concat('0',t1.num_cand),-2),') ',t1.cognome,' ',substring(t1.nome from 1 for 1),'.') as descr,sum(t2.voti) as voti from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_voti_candidati as t2 where t1.id_lista='$id_lista' and t1.id_cand=t2.id_cand GROUP BY descr order by voti desc, num_cand";639 $sql = "SELECT concat(substring(concat('0',t1.num_cand),-2),') ',t1.cognome,' ',substring(t1.nome from 1 for 1),'.') as descr,sum(t2.voti) as voti from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_voti_candidati as t2 where t1.id_lista='$id_lista' and t1.id_cand=t2.id_cand GROUP BY descr order by voti desc,t1.num_cand"; 640 640 $res_can = $dbi->prepare("$sql"); 641 641 $res_can->execute(); … … 738 738 if(!$premio and $key==$gruppo) $arvin[$x][$pos++]=$desliste[$lst]; 739 739 else $arper[$x][$pos++]=$desliste[$lst]; 740 $sql = "SELECT concat(substring(concat('0',t1.num_cand),-2),') ',t1.cognome,' ',substring(t1.nome from 1 for 1),'.') as descr,sum(t2.voti) as voti from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_voti_candidati as t2 where t1.id_lista='$id_lista' and t1.id_cand=t2.id_cand GROUP BY descr order by voti desc, num_cand";740 $sql = "SELECT concat(substring(concat('0',t1.num_cand),-2),') ',t1.cognome,' ',substring(t1.nome from 1 for 1),'.') as descr,sum(t2.voti) as voti from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_voti_candidati as t2 where t1.id_lista='$id_lista' and t1.id_cand=t2.id_cand GROUP BY descr order by voti desc,t1.num_cand"; 741 741 $res_can = $dbi->prepare("$sql"); 742 742 $res_can->execute(); -
trunk/client/modules/Elezioni/funzioni.php
r279 r318 259 259 260 260 261 $sql="select id_ consfrom ".$prefix."_$tab where id_cons='$id_cons' group by id_sez ";261 $sql="select id_sez from ".$prefix."_$tab where id_cons='$id_cons' group by id_sez "; 262 262 $res = $dbi->prepare("$sql"); 263 263 $res->execute(); … … 288 288 and t2.id_lista=t3.id_lista 289 289 and t1.id_gruppo=t3.id_gruppo 290 group by t1.id_gruppo 290 group by t1.id_gruppo, t1.num_gruppo, t1.descrizione 291 291 order by somma desc"; 292 292 }else{ … … 295 295 left join ".$prefix."_ele_voti_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) 296 296 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons $circondt1 297 group by t 2.id_gruppo297 group by t1.id_gruppo, t1.num_gruppo, t1.descrizione 298 298 order by somma desc"; 299 299 } … … 303 303 left join ".$prefix."_$tab as t2 on (t1.id_lista=t2.id_lista) 304 304 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons 305 group by t 2.id_lista305 group by t1.id_lista, t1.num_lista, t1.descrizione 306 306 order by somma desc"; 307 307 } -
trunk/client/modules/Elezioni/gruppo.php
r317 r318 204 204 $res_sez->execute(); 205 205 } 206 if($res_sez ) list($tot_sez,$numsezmin,$numsezmax)=$res_sez->fetch(PDO::FETCH_NUM);206 if($res_sez->rowCount()) list($tot_sez,$numsezmin,$numsezmax)=$res_sez->fetch(PDO::FETCH_NUM); 207 207 $sql="SELECT count(num_sez) from ".$prefix."_ele_sezioni where id_cons=$id_cons"; 208 208 $res_sez = $dbi->prepare("$sql"); … … 249 249 if ($circo) $condcirc="and t5.id_circ=$id_circ"; 250 250 251 $sqlvoti="select $tab2, t1.num_cand, concat(t1.cognome,' ', t1.nome) , sum(t2.voti),'','','','',''251 $sqlvoti="select $tab2, t1.num_cand, concat(t1.cognome,' ', t1.nome) as nome, sum(t2.voti),'','','','','' 252 252 from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_voti_candidati as t2, " 253 253 .$prefix."_ele_sezioni as t3, ".$prefix."_ele_sede as t4, ".$prefix."_ele_circoscrizione as t5 … … 258 258 and t3.id_sede=t4.id_sede 259 259 and t4.id_circ=t5.id_circ $condcirc 260 group by t1.num_cand,$tab3 260 group by t1.num_cand,$tab3, nome 261 261 order by $tab3,t1.num_cand"; 262 262 $res_voti = $dbi->prepare("$sqlvoti"); … … 296 296 297 297 if ($circo) $condcirc="and t5.id_circ=$id_circ"; 298 if ($tab=="gruppo" )298 if ($tab=="gruppo" or $genere==4) 299 299 $votigl=" sum(t3.validi),sum(t3.nulli),sum(t3.bianchi),sum(t3.contestati),sum(t3.voti_nulli)"; 300 300 else … … 319 319 320 320 321 group by $t.num_$tab15,$tab3 321 group by $t.num_$tab15,$tab3,$tab2, $t.descrizione 322 322 order by $tab3,$t.num_$tab15"; 323 323 $res_voti = $dbi->prepare("$sqlvoti"); … … 509 509 $voticompl=0; 510 510 $ominsez=$minsez-1; 511 $sevaltot=0;512 $senultot=0;513 $sebiatot=0;514 $secontot=0;515 $sevnutot=0;516 511 $valar=array();$percar=array(); 517 512 //////////////////////////////////////////////////////////////////// … … 528 523 $res_numsez->execute();# for ($z=1;$z<=($offsetsez-$ominsez);$z++) { 529 524 while($res=$res_numsez->fetch(PDO::FETCH_NUM)) { 525 $sevaltot=0; 526 $senultot=0; 527 $sebiatot=0; 528 $secontot=0; 529 $sevnutot=0; 530 530 $z=$res[0]; 531 531 ##############inserimento percentuale di scrutinio nella sezione … … 544 544 } 545 545 elseif($op=="lista_sezione"){ 546 if($genere==4) 547 $sqlr="select sum(validi),0 from ".$prefix."_ele_sezioni where id_sez='".$res[1]."'"; 548 else 549 $sqlr="select sum(validi),sum(contestati_lista+solo_gruppo+voti_nulli_lista) from ".$prefix."_ele_sezioni where id_sez='".$res[1]."'"; 546 $sqlr="select sum(validi),sum(contestati_lista+solo_gruppo+voti_nulli_lista) from ".$prefix."_ele_sezioni where id_sez='".$res[1]."'"; 550 547 $sqlv="select sum(voti) from ".$prefix."_ele_voti_lista where id_sez='".$res[1]."'"; 551 548 $resperc = $dbi->prepare("$sqlr"); … … 576 573 $maxpos=max($pos); 577 574 //////////////////////////////////////////////////////////////////// 578 575 579 576 if ($res_voti->rowCount()) 580 577 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = $res_voti->fetch(PDO::FETCH_NUM)){ 578 # if($genere==4) $sevalidi=$voti; 581 579 $z=array_search($num_circ, $pos); 582 580 if (!isset($votitot[($z)])) { … … 589 587 } 590 588 $votitot[($z)]+=$voti; 589 if(!isset($valsez[$z])) $valsez[$z]=0; 590 $valsez[$z]=$sevalidi; 591 591 $voticompl+=$voti; 592 592 } … … 620 620 $valar[($z)][$num_cand]=$voti; 621 621 } 622 622 623 foreach ($valar as $key=>$val){ 623 624 if(isset($votitot[($key)])) 624 625 $percar[$key]=arrayperc($val,$votitot[($key)]); 625 } 626 if($res_voti->rowCount()) { 627 $res_voti = $dbi->prepare("$sqlvoti"); 628 $res_voti->execute(); 629 } 626 627 } 628 # if($res_voti->rowCount()) { 629 $res_voti = $dbi->prepare("$sqlvoti"); 630 $res_voti->execute(); 631 #} 632 630 633 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = $res_voti->fetch(PDO::FETCH_NUM)){ 631 634 if($num_cand<$min or $num_cand>$offset) continue; 635 if($genere==4) $sevalidi=$voti; 636 632 637 if (!isset($temp[$num_cand])) $temp[$num_cand]=0; 633 638 $temp[$num_cand]+=$voti; … … 643 648 $percento=$voti."<br /><span class=\"red\" style=\"font-size:80%;\"><i>".number_format($percar[$z][$num_cand],2)." %</i></span>"; 644 649 } 650 645 651 $ar[($z)][$num_cand]=$percento; 646 652 } … … 659 665 if (($maxpos)>=$num_circ and $minpos<=$num_circ){ 660 666 //$posvoti++; 661 $ar[($z)][$posvoti+1]="<b>$ sevalidi</b>";667 $ar[($z)][$posvoti+1]="<b>$valsez[$z]</b>"; 662 668 $ar[($z)][$posvoti+2]="<b>$senulli</b>"; 663 669 $ar[($z)][$posvoti+3]="<b>$sebianchi</b>"; … … 673 679 if(isset($temp)) { 674 680 if (!isset($tab15) or !$tab15) $tab15="candidati"; 675 if($tab15=="gruppo" ){681 if($tab15=="gruppo" or $genere==4){ 676 682 $votigl=" sum(validi),sum(nulli),sum(bianchi),sum(contestati),sum(voti_nulli)"; 677 683 }elseif($votog){ 678 $votigl=" sum(validi _lista),sum(nulli),sum(bianchi),sum(contestati_lista),sum(voti_nulli)";684 $votigl=" sum(validi),sum(nulli),sum(bianchi),sum(contestati),sum(voti_nulli)"; 679 685 }else{ 680 686 if($dettnulli) $votigl=" sum(validi_lista),sum(nulli),sum(bianchi),sum(contestati_lista),sum(voti_nulli_lista)"; -
trunk/client/modules/Elezioni/index.php
r314 r318 616 616 } 617 617 $sql="select t1.id_sez,sum(t1.voti) from ".$prefix."_ele_voti_$tab as t1, ".$prefix."_ele_$tab as t2 where t1.id_$tab=t2.id_$tab and t1.id_cons='$id_cons' and t2.id_circ='$id_circ' group by t1.id_sez"; 618 }else $sql="select id_ consfrom ".$prefix."_ele_voti_".$tab." where id_cons='$id_cons' group by id_sez ";618 }else $sql="select id_sez from ".$prefix."_ele_voti_".$tab." where id_cons='$id_cons' group by id_sez "; 619 619 $res = $dbi->prepare("$sql"); 620 620 $res->execute(); -
trunk/client/modules/Elezioni/language/lang-en.php
r254 r318 355 355 define("_VALIDI","Valid Ballots"); 356 356 define("_NULLI","Non Valid Ballots"); 357 define("_SNULLE","Invalid Papers"); 358 define("_SBIANCHE","White Papers"); 357 359 define("_BIANCHI","Blank Ballots"); 358 360 define("_CONTESTATI","Contested Ballots"); -
trunk/client/modules/Elezioni/language/lang-it.php
r254 r318 105 105 define("_VALIDI","Voti Validi"); 106 106 define("_NULLI","Voti Nulli"); 107 define("_SNULLE","Schede Nulle"); 108 define("_SBIANCHE","Schede Bianche"); 107 109 define("_BIANCHI","Voti Bianchi"); 108 110 define("_CONTESTATI","Voti Contestati");
Note:
See TracChangeset
for help on using the changeset viewer.