Changeset 390 for trunk/client/modules
- Timestamp:
- Feb 23, 2023, 5:37:11 PM (21 months ago)
- Location:
- trunk/client/modules/Elezioni
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/crea_paginaphp5.php
r375 r390 26 26 $res->execute(); 27 27 list($descr_com,$simbolo,$stemma) = $res->fetch(PDO::FETCH_NUM); 28 $datipdf=stripslashes( $datipdf);28 $datipdf=stripslashes("$datipdf"); 29 29 $data=date("d-m-y G:i"); 30 30 if ($xls==1) { -
trunk/client/modules/Elezioni/crea_paginaphp7.php
r375 r390 29 29 $res->execute(); 30 30 list($descr_com,$simbolo,$stemma) = $res->fetch(PDO::FETCH_NUM); 31 $datipdf=stripslashes( $datipdf);31 $datipdf=stripslashes("$datipdf"); 32 32 $data=date("d-m-y G:i"); 33 33 if ($xls==1) { -
trunk/client/modules/Elezioni/gruppo.php
r375 r390 25 25 if (isset($param['min'])) $min=intval($param['min']); else $min= 0; 26 26 if (isset($param['orvert'])) $orvert=intval($param['orvert']); else $orvert=''; 27 if (isset($param['grupposg']) and $param['grupposg']) $grupposg=TRUE; else $grupposg=FALSE; 27 28 if (isset($param['offset'])) $offset=intval($param['offset']); else $offset=''; 28 29 if (isset($param['offsetsez'])) $offsetsez=intval($param['offsetsez']); else $offsetsez=''; … … 90 91 global $prefix, $dbi, $descr_cons, $id_cons, $id_cons_gen,$tipo_cons,$votog,$votol,$votoc,$circo, $genere,$id_gruppo,$id_lista,$bgcolor1,$bgcolor2,$id_comune,$descr_comune,$id_circ; 91 92 global $id_comune,$id_cons_gen,$op,$minsez,$id_lista,$id_circ,$csv,$min,$orienta,$formato,$dettnulli,$disgiunto, 92 $orvert,$ offset,$offsetsez,$perc,$info,$files,$nomefile;93 $orvert,$grupposg,$offset,$offsetsez,$perc,$info,$files,$nomefile; 93 94 $nomefile=""; 94 95 #Denominazione pagine … … 129 130 $colonne=''; 130 131 } 131 132 if ($grupposg) { 133 $vissg=''; 134 $novissg='checked'; 135 }else{ 136 $vissg='checked'; 137 $novissg=''; 138 } 132 139 if ($orienta) { 133 140 $land=''; … … 137 144 $port=''; 138 145 } 139 140 146 if ($formato) { 141 147 $A3=''; … … 253 259 254 260 if ($circo) {$condcirc="and t5.id_circ=$id_circ";$condcircdes="and t2.id_circ=$id_circ";} 255 $sqldesc="select '','', t1.num_cand, concat(t1.cognome,' ', t1.nome) as nome, '','','','','','' 261 $sqldesc="select '','', t1.num_cand, concat(t1.cognome,' ', t1.nome) as nome, '','','','','','','' 256 262 from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_lista as t2 257 263 where t1.id_lista=$id_lista … … 260 266 order by t1.num_cand"; 261 267 262 $sqlvoti="select $tab2, t1.num_cand, concat(t1.cognome,' ', t1.nome) as nome, sum(t2.voti),'','','','','' 268 $sqlvoti="select $tab2, t1.num_cand, concat(t1.cognome,' ', t1.nome) as nome, sum(t2.voti),'','','','','','' 263 269 from ".$prefix."_ele_candidati as t1, ".$prefix."_ele_voti_candidati as t2, " 264 270 .$prefix."_ele_sezioni as t3, ".$prefix."_ele_sede as t4, ".$prefix."_ele_circoscrizione as t5 … … 285 291 // 4 aprile 2006 by luc 286 292 #echo "TEST; Condizione scelta lista/gruppo: if ($votog && $tab==gruppo)<br>circo: $circo -- condcirc: $condcirc<br>"; 287 $tabns=$tab; 293 $tabns=$tab; 294 $ecampo=",''"; 288 295 if ($votog && $tab=="gruppo"){ // camera e senato 2006 289 296 $t="t9"; … … 294 301 $and_1="and t1.id_gruppo=t9.id_gruppo"; 295 302 }else{ 303 if($dettnulli and $tab=="gruppo") $ecampo=",sum(t2.solo_gruppo)"; 296 304 $t="t1"; 297 305 $tab15=$tab; … … 324 332 order by t1.num_$tab15"; 325 333 #include("TEST:$sqldesc"); 326 $sqlvoti="select $tab2, $t.num_$tab15, $t.descrizione, sum(t2.voti), $votigl 334 $sqlvoti="select $tab2, $t.num_$tab15, $t.descrizione, sum(t2.voti), $votigl $ecampo 327 335 from 328 336 ".$prefix."_ele_$tab as t1, … … 401 409 $minsez_p= ($minsez-$diff)>1 ? $minsez-$diff:1; 402 410 $offsetsez_p=$offsetsez-$diff; 403 echo "<div style=\"float: right; width:200px;margin-left:10px;margin-right:400px;font-size:12px \"><a href=\"modules.php?name=Elezioni&file=index&id_cons_gen=$id_cons_gen&id_comune=$id_comune&op=$op&min=$min&offset=$offset&minsez=$minsez_p&offsetsez=$offsetsez_p&perc=$perc& id_lista=$id_lista\"> <- $tipo2 Precedenti</a></div>";411 echo "<div style=\"float: right; width:200px;margin-left:10px;margin-right:400px;font-size:12px \"><a href=\"modules.php?name=Elezioni&file=index&id_cons_gen=$id_cons_gen&id_comune=$id_comune&op=$op&min=$min&offset=$offset&minsez=$minsez_p&offsetsez=$offsetsez_p&perc=$perc&grupposg=$grupposg&id_lista=$id_lista\"> <- $tipo2 Precedenti</a></div>"; 404 412 }else{echo "";} 405 413 if ($offsetsez<$numsezmax){ 406 414 $minsez_s=$minsez+$diff; 407 415 $offsetsez_s= ($offsetsez+$diff)>$num_sez ? $num_sez: $offsetsez+$diff; 408 echo "<div style=\"float: left; width:200px; margin-left:10px;\"><a href=\"modules.php?name=Elezioni&file=index&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&orvert=$orvert& min=$min&offset=$offset&minsez=$minsez_s&offsetsez=$offsetsez_s&perc=$perc&id_lista=$id_lista\"> $tipo2 Successive -></a></div>";416 echo "<div style=\"float: left; width:200px; margin-left:10px;\"><a href=\"modules.php?name=Elezioni&file=index&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&orvert=$orvert&grupposg=$grupposg&min=$min&offset=$offset&minsez=$minsez_s&offsetsez=$offsetsez_s&perc=$perc&id_lista=$id_lista\"> $tipo2 Successive -></a></div>"; 409 417 }else{echo "";} 410 418 if(!$circo) 411 419 echo "<div style=\"margin-left:10px;\"><br/>"._MOSTRA." $tipo2 "._PERCOL."<input type=\"radio\" name=\"orvert\" $righe value=\"0\"></input>"._PERRIGHE." <input 412 420 type=\"radio\" name=\"orvert\" $colonne value=\"1\"></input>"; 421 413 422 echo "<input type=\"hidden\" name=\"name\" value=\"Elezioni\"></input></div>"; 423 echo "<p>"; 424 if($dettnulli and $tab=="gruppo") { 425 echo ""._MOSTRA." "._SOLO_GRUPPO.": <input type=\"checkbox\" name=\"grupposg\" value=\"true\""; 426 if($grupposg=='true') echo " checked=\"true\""; 427 echo "></input><br/>"; 428 } 414 429 echo "<p>"; 415 430 if (!strstr( $op,'candidato')) { … … 488 503 echo "<div style=\"text-align:right;width:65%;margin-left:10px;margin-right:0px;font-size:12px; \">"; 489 504 echo "<table style=\"text-align:center;margin-right:0px;border-top : 1px solid Blue;width: 280px;\"><tr style=\" background:#eceff5;\"><td>"._ESPORTA."<br />"; 490 if($circo){ echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc& id_lista=$id_lista&id_circ=$id_circ\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>";505 if($circo){ echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&grupposg=$grupposg&id_lista=$id_lista&id_circ=$id_circ\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>"; 491 506 }else{ 492 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc& id_lista=$id_lista\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>";493 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc& id_lista=$id_lista&xls=1\" ><img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"Export Csv\" /></a>";507 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&grupposg=$grupposg&id_lista=$id_lista\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>"; 508 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&grupposg=$grupposg&id_lista=$id_lista&xls=1\" ><img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"Export Csv\" /></a>"; 494 509 echo "<img class=\"image\" src=\"modules/Elezioni/images/rss.png\" alt=\"Export rss\" />"; 495 510 echo " </td>"; … … 508 523 echo "<input type=\"hidden\" name=\"offsetsez\" value=\"$offsetsez\"></input>"; 509 524 echo "<input type=\"hidden\" name=\"perc\" value=\"$perc\"></input>"; 525 echo "<input type=\"hidden\" name=\"grupposg\" value=\"$grupposg\"></input>"; 510 526 echo "<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\"></input>"; 511 527 echo "<input type=\"hidden\" name=\"pdf\" value=\"1\"></input>"; … … 630 646 # $voticompl+=$voti; 631 647 } 632 if ($voticompl) {648 # if ($voticompl) { 633 649 $res_voti = $dbi->prepare("$sqlvoti"); 634 650 $res_voti->execute(); 635 }651 # } 636 652 $piuvot=0; 637 653 … … 653 669 # for ($z=1;$z<=($offsetsez-$ominsez);$z++) 654 670 # for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[$z][$y]=" "; //inizializza le celle interne 655 $onetime=""; 656 if ($res_voti) 657 { 658 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = $res_voti->fetch(PDO::FETCH_NUM)){ 659 $z=array_search($num_circ, $pos); 660 $valar[($z)][$num_cand]=$voti; 671 $onetime=""; 672 if ($res_voti) 673 { 674 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = $res_voti->fetch(PDO::FETCH_NUM)){ 675 if(!isset($votitot[$z])) $votitot[$z]=0; 676 $z=array_search($num_circ, $pos); 677 if ($z) {$valar[($z)][$num_cand]=$voti; $votitot[($z)]+=$voti;} 678 } 679 #echo "TEST: fase 1 num rec: su $z - $num_cand voti:".$voti."<br>"; 680 foreach ($valar as $key=>$val){ 681 if(isset($votitot[($key)])) 682 $percar[$key]=arrayperc($val,$votitot[($key)]); 683 684 } 685 $res_voti = $dbi->prepare("$sqlvoti"); 686 $res_voti->execute(); 687 if (!$res_voti->rowCount()) { 688 $res_voti = $dbi->prepare("$sqldesc"); 689 $res_voti->execute(); 690 } 691 692 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli,$votisg) = $res_voti->fetch(PDO::FETCH_NUM)){ 693 if($num_cand<$min or $num_cand>$offset) continue; 694 if($genere==4) $sevalidi=$voti; 695 696 if (!isset($temp[$num_cand])) $temp[$num_cand]=0; 697 $temp[$num_cand]+=intval($voti); 698 if (!isset($tempsg[$num_cand])) $tempsg[$num_cand]=0; 699 $tempsg[$num_cand]+=intval($votisg); 700 $z=array_search($num_circ, $pos); 701 if (!$z) $z=$minpos; 702 if ($num_cand>=$min and $num_cand<=$offset){ 703 if(($num_circ>=$minpos and $num_circ <=$maxpos) or $num_circ==''){ 704 $ar[0][$num_cand]=$num_cand.") ".$nome; 705 if ($desc_circ && $onetime!=$desc_circ) {$ar[($z)][0].=") ".$desc_circ; $onetime=$desc_circ;} 706 $percento=$voti; 707 if ($perc=='true' and $voti) 708 { 709 $percento.="<br /><span class=\"red\" style=\"font-size:80%;\"><i>".number_format($percar[$z][$num_cand],2)." %</i></span>"; 710 } 711 if($grupposg) $percento.="<br /><span style=\"color:blue;font-size:80%;\">".$votisg." </span>"; 712 $ar[($z)][$num_cand]=$percento; 713 } 661 714 } 662 663 foreach ($valar as $key=>$val){ 664 if(isset($votitot[($key)])) 665 $percar[$key]=arrayperc($val,$votitot[($key)]); 666 715 if (!strstr( $op,'candidato')){ 716 if (!isset($tempar[$num_cand])) $tempar[$num_cand]=0; 717 $tempar[$num_cand]+=intval($voti); 667 718 } 668 # if($res_voti->rowCount()) { 669 $res_voti = $dbi->prepare("$sqlvoti"); 670 $res_voti->execute(); 671 if (!$res_voti->rowCount()) { 672 $res_voti = $dbi->prepare("$sqldesc"); 673 $res_voti->execute(); 674 #include("TEST: $sqldesc"); 675 } 676 #} 677 678 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = $res_voti->fetch(PDO::FETCH_NUM)){ 679 if($num_cand<$min or $num_cand>$offset) continue; 680 if($genere==4) $sevalidi=$voti; 681 682 if (!isset($temp[$num_cand])) $temp[$num_cand]=0; 683 $temp[$num_cand]+=intval($voti); 684 $z=array_search($num_circ, $pos); 685 if (!$z) $z=$minpos; #continue; 686 if ($num_cand>=$min and $num_cand<=$offset){ 687 if(($num_circ>=$minpos and $num_circ <=$maxpos) or $num_circ==''){ 688 $ar[0][$num_cand]=$num_cand.") ".$nome; 689 if ($desc_circ && $onetime!=$desc_circ) {$ar[($z)][0].=") ".$desc_circ; $onetime=$desc_circ;} 690 $percento=$voti; 691 if ($perc=='true' and $votitot[($z)]) 692 { 693 $percento=$voti."<br /><span class=\"red\" style=\"font-size:80%;\"><i>".number_format($percar[$z][$num_cand],2)." %</i></span>"; 694 } 695 696 $ar[($z)][$num_cand]=$percento; 697 } 719 if ($visvot!='cand'){ 720 $posvoti=($offset); 721 if($tab15=="gruppo" or $genere==4 or ($genere==5 and $votog) or defined('_NULLISTA')){ 722 $ar[0][$posvoti+1]='<b>Voti Validi</b>'; 723 $ar[0][$posvoti+2]='<b>Schede Nulle</b>'; 724 $ar[0][$posvoti+3]='<b>Schede Bianche</b>'; 725 $ar[0][$posvoti+4]='<b>Voti Contestati</b>'; 726 $ar[0][$posvoti+5]='<b>Voti Nulli</b>'; 727 }else{ 728 $ar[0][$posvoti+1]='<b>Voti Validi</b>'; 729 $ar[0][$posvoti+2]='<b>Voti Nulli</b>'; 730 $ar[0][$posvoti+3]='<b>Voti Contestati</b>'; 731 $ar[0][$posvoti+4]='<b>Solo Gruppo</b>'; 732 } 733 if (($maxpos)>=$num_circ and $minpos<=$num_circ){ 734 //$posvoti++; 735 $ar[($z)][$posvoti+1]="<b>$valsez[$z]</b>"; 736 $ar[($z)][$posvoti+2]="<b>$nulsez[$z]</b>"; 737 $ar[($z)][$posvoti+3]="<b>$biasez[$z]</b>"; 738 $ar[($z)][$posvoti+4]="<b>$consez[$z]</b>"; 739 if($tab15=="gruppo" or $genere==4 or ($genere==5 and $votog) or defined('_NULLISTA')) $ar[($z)][$posvoti+5]="<b>$vonsez[$z]</b>"; 698 740 } 699 if (!strstr( $op,'candidato')){ 700 if (!isset($tempar[$num_cand])) $tempar[$num_cand]=0; 701 $tempar[$num_cand]+=intval($voti); 702 } 703 if ($visvot!='cand'){ 704 $posvoti=($offset); 705 if($tab15=="gruppo" or $genere==4 or ($genere==5 and $votog) or defined('_NULLISTA')){ 706 $ar[0][$posvoti+1]='<b>Voti Validi</b>'; 707 $ar[0][$posvoti+2]='<b>Schede Nulle</b>'; 708 $ar[0][$posvoti+3]='<b>Schede Bianche</b>'; 709 $ar[0][$posvoti+4]='<b>Voti Contestati</b>'; 710 $ar[0][$posvoti+5]='<b>Voti Nulli</b>'; 711 }else{ 712 $ar[0][$posvoti+1]='<b>Voti Validi</b>'; 713 $ar[0][$posvoti+2]='<b>Voti Nulli</b>'; 714 $ar[0][$posvoti+3]='<b>Voti Contestati</b>'; 715 $ar[0][$posvoti+4]='<b>Solo Gruppo</b>'; 716 } 717 if (($maxpos)>=$num_circ and $minpos<=$num_circ){ 718 //$posvoti++; 719 $ar[($z)][$posvoti+1]="<b>$valsez[$z]</b>"; 720 $ar[($z)][$posvoti+2]="<b>$nulsez[$z]</b>"; 721 $ar[($z)][$posvoti+3]="<b>$biasez[$z]</b>"; 722 $ar[($z)][$posvoti+4]="<b>$consez[$z]</b>"; 723 if($tab15=="gruppo" or $genere==4 or ($genere==5 and $votog) or defined('_NULLISTA')) $ar[($z)][$posvoti+5]="<b>$vonsez[$z]</b>"; 724 } 725 } 726 } 741 } 727 742 } 743 } 728 744 729 745 if (($offsetsez+1)>=$num_sez){ … … 760 776 $percento="<b>$voti<br /><span class=\"red\"><i>".$temp3[$key]." %</i></span></b>"; 761 777 } else 762 $percento="<b>$voti</b>"; 778 $percento="<b>$voti</b>"; #dettnulli 779 if($grupposg and $tab=='gruppo') $percento.="<br /><span style=\"color:blue;font-size:80%;\">".$tempsg[$key]." </span>"; 763 780 $ar[1+$numsezmax][$key]=$percento; 764 781 } -
trunk/client/modules/Elezioni/language/lang-it.php
r353 r390 383 383 define("_GRUPPI","Candidati Presidente"); 384 384 define("_GRUPPO","Candidato Presidente"); 385 define("_SOLO_GRUPPO","Voti al solo gruppo"); 385 386 define("_GRUPPOLOGO","Logo del Presidente"); 386 387 define("_CONSI","Candidato Lista"); -
trunk/client/modules/Elezioni/rss.php
r282 r390 13 13 14 14 15 15 #header('Content-Type: text/html;'); 16 16 header("Content-Type: text/xml"); 17 17 … … 47 47 echo "<sy:updateBase>".$now."</sy:updateBase>\n\n"; 48 48 49 list ($gruppo,$pro )=grupporss();49 list ($gruppo,$pro,$titolo)=grupporss(); 50 50 51 51 … … 60 60 echo "<link>$siteurl/modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index</link>\n"; 61 61 62 echo "<description><![CDATA[".$vuota."]]></description>\n";62 # echo "<description><![CDATA['aa']]></description>\n"; 63 63 64 64 … … 67 67 68 68 //echo "<guid isPermaLink=\"false\">noreply@ciao.it</guid>\n"; 69 echo "<dc:subject> ".$titolo."</dc:subject>\n";69 echo "<dc:subject>$titolo</dc:subject>\n"; 70 70 echo "<dc:date>".$now."</dc:date>\n"; 71 71 echo "<dc:creator>Postato da ".$sitename."</dc:creator>\n"; … … 81 81 // gruppo 82 82 function grupporss(){ 83 global $admin, $bgcolor1, $bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$id_cons_gen,$id_comune,$id_circ,$tipo_cons,$w,$l,$op,$siteistat,$flash ;84 85 86 83 global $admin, $bgcolor1, $bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$id_cons_gen,$id_comune,$id_circ,$tipo_cons,$w,$l,$op,$siteistat,$flash,$circondt1,$lang; 84 85 86 87 87 88 88 if ($genere!=0){$tab="ele_voti_gruppo";} … … 160 160 161 161 162 $gruppinum=$res->fetch(PDO::FETCH_NUM);162 # $gruppinum=$res->fetch(PDO::FETCH_NUM); 163 163 $altrivoti=0; 164 164 while (list($id,$num,$descrizione,$voti) = $res->fetch(PDO::FETCH_NUM)){ … … 187 187 188 188 189 189 include_once("language/lang-$lang.php"); 190 190 $titolo=""._PERCE." "._VOTIE.""; 191 191 … … 196 196 197 197 198 return array($gruppo,$pro );198 return array($gruppo,$pro,$titolo); 199 199 200 200
Note:
See TracChangeset
for help on using the changeset viewer.