Changeset 394 for trunk/admin/modules


Ignore:
Timestamp:
May 21, 2023, 1:46:40 AM (18 months ago)
Author:
roby
Message:

-- ADMIN

  • Inserito il controllo per la gestione del caso di sezione con zero votanti

-- CLIENT

  • Inserito il controllo della dimensione del logo
  • Ulteriori modifiche all'assegnazione dei seggi secondo la legge siciliana
Location:
trunk/admin/modules/Elezioni
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/modules/Elezioni/ele_colora_sez.php

    r342 r394  
    2020        $res->execute();       
    2121}else{ #candidati
    22         $sql="SELECT t2.id_lista FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' group by t2.id_lista";
     22        $sql="SELECT t1.num_cand FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' group by t2.id_lista";
    2323        $res = $dbi->prepare("$sql");
    2424        $res->execute();
    2525        $liste=$res->rowCount();
    26        
     26        list($listescru)=$res->fetch(PDO::FETCH_NUM);
     27        if($res->rowCount() and $listescru==0) {$listescru=1;$liste=0;}
    2728        $sql="SELECT count(id_lista) FROM ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco";
    2829        $res = $dbi->prepare("$sql");
    2930        $res->execute();
    3031        list($ltot)=$res->fetch(PDO::FETCH_NUM);
    31         if($liste && $liste==$ltot){
     32        if(($liste && $liste==$ltot) or $listescru){
    3233                $sezstat=2;
    33                 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#99CC33' where id_cons='$id_cons' and id_sez='$id_sez'"; #VERDE
     34                $sql="UPDATE ".$prefix."_ele_sezioni set colore='#99CC33' where id_cons='$id_cons' and id_sez='$id_sez'"; ;#VERDE
    3435                $res = $dbi->prepare("$sql");
    3536                $res->execute();       
  • trunk/admin/modules/Elezioni/ele_spoglio.php

    r392 r394  
    670670
    671671function finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
    672  global $aid, $prefix, $dbi,$id_cons_gen,$genere,$votog,$fascia,$limite;
     672 global $aid, $prefix, $dbi,$id_cons_gen,$genere,$votog,$fascia,$limite,$scrtest;
    673673////////////////////////////////////////////
    674674// da qua va la sezione per i voti finali
     
    676676$bgcolor1="#7777ff";
    677677$bgcolor2=$_SESSION['bgcolor2'];
    678 
    679 
    680 
    681         echo "<form name=\"spogliovoti\" data-ajax=\"false\" action=\"modules/Elezioni/salva_voti.php\">"
    682         ."<input type=\"hidden\" name=\"op\" value=\"rec_finale\">";
    683         echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
    684         ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
    685         ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
    686         ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
    687         ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
     678echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     679."//-->\n";
     680echo "function setsez() {\n";
     681echo "document.getElementById('spogliovoti').submit(); }\n";
     682echo "</script>\n";     
     683
     684$sql="select * from ".$prefix."_ele_voti_lista where id_cons=$id_cons and id_sez=$id_sez and id_lista=0";
     685$res = $dbi->prepare("$sql");
     686$res->execute();
     687$stato=$res->rowCount();
     688if($stato) $stato='checked'; else $stato='';
     689echo "<form name=\"spogliovoti\" id=\"spogliovoti\" data-ajax=\"false\" action=\"modules/Elezioni/salva_voti.php\">"
     690."<input type=\"hidden\" name=\"op\" value=\"rec_finale\">";
     691echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
     692."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
     693."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
     694."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
     695."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
     696if($scrtest)
     697        echo "<div style=\"text-align:right;\">Considerare la sezione come scrutinata? <input type=\"checkbox\" name=\"scrutinata\" id=\"scrutinata\" value=\"true\" $stato onclick=\"setsez()\";> <br></div>";
    688698
    689699        echo "<table border=\"0\" width=\"100%\" align=\"center\"><tr bgcolor=\"$bgcolor1\" align=\"center\">";
     
    750760
    751761function preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
    752  global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli;
     762 global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli,$scrtest;
    753763////////////////////////////////////////////
    754764// da qua va la sezione per le preferenze ai gruppi
     
    938948                        ."<td colspan=\"2\"><b>"._VOTANTI."</b></td></tr>";
    939949                }else{
    940                         echo "<br><br> <table  class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
     950                        echo "<br><br><table  class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
    941951                        ."<td width=\"3%\"><b>"._NUM."</b></td>"
    942952                        ."<td width=\"50%\"><b>"._GRUPPO."</b></td>";
     
    956966                $tot_pref=0;
    957967                $totsg=0;
    958                 $pro=array();
    959                 $pro['voti']='';
    960                 $pro['solo_gruppo']='';
    961968                while(list($id_cons2,$id_gruppo,$num_gruppo, $descr_gruppo, $simbolo) = $result->fetch(PDO::FETCH_NUM)){
    962969                        echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     
    10121019                                        $res = $dbi->prepare("$sql");
    10131020                                        $res->execute();
    1014                                         if($res->rowCount())
    1015                                                 $pro= $res->fetch(PDO::FETCH_BOTH);
     1021                                        $pro= $res->fetch(PDO::FETCH_BOTH);
     1022                                        if(!$res->rowCount()) {$pro['voti']=''; $pro['solo_gruppo']='';}
    10161023                                        $errcolor='';
    10171024                                        if(isset($errgrulis[$id_gruppo])) {$errcolor="style=\"background-color: rgb(255, 0, 0);\"";}
     
    10461053                }
    10471054                echo "</td></tr></table></center>";
    1048         }
     1055                $scrtest=0;
     1056        }else{$scrtest=1;}
    10491057        if ($genere!=0){
    10501058                finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
  • trunk/admin/modules/Elezioni/salva_voti.php

    r352 r394  
    3939if (isset($_GET['ops'])) $ops=intval($_GET['ops']); else $ops='';
    4040if (isset($_GET['delete'])) $delete=intval($_GET['delete']); else $delete='';
    41 
     41if (isset($_GET['scrutinata'])) {$scrutinata=$_GET['scrutinata']==false ? false : true;}else $scrutinata=false;
     42#$_SESSION['scrutinata']=$scrutinata;
     43#if(isset($_SESSION['scrutinata'])) $scrutinata=$_SESSION['scrutinata']; #else $scrutinata=false;
    4244global $prefix,$id_parz,$genere,$fileout,$id_cons;
    4345if (!isset($fileout)) $fileout='';
     
    6971        $res->execute();
    7072        if ($fileout) fwrite($fp,"$sql;\n");
     73######
     74#include($sql."TEST: scru=$scrutinata");
     75if(isset($scrutinata))
     76{       
     77        $sql="delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and num_gruppo=0";
     78        $res = $dbi->prepare("$sql");
     79        $res->execute();
     80        $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez' and num_lista=0";
     81        $res = $dbi->prepare("$sql");
     82        $res->execute();
     83        $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez' and num_cand=0";
     84        $res = $dbi->prepare("$sql");
     85        $res->execute();
     86        if($scrutinata==true)
     87        {
     88                # provare insert dei soli id_cons e id_sez
     89                $sql="insert into ".$prefix."_ele_voti_gruppo (id_cons,id_sez,num_gruppo) values('$id_cons','$id_sez',0)";
     90                $res = $dbi->prepare("$sql");
     91                $res->execute();
     92                $sql="insert into ".$prefix."_ele_voti_lista (id_cons,id_sez) values('$id_cons','$id_sez')";
     93                $res = $dbi->prepare("$sql");
     94                $res->execute();
     95                $sql="insert into ".$prefix."_ele_voti_candidati (id_cons,id_sez,num_cand) values('$id_cons','$id_sez',0)";
     96                $res = $dbi->prepare("$sql");
     97                $res->execute();
     98#               
     99        }               
     100}       
    71101/*}else{
    72102        $sql="insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$aid','','','validi:$ar[6] nulli:$ar[7] bianchi:$ar[8] contestati:$ar[9] voti_nulli:$ar[13]','validi=$validi, nulli=$nulli,bianchi=$bianchi,contestati=$contestati, voti_nulli=$votinulli','_ele_sezioni')";
Note: See TracChangeset for help on using the changeset viewer.