Changeset 265 for trunk/client
- Timestamp:
- Jun 11, 2017, 8:39:00 PM (7 years ago)
- Location:
- trunk/client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/gruppo.php
r261 r265 4 4 /* by Luciano Apolito & Roberto Gigli */ 5 5 /* http://www.eleonline.it */ 6 /* info@eleonline.it luciano@aniene.netrgigli@libero.it */6 /* info@eleonline.it rgigli@libero.it */ 7 7 /************************************************************************/ 8 8 … … 28 28 if (isset($param['offsetsez'])) $offsetsez=intval($param['offsetsez']); else $offsetsez=''; 29 29 if (isset($param['perc'])) $perc=$param['perc']; else $perc=''; 30 if (isset($param['info'])) get_magic_quotes_gpc() ? $info=$param['info']:$info=addslashes($param['info']); else $info='';31 if (isset($param['files'])) get_magic_quotes_gpc() ? $files=$param['files']:$files=addslashes($param['files']); else $files='';30 if (isset($param['info'])) $info=addslashes($param['info']); else $info=''; 31 if (isset($param['files'])) $files=addslashes($param['files']); else $files=''; 32 32 if (isset($param['voti_lista'])) $voti_lista=intval($param['voti_lista']); else $voti_lista= 0; 33 33 if (isset($param['perc_lista'])) $perc_lista=$param['perc_lista']; else $perc_lista= 0; 34 if (isset($param['lettera'])) get_magic_quotes_gpc() ? $lettera=$param['lettera']:$lettera=addslashes($param['lettera']); else $lettera='';34 if (isset($param['lettera'])) $lettera=addslashes($param['lettera']); else $lettera=''; 35 35 if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo=''; 36 36 #if (isset($param['tipo_cons'])) $tipo_cons=intval($param['tipo_cons']); else $tipo_cons=''; 37 37 if (isset($param['pdf'])) $pdf=intval($param['pdf']); else $pdf=''; 38 if (isset($param['orienta'])) get_magic_quotes_gpc() ? $orienta=$param['orienta']:$orienta=addslashes($param['orienta']); else $orienta='';39 if (isset($param['datipdf'])) get_magic_quotes_gpc() ? $datipdf=$param['datipdf']:$datipdf=addslashes($param['datipdf']); else $datipdf='';40 if (isset($param['formato'])) get_magic_quotes_gpc() ? $formato=$param['formato']:$formato=addslashes($param['formato']); else $formato='';38 if (isset($param['orienta'])) $orienta=addslashes($param['orienta']); else $orienta=''; 39 if (isset($param['datipdf'])) $datipdf=addslashes($param['datipdf']); else $datipdf=''; 40 if (isset($param['formato'])) $formato=addslashes($param['formato']); else $formato=''; 41 41 # anti-xss nov. 2009 42 42 $id_comune=htmlentities($id_comune); … … 63 63 $res = mysql_query("SELECT t1.descrizione, t1.tipo_cons,t2.genere, t2.voto_g, t2.voto_l, t2.voto_c, t2.circo FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_tipo as t2 where t1.tipo_cons=t2.tipo_cons and t1.id_cons_gen='$id_cons_gen' ", $dbi); 64 64 list($descr_cons,$tipo_cons,$genere,$votog,$votol,$votoc,$circo) = mysql_fetch_row($res); 65 $res = mysql_query("SELECT t2.id_cons,t2.solo_gruppo, t2.disgiuntoFROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);65 $res = mysql_query("SELECT t2.id_cons,t2.solo_gruppo,0 FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi); 66 66 list($id_cons,$dettnulli,$disgiunto) = mysql_fetch_row($res); 67 67 … … 177 177 list($minsez)=mysql_fetch_row($res_min); 178 178 } 179 elseif (strstr( $op,'circo')) 180 $res_sez = mysql_query("SELECT count(num_circ),min(num_circ),max(num_circ) from ".$prefix."_ele_circoscrizione where id_cons=$id_cons",$dbi); 179 181 else 180 $res_sez = mysql_query("SELECT count(num_sez) from ".$prefix."_ele_sezioni where id_cons=$id_cons",$dbi);181 list($tot_sez )=mysql_fetch_row($res_sez);182 $res_sez = mysql_query("SELECT count(num_sez),min(num_sez),max(num_sez) from ".$prefix."_ele_sezioni where id_cons=$id_cons",$dbi); 183 list($tot_sez,$numsezmin,$numsezmax)=mysql_fetch_row($res_sez); 182 184 $num_sez=$tot_sez;//mysql_data_seek($res_sez,0); 183 if ($circo) $offsetsez=$num _sez+$minsez-1;//setta offsetsez sull'ultima sezione della circoscrizione184 if(strstr( $op,"circo")) {185 $res_sez = mysql_query("SELECT count(num_circ) from ".$prefix."_ele_circoscrizione where id_cons=$id_cons",$dbi); //estrae il numero delle circoscrizioni186 list($num_sez)=mysql_fetch_row($res_sez);187 }185 if ($circo) $offsetsez=$numsezmax; //$num_sez+$minsez-1;//setta offsetsez sull'ultima sezione della circoscrizione 186 # if(strstr( $op,"circo")) { 187 # $res_sez = mysql_query("SELECT count(num_circ) from ".$prefix."_ele_circoscrizione where id_cons=$id_cons",$dbi); //estrae il numero delle circoscrizioni 188 # list($num_sez)=mysql_fetch_row($res_sez); 189 # } 188 190 #Tolgo la scelta della circoscrizione o collegio perché gestita per tutte le pagine in index.php 189 191 /* if ($circo){ // elenco per scelta circoscrizione … … 299 301 group by $t.num_$tab15,$tab3 300 302 order by $tab3,$t.num_$tab15",$dbi); 303 301 304 } 302 305 if ($res_scr) list($tot_scr)=mysql_fetch_row($res_scr);else $tot_scr=0; 303 306 if ($res_cand) $num_cand=mysql_num_rows($res_cand); else $num_cand=0; 304 if(!$circo){ 305 if (!(0 < $minsez and $minsez<=$num _sez)) $minsez=1;306 if (!(0<$offsetsez and $offsetsez<=$num _sez)) $offsetsez=$num_sez;307 if(!$circo){ 308 if (!(0 < $minsez and $minsez<=$numsezmax)) $minsez=1; 309 if (!(0<$offsetsez and $offsetsez<=$numsezmax)) $offsetsez=$numsezmax; 307 310 } 308 311 if (!(0 < $min and $min<=$num_cand)) $min=1; … … 334 337 if(!$circo){ 335 338 echo "<p>"._SCEGLI." $tipo1 n. <input name=\"minsez\" value=\"$minsez\" size=\"4\" ></input>"; 336 echo _A." n. <input name=\"offsetsez\" value=\"$offsetsez\" size=\"4\" ></input> (max. $num _sez)";339 echo _A." n. <input name=\"offsetsez\" value=\"$offsetsez\" size=\"4\" ></input> (max. $numsezmax)"; 337 340 } 338 341 # pagine 339 $diff=($offsetsez-$minsez); 340 if ($minsez>1){ 341 $minsez_p= ($minsez-$diff)>1 ? $minsez-$diff-1:1; 342 ############ 343 if (strstr( $op,'circo')) 344 $resnsez = mysql_query("SELECT count(num_circ) from ".$prefix."_ele_circoscrizione where id_cons=$id_cons and num_circ>=$minsez and num_circ<=$offsetsez",$dbi); 345 else 346 $resnsez = mysql_query("SELECT count(num_sez) from ".$prefix."_ele_sezioni where id_cons=$id_cons and num_sez>=$minsez and num_sez<=$offsetsez",$dbi); 347 list($diff)=mysql_fetch_row($resnsez); 348 ######## 349 # $diff=($offsetsez-$minsez); 350 if ($minsez>1){ 351 $minsez_p= ($minsez-$diff)>1 ? $minsez-$diff:1; 342 352 343 $offsetsez_p=$offsetsez-$diff -1;353 $offsetsez_p=$offsetsez-$diff; 344 354 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>"; 345 355 }else{echo "";} 346 356 347 if ($offsetsez<$num _sez){348 $minsez_s=$minsez+$diff +1;349 $offsetsez_s= ($offsetsez+$diff)>$num_sez ? $num_sez: $offsetsez+$diff +1;357 if ($offsetsez<$numsezmax){ 358 $minsez_s=$minsez+$diff; 359 $offsetsez_s= ($offsetsez+$diff)>$num_sez ? $num_sez: $offsetsez+$diff; 350 360 351 361 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>"; … … 490 500 echo "</h5> "; 491 501 } 492 493 502 $y=1; 494 503 $ar[0][0]=$tipo3; … … 506 515 // sandro: carica i numeri di sezione dal DB - giugno 2009 507 516 // caso: sezioni in collegi diversi non consecutive 517 if (strstr( $op,'circo')) 518 $res_numsez=mysql_query("select num_circ,id_circ from ".$prefix."_ele_circoscrizione where id_cons='$id_cons' and num_circ>='$minsez' and num_circ<='$offsetsez' order by num_circ",$dbi); 519 else{ 508 520 if($circo) { $secirco=" and t2.id_circ=$id_circ";} else $secirco="and t1.num_sez >= $minsez and t1.num_sez <= $offsetsez"; 509 521 $numsezioni = $offsetsez-$ominsez; 510 522 $res_numsez = mysql_query("SELECT t1.num_sez,t1.id_sez from ".$prefix."_ele_sezioni as t1, ".$prefix."_ele_sede as t2 where t1.id_cons=$id_cons and t1.id_sede=t2.id_sede $secirco order by t1.num_sez",$dbi); 511 for ($z=1;$z<=($offsetsez-$ominsez);$z++) { 512 $res=mysql_fetch_row($res_numsez); 523 } 524 # for ($z=1;$z<=($offsetsez-$ominsez);$z++) { 525 while($res=mysql_fetch_row($res_numsez)) { 526 $z=$res[0]; 513 527 514 528 ##############inserimento percentuale di scrutinio nella sezione … … 550 564 if ($res_voti) 551 565 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = mysql_fetch_row($res_voti)){ 552 if ($num_circ<$minpos or $num_circ>$maxpos) continue;553 566 $z=array_search($num_circ, $pos); 554 567 if (!isset($votitot[($z)])) { … … 568 581 569 582 570 571 572 for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[0][$y]=" "; 573 for ($z=1;$z<=($offsetsez-$ominsez);$z++) 574 for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[$z][$y]=" "; //inizializza le celle interne 575 $onetime=""; 583 for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[0][$y]=" "; 584 if (strstr( $op,'circo')) 585 $lis_sez=mysql_query("select num_circ from ".$prefix."_ele_circoscrizione where id_cons='$id_cons' and num_circ>='$minsez' and num_circ<='$offsetsez' order by num_circ",$dbi); 586 else 587 $lis_sez=mysql_query("select num_sez from ".$prefix."_ele_sezioni where id_cons='$id_cons' and num_sez>='$minsez' and num_sez<='$offsetsez' order by num_sez",$dbi); 588 $nsezsel=mysql_num_rows($lis_sez); 589 while(list($z)=mysql_fetch_row($lis_sez)) 590 { for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[$z][$y]=" ";} //inizializza le celle interne 591 592 ################################################################### 593 # for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[0][$y]=" "; 594 # for ($z=1;$z<=($offsetsez-$ominsez);$z++) 595 # for ($y=$min;$y<=($offset+$piuvot);$y++) $ar[$z][$y]=" "; //inizializza le celle interne 596 $onetime=""; 576 597 if ($res_voti) 577 598 { … … 585 606 } 586 607 587 mysql_data_seek($res_voti,0);608 if(mysql_num_rows($res_voti)) mysql_data_seek($res_voti,0); 588 609 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = mysql_fetch_row($res_voti)){ 589 $z=array_search($num_circ, $pos); 610 if (!isset($temp[$num_cand])) $temp[$num_cand]=0;$temp[$num_cand]+=$voti; 611 $z=array_search($num_circ, $pos); if (!$z) continue; 590 612 if ($num_cand>=$min and $num_cand<=$offset){ 591 613 if($num_circ>=$minpos and $num_circ <=$maxpos){ … … 599 621 $ar[($z)][$num_cand]=$percento; 600 622 } 601 if (!isset($temp[$num_cand])) $temp[$num_cand]=0;602 $temp[$num_cand]+=$voti;623 624 603 625 604 626 } … … 613 635 $ar[0][$posvoti+5]='<b>Voti Nulli</b>'; 614 636 if (($maxpos)>=$num_circ and $minpos<=$num_circ){ 615 $posvoti++;616 $ar[($z)][$posvoti+ +]="<b>$sevalidi</b>";617 $ar[($z)][$posvoti+ +]="<b>$senulli</b>";618 $ar[($z)][$posvoti+ +]="<b>$sebianchi</b>";619 $ar[($z)][$posvoti+ +]="<b>$secontestati</b>";620 $ar[($z)][$posvoti ]="<b>$sevonulli</b>";621 } 622 } 637 //$posvoti++; 638 $ar[($z)][$posvoti+1]="<b>$sevalidi</b>"; 639 $ar[($z)][$posvoti+2]="<b>$senulli</b>"; 640 $ar[($z)][$posvoti+3]="<b>$sebianchi</b>"; 641 $ar[($z)][$posvoti+4]="<b>$secontestati</b>"; 642 $ar[($z)][$posvoti+5]="<b>$sevonulli</b>"; 643 } 644 } 623 645 } 624 646 } 625 647 if (($offsetsez+1)>=$num_sez){ 626 $ar[( 2+$offsetsez-$minsez)][0]="<b>"._TOT."<br />"._COMPLESSIVO."</b>";648 $ar[(1+$numsezmax)][0]="<b>"._TOT."<br />"._COMPLESSIVO."</b>"; 627 649 if(isset($temp)) { 628 650 if (!isset($tab15) or !$tab15) $tab15="candidati"; … … 644 666 $resvt = mysql_query("SELECT voti from ".$prefix."_ele_voti_$tab15 where id_cons='$id_cons'",$dbi); 645 667 if($resvt) list($votlt)=mysql_fetch_row($resvt); else $votlt=0; 646 if($perc) $temp3=arrayperc($temp ar,$sevaltot);668 if($perc) $temp3=arrayperc($temp,$sevaltot); 647 669 while (list($key,$voti)= each($temp)) { 648 670 if ($perc=='true' and $voticompl) … … 651 673 } else 652 674 $percento="<b>$voti</b>"; 653 $ar[ 2+$offsetsez-$minsez][$key]=$percento;675 $ar[1+$numsezmax][$key]=$percento; 654 676 } 655 677 } … … 664 686 $percento="<b>$voti<br /><span class=\"red\"><i>".$temp3[$k]." %</i></span></b>"; 665 687 } else $percento="<b>$voti</b>"; 666 $ar[ 2+$offsetsez-$minsez][++$key]=$percento;688 $ar[1+$numsezmax][++$key]=$percento; 667 689 668 690 } -
trunk/client/versione.php
r264 r265 1 1 <?php 2 2 3 $versione = "2.0 rev 26 3";3 $versione = "2.0 rev 265"; 4 4 $version_number = $versione; 5 $version = "Eleonline $version_number (<i>Data Release: 7giugno 2017</i>)";5 $version = "Eleonline $version_number (<i>Data Release: 11 giugno 2017</i>)"; 6 6 7 7 ?>
Note:
See TracChangeset
for help on using the changeset viewer.