Changeset 358 for trunk/admin/modules


Ignore:
Timestamp:
Feb 22, 2022, 10:40:08 PM (2 years ago)
Author:
roby
Message:

Admin: aggiunta la funzione di gestione dello spoglio per la singola sezione tramite tema per cellulari

Location:
trunk/admin/modules/Elezioni
Files:
11 edited

Legend:

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

    r336 r358  
    5858
    5959if (!$perms) $perms=ChiSei($id_cons_gen);
    60         //include("modules/Elezioni/language/lang-$currentlang.php");
     60        include_once("modules/Elezioni/language/lang-$currentlang.php");
    6161        //**************************************************************************
    6262        //        ELE
     
    7171#       include("modules/Elezioni/testa.php");
    7272        //immagine bullet
    73         $bullet="<img src=\"temi/$tema/images/bullet.gif\" alt =\" \" align=\"left\" border=\"0\">";
     73    $bullet="<img src=\"temi/$tema/images/bullet.gif\" alt =\" \" align=\"left\" border=\"0\">";
    7474        $bullet_red="<img src=\"temi/$tema/images/bullet_red.gif\" alt =\" \" align=\"left\" border=\"0\">";
    7575        $bgcolor1='#e7e7e7';
     
    264264                </td>
    265265        <td valign=\"top\" width=\"150\">";
    266         if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo)) {
     266        if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo) and ! $espandi) {
    267267                        echo "<a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;do=spoglio\">$bullet "._GEST." "._SPOGLIO."</a><br>";
    268268                if ($nraff) {
  • trunk/admin/modules/Elezioni/ele_candidato.php

    r352 r358  
    303303                                        $num_cand++;
    304304                                }
     305                                ###################
    305306                                $sql="select id_gruppo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista'";
    306307                                $sth = $dbi->prepare("$sql");
     
    311312                                $sth->execute();
    312313                                $result=$sth->rowCount();
    313                                 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,num_lista:$num_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')";
     314                                $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,num_lista:$num_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')";                             
     315#########                               
    314316                                $sth = $dbi->prepare("$sql");
    315317                                $sth->execute();
     
    324326                }elseif ($do == "update") {
    325327                $pro= $sthcan->fetch(PDO::FETCH_BOTH);
    326                
     328                ################
    327329                $sql="select id_gruppo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista'";
    328330                $sth = $dbi->prepare("$sql");
     
    333335                if (isset($simbolo)) {$cond.=", simbolo='$simbolo'";}
    334336                $sql="update  ".$prefix."_ele_candidati set id_lista='$id_lista', num_lista='$num_lista', cognome='$cognome', nome='$nome', num_cand='$num_cand' $cond where id_cand='$id_cand' ";
     337######
    335338                $sth = $dbi->prepare("$sql");
    336339                $sth->execute();
  • trunk/admin/modules/Elezioni/ele_consultazioni.php

    r344 r358  
    8383        echo "} \n";
    8484        echo "</script>\n";
     85       
     86        ##############  onsubmit=\"check_aid()\"
     87/*      echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     88        ."//-->\n";
     89        echo "function check_aid() {
     90          var elem=document.getElementById('descrcons'); var num=elem.length; alert (\"Please fill in your first name.\".num);
     91    for (i=0; i < elem.length; i++) { var sel=elem[i].value;
     92        if (elem[i].value == document.consultazione.descr_cons2.value) {
     93            document.consultazione.descr_cons2.style.backgroundColor = \"#ccc\";
     94               document.consultazione.descr_cons2.focus();
     95               return false;
     96        }
     97    }
     98        return false;
     99        }
     100       
     101            function hide(){
     102          var elem = document.getElementById('descrcons');
     103          elem.style.display = 'none';
     104        }";
     105
     106        echo "</script>\n"; */
     107###################
     108        $sql="select descrizione from ".$prefix."_ele_consultazione";
     109        $sth = $dbi->prepare("$sql");
     110        $sth->execute();       
     111        $row = $sth->fetch(PDO::FETCH_NUM);
     112        echo "<select id=\"descrcons\" style=\"visibility:hidden;\">";
     113        while(list($val)=$sth->fetch(PDO::FETCH_NUM)) {
     114                echo "<option value=\"$val\">$val</option>";
     115        }
     116        echo "</select>";
    85117#########################
    86118        if (isset($help)) include("language/$language/ele_consultazioni.html");
     
    127159                echo "<option value=\"$dfa1\" selected>$dfa1</option>"; anno();
    128160                echo "</td></tr><tr>";
    129                 $resdel = daticonscom();
    130                 if(count($resdel)==0)
    131                         echo "<td><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\"name=\"pwd3\" value=\"\" onclick=\"del_cons()\"></label></fieldset></td>";
     161                $sql="SELECT t1.tipo_cons,t2.id_cons 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'";
     162                $sth = $dbi->prepare("$sql");
     163                $sth->execute();
     164                $resdel=$sth->rowCount();       
     165                if($resdel==0)
     166                        echo "<td colspan=\"2\"><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\"name=\"pwd3\" value=\"\" onclick=\"del_cons()\" size=\"200px\"></label></fieldset></td>";
    132167                else echo "<td></td>";
    133                 echo "<td><input type=\"submit\" id=\"update\" name=\"update\" value=\""._MODIFY."\">"
     168                echo "</tr><tr><td><input type=\"submit\" id=\"update\" name=\"update\" value=\""._MODIFY."\">"
    134169                ."</td></tr></table></form>";
    135170        } else {
     
    249284                                $id_consulta=$id_cons_gen;
    250285                                $sql="insert into ".$prefix."_ele_consultazione (descrizione,data_inizio,data_fine,tipo_cons) values ('$descr_cons2','$data_inizio','$data_fine','$tipocons')";
    251                                 $sth = $dbi->prepare("$sql");
    252                                 $sth->execute();       
    253 
     286                                try {
     287                                        $sth = $dbi->prepare("$sql");
     288                                        $sth->execute();
     289                                }catch(PDOException $e) {
     290                                        if ($e->getCode() == 23000)
     291                                                echo "<h2 style=\"color:red;\">     Inserimento fallito: Esiste già una consultazione con il nome \"$descr_cons2\"</h2";
     292                                        else
     293                                                echo "<h2 style=\"color:red;\">     Inserimento fallito: ". $e->getMessage()."</h2";
     294                                }       
    254295                        } else {
    255296                        OpenTable();
     
    262303                        $data_fine="$dfa-$dfm-$dfg";
    263304                        $sql="update  ".$prefix."_ele_consultazione set  descrizione='$descr_cons2',data_inizio='$data_inizio',data_fine='$data_fine' WHERE id_cons_gen='$id_cons_gen'";
    264                         $sth = $dbi->prepare("$sql");
    265                         $sth->execute();       
     305                        try {
     306                                $sth = $dbi->prepare("$sql");
     307                                $sth->execute();
     308                        }catch(PDOException $e) {
     309                                if ($e->getCode() == 23000)
     310                                        echo "<h2 style=\"color:red;\">     Inserimento fallito: Esiste già una consultazione con il nome \"$descr_cons2\"</h2";
     311                                else
     312                                        echo "<h2 style=\"color:red;\">     Inserimento fallito: ". $e->getMessage()."</h2";
     313                        }       
    266314                        if (!$sth->rowCount()) return;
    267315                        Header("Location: admin.php?op=consultazione&id_cons_gen=$id_cons_gen");
  • trunk/admin/modules/Elezioni/ele_controlli.php

    r338 r358  
    388388
    389389        if($err){
    390                 if(!$id_lista) $id_lista=0; //$controllo;
    391                 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')";
    392                 $res = $dbi->prepare("$sql");
    393                 $res->execute();               
     390                $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' ";
     391                $res = $dbi->prepare("$sql");
     392                $res->execute();
     393                if(!$res->rowCount()) {
     394                        if(!$id_lista) $id_lista=0; //$controllo;
     395                        $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')";
     396                        $res = $dbi->prepare("$sql");
     397                        $res->execute();       
     398                }
    394399        }
    395400
  • trunk/admin/modules/Elezioni/ele_operatori.php

    r344 r358  
    2626if (isset($_GET['passwd'])) $passwd=addslashes($param['passwd']); else $passwd='';
    2727if (isset($_GET['passwd2'])) $passwd2=addslashes($param['passwd2']); else $passwd2='';
     28if (isset($_GET['stato']) && $aid2!='admin') $stato=intval($param['stato']); else $stato=0;
    2829
    2930include("modules/Elezioni/funzionidata.php");
     
    3738        global $aid, $offset, $prefix, $dbi,$id_cons,$aid2,$id_sede,$id_cons_gen,$mex,$perms;
    3839        //echo $perms;die();
     40
    3941        $bgcolor1=$_SESSION['bgcolor1'];
    4042        $id_comune=$_SESSION['id_comune'];
     
    4446        $rescom->execute();     
    4547        list($descr_com) = $rescom->fetch(PDO::FETCH_NUM);
    46         $sql="SELECT aid,name,email FROM ".$prefix."_authors where aid='$aid2' and id_comune='$id_comune'";
     48        $sql="SELECT aid,name,email,adminop FROM ".$prefix."_authors where aid='$aid2' and id_comune='$id_comune'";
    4749        $resmod = $dbi->prepare("$sql");
    4850        $resmod->execute();     
    49         list ($aid2,$name,$email) = $resmod->fetch(PDO::FETCH_NUM);
     51        list ($aid2,$name,$email,$attivo) = $resmod->fetch(PDO::FETCH_NUM);
    5052        if (isset($_GET['mex'])){
    5153                echo "<table align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0)\">";
     
    6567        echo "</tr><tr align=\"center\">";
    6668        echo "<td><input type=\"hidden\" name=\"pag_op\" value=\"admin.php?op=operatori&amp;id_cons_gen=$id_cons_gen&amp;aid2=\">";
    67         echo "<select name=\"aid2\" onChange=\"top.location.href=this.form.pag_op.value+this.form.aid2.options[this.form.aid2.selectedIndex].value;return false\">";
    68         echo "<option value=\"\">";
     69        echo "<select id=\"aid2\" name=\"aid2\" onChange=\"top.location.href=this.form.pag_op.value+this.form.aid2.options[this.form.aid2.selectedIndex].value;return false\">";
     70        echo "<option value=\"\">Nuovo Utente";
    6971        while(list($utente)=$resins->fetch(PDO::FETCH_NUM)){
    7072                $sel= ($utente == $aid2) ? "selected":"";
     
    8688        echo "<td bgcolor=\"$bgcolor1\"><b>"._NOME."</b></td>"
    8789        ."<td bgcolor=\"$bgcolor1\"><b>"._EMAIL."</b></td>";
     90        echo "<td bgcolor=\"$bgcolor1\"><b>"._STATO."</b></td>";
     91       
     92
    8893        echo "<td bgcolor=\"$bgcolor1\"><b>"._FUNZIONI."</b></td></tr>";
    8994        echo "<tr align=\"center\"><td>";
     
    98103        echo "<td  align=\"center\"><input type=password name=\"passwd2\" size=\"12\"></td>";
    99104        echo "<td><input name=\"name\" value=\"$name\"></td>";
    100         echo "<td><input name=\"email\" value=\"$email\">";
     105        echo "<td><input name=\"email\" value=\"$email\"></td>";
     106        if($attivo==0) {$sel2="selected"; $sel3='';} else {$sel2=''; $sel3="selected";}
     107        echo "<td><select name=\"stato\"><option value=\"0\" $sel2>Attivo<option value=\"1\" $sel3>Disattivo<option value=\"2\" >Elimina</select>";
    101108        echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">";
    102109        echo "<input type=\"hidden\" name=\"ok\" value=0></td>";
     
    113120}
    114121
    115 function operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune) {
     122function operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune,$stato) {
    116123        global $aid, $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang;
    117124        $perms=ChiSei($id_cons_gen);
     125        if($passwd!=$passwd2) {
     126                $mex="- Le password non coincidono! -<br>";
     127                header("location:admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2&name=$name&email=$email&mex=$mex&stato=$stato");
     128        }
    118129       
    119130        if ($perms!=256) $id_comune=$_SESSION['id_comune'];
     
    124135                        $res->execute();       
    125136                        $max=$res->rowCount();
    126                         if ($passwd==$passwd2 and $max==0){
    127                                 if ($aid2=='admin') $super='1,0,0,'; else $super = '0,1,0,';
    128                                 $sql="insert into ".$prefix."_authors (aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage) values ('$aid2','$name','$id_comune' , '$email','".md5($passwd)."',0,$super'$currentlang')";
     137                        if ($max==0){
     138                                if ($aid2=='admin') $super='0,1,0,'; else $super = '0,0,0,';
     139                                $sql="insert into ".$prefix."_authors (aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage) values ('$aid2','$name','$id_comune' , '$email','".md5($passwd)."','0',$super'$currentlang')";
    129140                                $res = $dbi->prepare("$sql");
    130141                                $res->execute();       
     
    133144                                        $res = $dbi->prepare("$sql");
    134145                                        $res->execute();       
    135                                 }
    136                         Header("Location: admin.php?op=operatori&id_cons_gen=$id_cons_gen");
     146                        }
     147                        Header("Location: admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2");
    137148                        }else{
    138149                                $mex='';
    139                                 if($passwd!=$passwd2) $mex="- Le password non coincidono! -<br>";
    140150                                if($max>0) $mex.=" - Utente <b>$aid2</b> presente in archivio! - ";
    141                                 header("location:admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2&name=$name&email=$email&mex=$mex");
    142151                        }
    143152                } elseif ($do == "update") {
    144                         $sql="update  ".$prefix."_authors set name='$name',pwd='".md5($passwd)."', email='$email' where id_comune='$id_comune' and aid='$aid2' ";
    145                         $res = $dbi->prepare("$sql");
    146                         $res->execute();
     153                        if($passwd!='') $mexpwd="pwd='".md5($passwd)."',"; else $mexpwd='';
     154                        if($stato==2){
     155                                $sql="delete from ".$prefix."_authors where aid='$aid2' and id_comune=$id_comune";
     156                                $res = $dbi->prepare("$sql");
     157                                $res->execute();                                       
     158                        }else{
     159                                $sql="update  ".$prefix."_authors set name='$name', $mexpwd email='$email', adminop='$stato' where id_comune='$id_comune' and aid='$aid2' ";
     160                                $res = $dbi->prepare("$sql");
     161                                $res->execute();
     162                        }
    147163                        $result=$res->rowCount();
     164                        if($stato!=0){
     165                                $sql="delete from ".$prefix."_ele_operatori where id_comune='$id_comune' and aid='$aid2' ";
     166                                $res = $dbi->prepare("$sql");
     167                                $res->execute();
     168                        }
    148169                        if (!$result) return;
    149170                        if ($aid2==$aid) $_SESSION['pwd']=md5($passwd);
     
    157178// switch
    158179//****************************
    159         if ($do) operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune);
     180        if ($do) operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune,$stato);
    160181        ele();
    161182        all();
  • trunk/admin/modules/Elezioni/ele_permessi.php

    r344 r358  
    2424list($tipo_cons,$id_cons) = $res->fetch(PDO::FETCH_NUM);
    2525if (isset($param['aid2'])) $aid2=addslashes($param['aid2']); else $aid2='';
    26 if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede='';
     26if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede=0;
    2727if (isset($param['do'])) $do=addslashes($param['do']); else $do='';
    2828if (isset($param['permessi'])) $permessi=addslashes($param['permessi']); else $permessi='';
     
    3030if (isset($param['ok'])) $ok=intval($param['ok']); else $ok='';
    3131if (isset($param['mex'])) $mex=addslashes($param['mex']); else $mex='';
     32if (isset($param['id_sez'])) $id_sez=intval($param['id_sez']); else $id_sez=0;
    3233
    3334include("modules/Elezioni/funzionidata.php");
     
    3940//crea la pagina delle affluenze
    4041function all() {
    41         global $adminop,$adminsuper,$admincomune,$aid, $offset, $prefix, $dbi,$id_cons,$aid2,$permessi,$id_sede,$id_cons_gen,$id_comune,$mex;
     42        global $adminop,$adminsuper,$admincomune,$aid, $offset, $prefix, $dbi,$id_cons,$aid2,$permessi,$id_sede,$id_cons_gen,$id_comune,$mex,$id_sez;
    4243        $bgcolor1=$_SESSION['bgcolor1'];
     44                echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     45               
     46                ."//-->\n";
     47                echo "function controlloref(idsede,idsez) {\n";
     48                echo "let element = window.document.getElementById(idsede); \n";
     49                echo "let elecontr = window.document.getElementById(idsez); \n";
     50                echo "element.selectedIndex = 0 ; \n";
     51                echo "}\n";
     52                echo "function controllosez(idsez, idsede) {\n";
     53                echo "let element = window.document.getElementById(idsez); \n";
     54                echo "let elecontr = window.document.getElementById(idsede); \n";
     55                echo "element.selectedIndex = 0; \n";
     56                echo "}\n";
     57                echo "</script>\n"; 
    4358        if (isset($mex)){
    4459                echo "<table align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0)\">";
     
    5469        echo "<td><b>"._UTENTE."</b></td>"
    5570        ."<td bgcolor=\"$bgcolor1\"><b>"._SEDE."</b></td>"
     71        ."<td bgcolor=\"$bgcolor1\"><b>"._SEZIONE."</b></td>"
    5672        ."<td bgcolor=\"$bgcolor1\"><b>"._PERMESSI."</b></td>";
    5773        echo "<td bgcolor=\"$bgcolor1\"><b>"._FUNZIONI."</b></td></tr>";
     
    7187       
    7288        if (!$listmp) $listmp="''";
    73         $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune=1 and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati
     89        $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune=0 and adminop=0 and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati
    7490        $resins = $dbi->prepare("$sql");
    7591        $resins->execute();                             
    76        
    77          
     92   
    7893        echo "<form name=\"autorizza\" action=\"admin.php\">"
    7994        ."<input type=\"hidden\" name=\"op\" value=\"permessi\">";
     
    90105        $ressede = $dbi->prepare("$sql");
    91106        $ressede->execute();                           
    92         echo "<td><select name=\"id_sede\">";
     107        echo "<td><select id=\"id_sede\" name=\"id_sede\" onchange=controllosez('id_sez','id_sede')>";
    93108        echo "<option value=\"0\"> "._TUTTESEDI;
    94109        if($ressede->rowCount())
     
    99114        }
    100115        echo "</select></td>";
     116        $sql="SELECT id_sez, num_sez from ".$prefix."_ele_sezioni where id_cons=$id_cons order by num_sez";
     117        $ressez = $dbi->prepare("$sql");
     118        $ressez->execute();                             
     119        echo "<td><select id=\"id_sez\" name=\"id_sez\" onchange=controlloref('id_sede','id_sez')>";
     120        echo "<option value=\"0\"> ";
     121        if($ressez->rowCount())
     122        while(list($id,$descr)=$ressez->fetch(PDO::FETCH_NUM)){
     123                $sel= ($id == $id_sez) ? "selected":"";
     124                $arr[$id]=$descr;
     125                echo "<option value=\"$id\" $sel>$descr";
     126        }
     127        echo "</select></td>"; 
    101128        echo "<td><select name=\"permessi\">";
    102129        if(!isset($permessi)) $permessi=16;
     
    115142        if($resmod->rowCount()){
    116143                $i=1;
    117                 while (list($id_cons2,$id_sede2,$id_comunetemp,$perm,$utente) = $resmod->fetch(PDO::FETCH_NUM)){
     144                while (list($id_cons2,$id_sede2,$id_comunetemp,$perm,$utente,$id_circ2,$id_sez2) = $resmod->fetch(PDO::FETCH_NUM)){
    118145                        $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1'];
    119146                        echo "<form name=\"modello$i\" action=\"admin.php\">"
     
    128155                        $ressede = $dbi->prepare("$sql");
    129156                        $ressede->execute();                           
    130                         echo "<td><select name=\"id_sede\">";
    131                         echo "<option value=\"0\"> "._TUTTESEDI;
     157                        echo "<td><select id=\"id_sede$i\" name=\"id_sede\"  onchange=controllosez('id_sez$i','id_sede$i')>";
     158#                       if($id_sez2)
     159#                               echo "<option value=\"0\"> ";
     160#                       else
     161                                echo "<option value=\"0\"> "._TUTTESEDI;
    132162                        while(list($id,$descr)=$ressede->fetch(PDO::FETCH_NUM)){
    133163                                $sel= ($id == $id_sede2) ? "selected":"";
     
    136166                        }
    137167                        echo "</select></td>";
     168                        $sql="SELECT id_sez, num_sez from ".$prefix."_ele_sezioni where id_cons=$id_cons order by num_sez";
     169                        $ressez = $dbi->prepare("$sql");
     170                        $ressez->execute();                             
     171                        echo "<td><select id=\"id_sez$i\" name=\"id_sez\"  onchange=controlloref('id_sede$i','id_sez$i')>";
     172                        echo "<option value=\"0\"> ";
     173                        if($ressez->rowCount())
     174                        while(list($id,$descr)=$ressez->fetch(PDO::FETCH_NUM)){
     175                                $sel= ($id == $id_sez2) ? "selected":"";
     176                                $arr[$id]=$descr;
     177                                echo "<option value=\"$id\" $sel>$descr";
     178                        }
     179                        echo "</select></td>";                         
    138180                        echo "<td><select name=\"permessi\">";
    139181                        if(!isset($perm)) $perm=16;
     
    153195}
    154196
    155 function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune) {
     197function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune,$id_sez) {
    156198        global $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang;
    157199        $perms=ChiSei($id_cons_gen);
     
    159201        if ($perms>32 and $permessi<$perms and $aid2) {
    160202                if ($do == "autorizza") {
    161                         $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2')";
     203                        $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid,id_sez) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2','$id_sez')";
    162204                        $res = $dbi->prepare("$sql");
    163205                        $res->execute();                               
    164206                        Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen");
    165207                } elseif ($do == "update") {
    166                         $sql="update  ".$prefix."_ele_operatori set id_sede='$id_sede' , permessi='$permessi' where id_cons='$id_cons' and aid='$aid2' ";
     208                        $sql="update  ".$prefix."_ele_operatori set id_sede='$id_sede', permessi='$permessi', id_sez='$id_sez' where id_cons='$id_cons' and aid='$aid2' ";
    167209                        $res = $dbi->prepare("$sql");
    168210                        $res->execute();
     
    178220// switch
    179221//****************************
    180         if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune);
     222        if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune,$id_sez);
    181223        ele();
    182224        all();
  • trunk/admin/modules/Elezioni/ele_voti.php

    r352 r358  
    413413$result = $dbi->prepare("$sql");
    414414$result->execute();
    415  
     415
    416416
    417417list($numprefs,$fascia,$id_conf,$flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM);
     
    677677                        echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._DESCR."</b></td>"
    678678                        ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>";
    679                         if($dettnulli && !$disgiunto  && $tipo_cons!=18 && $tipo_cons!=19)
    680                         echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>";
     679#                       if($dettnulli && !$disgiunto  && $tipo_cons!=18 && $tipo_cons!=19)
     680#                       echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>";
    681681                        if($disgiunto){
    682682                        echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLOLIS."</b></td>";
     
    775775                                $cond_sele="and id_lista=$id_lista3";
    776776                                echo "<td align=\"right\" $errcolor><input  name=\"voti$i\" value=\"".$voti."\" size=\"7\"  style=\"text-align:right\">";
    777                                 if($dettnulli && !$disgiunto  && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input  name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\"  style=\"text-align:right\">"; $tvnpl+=$vnpl;}
     777#                               if($dettnulli && !$disgiunto  && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input  name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\"  style=\"text-align:right\">"; $tvnpl+=$vnpl;}
    778778                                if($disgiunto) {echo "</td><td align=\"right\"><input  name=\"slpl$i\" value=\"".$slpl."\" size=\"7\"  style=\"text-align:right\">"; $tslpl+=$slpl;}
    779779                                echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>";
     
    786786                if(!$id_lista) {
    787787                        echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><font size=\"3\">"._TOT._VOTI_LISTA."</font></td><td align=\"center\"><font size=\"3\">$tot_pref</font></td>";
    788                         if($dettnulli && !$disgiunto  && $tipo_cons!=18 && $tipo_cons!=19)
    789                                 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>";
     788#                       if($dettnulli && !$disgiunto  && $tipo_cons!=18 && $tipo_cons!=19)
     789#                               echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>";
    790790                        if($disgiunto)
    791791                                echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tslpl."</font></td>";
  • trunk/admin/modules/Elezioni/query.sql

    r285 r358  
    6565                $sql = "SELECT tipo_cons,descrizione,id_cons_gen FROM ".$prefix."_ele_consultazione order by data_fine desc limit 0,1 ";
    6666        else
    67                 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 ";
     67                $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".
     68                $prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 ";
    6869}
    6970        $sth = $dbi->prepare("$sql");
  • trunk/admin/modules/Elezioni/salva_aff.php

    r344 r358  
    4848$res = $dbi->prepare("$query");
    4949$res->execute();
    50 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16);
    51 list($id_cons)=$res->fetch(PDO::FETCH_NUM);
     50list($id_cons)=$res->fetch(PDO::FETCH_NUM);
    5251$query="select id_parz from ".$prefix."_ele_voti_parziale where data='$data' and orario='$orario' and id_sez='$id_sez' and id_gruppo='$id_gruppo'";
    5352$res = $dbi->prepare("$query");
    5453$res->execute();         
    5554$righe=$res->rowCount();
    56 list($id_parz)=$res->fetch(PDO::FETCH_NUM);
     55list($id_parz)=$res->fetch(PDO::FETCH_NUM); 
    5756if($righe){ #la riga Ú presente e viene aggiorata
    5857        $arr=$res->fetch(PDO::FETCH_BOTH);
     
    8887controllo_aff($id_cons,$id_sez,$id_parz);
    8988include("ele_colora_sez.php");
     89$BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16);
    9090
    9191Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&ops=1&do=spoglio");
  • trunk/admin/modules/Elezioni/salva_gruppi.php

    r352 r358  
    123123$BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16);
    124124Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops");
     125
    125126#################################
    126127
  • trunk/admin/modules/Elezioni/salva_liste.php

    r352 r358  
    5858$res->execute();
    5959list($circo)=$res->fetch(PDO::FETCH_NUM);
    60 
    6160if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco='';
    6261if($id_lista){
     
    9089
    9190##################
    92 # if($id_lista){
     91# if($id_lista){
     92
     93#$andlis="and
    9394        if($pwd3==1) {
    94                 $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'";
     95                if($id_lista) $condiz="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista')"; else $condiz='';
     96                $sql="delete from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' $condiz";
    9597                $res = $dbi->prepare("$sql");
    9698                $res->execute();
     
    111113               
    112114        }elseif($id_lista){
     115
    113116                foreach($idcand as $idkey=>$idc){                       
    114117                        $sql="select num_cand from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' and id_cand='$idc'";
     
    161164$BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16);
    162165Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops");
     166
     167
     168
     169
    163170#################################
    164171
Note: See TracChangeset for help on using the changeset viewer.