- Timestamp:
- Jun 2, 2019, 10:04:20 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_associazioni.php
r316 r318 194 194 if($rescomu->rowCount()) 195 195 list($fasciacom)=$rescomu->fetch(PDO::FETCH_NUM); 196 else $fasciacom=0; 196 197 } else $fasciacom=0; 197 198 $sql="SELECT id_conf, descrizione from ".$prefix."_ele_conf order by id_conf desc"; -
trunk/admin/modules/Elezioni/ele_controlli.php
r315 r318 278 278 ############################## 279 279 $err=0; 280 $stato=0; 281 $sql="select count(0) from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' "; 282 $res = $dbi->prepare("$sql"); 283 $res->execute(); 284 if($res->rowCount()) $stato=1; 280 285 $tipo='lista'; 281 286 $sql="SELECT genere FROM ".$prefix."_ele_tipo as t1 left join ".$prefix."_ele_consultazione as t2 on t1.tipo_cons=t2.tipo_cons where id_cons_gen='$id_cons_gen'"; … … 283 288 $res->execute(); 284 289 list($genere)=$res->fetch(PDO::FETCH_NUM); 285 $sql="SELECT preferenze,disgiunto,solo_gruppo,id_fascia FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'"; 286 $res = $dbi->prepare("$sql"); 287 $res->execute(); 288 list($prefs,$disg,$solog,$fascia)=$res->fetch(PDO::FETCH_NUM); 289 if($id_lista){ 290 $sql="SELECT preferenze,disgiunto,solo_gruppo,id_fascia,id_conf FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'"; 291 $res = $dbi->prepare("$sql"); 292 $res->execute(); 293 list($prefs,$disg,$solog,$fascia,$idconf)=$res->fetch(PDO::FETCH_NUM); 294 $sql="SELECT supdisgiunto FROM ".$prefix."_ele_conf where id_conf='$idconf'"; 295 $res = $dbi->prepare("$sql"); 296 $res->execute(); 297 list($disglg)=$res->fetch(PDO::FETCH_NUM); 298 if($id_lista && $stato==0){ 290 299 $err=controllo_votic($id_cons,$id_sez,$id_lista); 291 300 $tipo='lista'; … … 315 324 $err=controllo_votic($id_cons,$id_sez,$idg); 316 325 if($err){ $tipo='lista'; $id_lista=$idg; break; } 317 326 $sql="SELECT sum(voti), sum(nulli_lista),sum(solo_lista) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$idg'"; 318 327 $res2 = $dbi->prepare("$sql"); 319 328 $res2->execute(); … … 329 338 } 330 339 } 331 if ($ validil+$contestatil+$nullil+$bianchi+$vnulli!=$votit and $validil+$contestatil+$nullil+$bianchi+$vnulli>0) {$err=1;$tipo='lista';}340 if ($totlis!=$validil or ($validil+$contestatil+$nullil+$bianchi+$vnulli!=$votit and $validil+$contestatil+$nullil+$bianchi+$vnulli>0)) {$err=1;$tipo='lista';} 332 341 # if(($solog && !$disg && $tnl!=$nullil) || $totsl!=$solol) {$err=1;$tipo='lista';} 333 342 }else{ … … 343 352 while(list($id_lista)=$res2->fetch(PDO::FETCH_NUM)){ 344 353 $err=controllo_votic($id_cons,$id_sez,$id_lista); 345 if($err){ $tipo='lista'; break; }354 if($err){ $tipo='lista'; $id_lista=$idg; break; } 346 355 } 356 if($err) break; 347 357 $sql="SELECT sum(voti), sum(nulli_lista),sum(solo_lista) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$idg')"; 348 358 $res2 = $dbi->prepare("$sql"); … … 350 360 $totgru+=$votig; 351 361 $totsg+=$svg; 352 if($res2->rowCount() ){362 if($res2->rowCount() && !$disglg){ 353 363 list($votil,$nl,$svl)=$res2->fetch(PDO::FETCH_NUM); 354 364 $totlis+=$votil; … … 374 384 375 385 if($err){ 376 if(!$id_lista) $id_lista=0;377 386 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')"; 378 387 $res = $dbi->prepare("$sql"); -
trunk/client/footer.php
r265 r318 6 6 /* info@eleonline.it luciano@aniene.net rgigli@libero.it */ 7 7 /************************************************************************/ 8 global $csv,$is_mobile ;8 global $csv,$is_mobile,$descr_com; 9 9 if (!$csv) 10 10 piede(); -
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"); -
trunk/install/sql/eleonline.sql
r307 r318 449 449 `num_gruppo` int(2) UNSIGNED NOT NULL DEFAULT '0', 450 450 `id_circ` int(11) NOT NULL DEFAULT '0', 451 `num_circ` int(2) UNSIGNED NOT NULL ,451 `num_circ` int(2) UNSIGNED NOT NULL DEFAULT '0', 452 452 `descrizione` text, 453 453 `simbolo` text, … … 544 544 `id_cons_gen` int(11) NOT NULL DEFAULT '0', 545 545 `orario` time NOT NULL DEFAULT '00:00:00', 546 `data` date NOT NULL DEFAULT ' 0000-00-00'546 `data` date NOT NULL DEFAULT '1970-01-01' 547 547 ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 548 548 … … 718 718 `id_parz` int(11) NOT NULL, 719 719 `orario` time NOT NULL DEFAULT '00:00:00', 720 `data` date NOT NULL DEFAULT ' 0000-00-00',720 `data` date NOT NULL DEFAULT '1970-01-01', 721 721 `voti_uomini` int(7) NOT NULL DEFAULT '0', 722 722 `voti_donne` int(7) NOT NULL DEFAULT '0',
Note:
See TracChangeset
for help on using the changeset viewer.