Changeset 358 for trunk


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
Files:
39 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/admin.php

    r344 r358  
    1717#$LIMITE=3; //fascia di separazione del maggioritario (15.000 abitanti)
    1818# tempo di sessione: ini_set('session.gc_maxlifetime','3600');
    19 global $multicomune;
     19global $multicomune,$msglogout;
    2020
    2121// Adattamento variabili superglobal
     
    4646$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
    4747if (isset($param['aid'])) $aid=addslashes($param['aid']); else $aid='';
    48 if (isset($param['pwd'])) $pwd2=addslashes($param['pwd']); else $pwd2='';
     48if (isset($param['pwd'])) $pwd2=addslashes($param['pwd']); else $pwd2='';
     49if(isset($param['msglogout'])) $msglogout=intval($param['msglogout']); else $msglogout=0;
     50 
    4951// Additional security (Union, CLike, XSS)
    5052
     
    163165        $_SESSION['startdate']=$row['startdate'];
    164166        $_SESSION['adminmail']=$row['adminmail'];
    165         if (isset($tema) and $tema=='facebook')
    166                 $_SESSION['tema']=$row['tema'];
    167         else $_SESSION['tema']='default';
     167#       if (isset($tema) and $tema=='facebook')
     168#               $_SESSION['tema']=$row['tema'];
    168169        $_SESSION['foot']=$row['foot'];
    169170        $_SESSION['lang']=$row['language'];
     
    185186}
    186187//fine
     188        if (isset($param['tema'])) $_SESSION['tema']=$param['tema'];
     189        if (!isset($_SESSION['tema']))
     190                $_SESSION['tema']='default';
     191        $tema=$_SESSION['tema'];
     192
    187193if (isset($param['aid'])) {
    188         if (strlen($aid)>25 ) { die ("Nome utente troppo lungo: $aid"); }       
     194    if (strlen($aid)>25 ) { die ("Nome utente troppo lungo: $aid"); }   
    189195        if (!isset($param['id_ses']) or $param['id_ses'] != session_id()) logout();
    190196        if (strstr( $aid," ")) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); }
    191         if (isset($_SESSION['aid'])){
     197        if (isset($_SESSION['aid'])){ 
    192198                logout();//se hai gia' una sessione aperta non puoi postare 'aid'
    193199        }else{
    194200               
    195        
    196               //  $pwd2=$param['pwd'];
    197                 $mpwd=md5($pwd2);
    198 
    199                 // se superUserAdmin
    200 ########
    201         $sth = $dbi->prepare("select adminsuper from ".$prefix."_authors where aid='$aid' and pwd='$mpwd'");
    202         $sth->execute();       
    203         $row = $sth->fetch(PDO::FETCH_ASSOC);   
    204                 $adminsuper=$row['adminsuper'];
    205                 if ($adminsuper==1) $id_comune='0';
    206                 elseif (is_numeric($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']);
    207         $sth = $dbi->prepare("select counter,admlanguage from ".$prefix."_authors where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
    208         $sth->execute();       
    209         $esiste=$sth->rowCount();       
    210        
    211 
    212                 if ($esiste){
    213                         $row = $sth->fetch(PDO::FETCH_ASSOC);
     201                          //  $pwd2=$param['pwd'];
     202                        $mpwd=md5($pwd2);
     203
     204                        // se superUserAdmin
     205        ########
     206        #       $sth = $dbi->prepare("select adminsuper from ".$prefix."_authors where aid='$aid' and pwd='$mpwd'");
     207        #       $sth->execute();       
     208        #       $row = $sth->fetch(PDO::FETCH_ASSOC);   
     209                if (isset($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']); else $id_comune=0;;
     210        #       if ($adminsuper==1) $id_comune2=0; else
     211                $id_comune2=$id_comune;
     212                $sth = $dbi->prepare("select pwd,adminop,adminsuper,counter,admlanguage from ".$prefix."_authors where aid='$aid' and (id_comune='$id_comune2' or adminsuper='1')");
     213                $sth->execute();       
     214                $esiste=$sth->rowCount();
     215        #       $adminsuper=$row['adminsuper'];
     216                $row = $sth->fetch(PDO::FETCH_ASSOC);
     217                if(!$esiste) {
     218                        $msglogout=2;
     219                        logout();
     220                }else{
     221                        if ($row['pwd']!=$mpwd) {
     222                                $msglogout=3;
     223                                logout();                               
     224                        }elseif($row['adminop']==1) {
     225                                $msglogout=1;
     226                                logout();                               
     227                        }                               
    214228                        $counter=$row['counter'];
    215229                        $tmplang=$row['admlanguage'];
    216                         $counter+=1;
    217230                        if(strlen($tmplang)==2) $language=$tmplang;
    218                         $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
     231                        $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune2'");
    219232                        $sth->execute();       
    220 #                       $row = $sth->fetch(PDO::FETCH_ASSOC);   
    221                        
     233#                       $row = $sth->fetch(PDO::FETCH_ASSOC);                           
    222234                        if ($esiste==1) {
    223235#                               $_SESSION['dbi']=$dbi;
     
    239251
    240252}
     253if(!isset($_SESSION['BASE'])) $_SESSION['BASE']=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16);
     254if(!isset($language)) $language=$_SESSION['lang'];
    241255if (! isset($_SESSION['lang'])) $_SESSION['lang']=$language;
    242256$currentlang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
    243 if (isset($_SESSION['aid']))
     257
     258if (isset($_SESSION['aid']))
    244259{
    245260//lettura sessione
     
    248263$prefix=$_SESSION['prefix'];
    249264$id_comune=$_SESSION['id_comune'];
     265if($id_comune==0) $rifcomune='58047'; else $rifcomune=$id_comune;
    250266if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']);
    251267else {
    252                         $sth = $dbi->prepare("select id_cons_gen  from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)");
     268                        $sql="SELECT t1.id_cons_gen FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons=t2.id_cons and  t2.id_comune='$id_comune'";
     269                        $sth = $dbi->prepare($sql);
    253270                        $sth->execute();       
    254271                        $row = $sth->fetch(PDO::FETCH_BOTH);
     
    256273                                $id_cons_gen=$row[0];
    257274                        else
    258                         $id_cons_gen=0;
     275                        $id_cons_gen=0; #die("TEST IN CORSO : idconsgen: $id_cons_gen -- sql:select id_cons_gen  from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)");
    259276}
    260277$currentlang=$_SESSION['lang'];
    261 $bgcolor1=$_SESSION['bgcolor1'];
     278#$bgcolor1=$_SESSION['bgcolor1'];
    262279$bgcolor2=$_SESSION['bgcolor2'];
    263280$bgcolor1='#e7e7e7';
     
    265282
    266283$perms=ChiSei($id_cons_gen);
     284if($perms==0) logout();
    267285}
    268286
     
    272290/*********************************************************/
    273291function ChiSei($id_cons_gen){
    274 global $dbi;
     292global $dbi, $msglogout;
    275293
    276294$aid=$_SESSION['aid'];
     
    290308$adminop=$row[2];
    291309
    292 if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {
     310#if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {
    293311        if ($adminsuper==1)
    294312                return 256;
    295         elseif ($adminop==1){
    296                 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'");
    297         }elseif ($admincomune==1) {
     313        elseif ($admincomune==1){
     314                return 64;
     315#               $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'");
     316        }else{
    298317                $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'");
    299                         $sth->execute();       
    300                         $row = $sth->fetch(PDO::FETCH_BOTH);   
    301 
    302                         $id_cons=$row[0];
     318                $sth->execute();       
     319                $row = $sth->fetch(PDO::FETCH_BOTH);   
     320                $id_cons=$row[0];
    303321                $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'");
    304         }
    305                                
    306                         $sth->execute();       
    307                         $row = $sth->fetch(PDO::FETCH_BOTH);   
    308 
    309         if ($sth->rowCount()==1) $perms=$row[0]; else $perms=0;
     322        }       
     323        $sth->execute();       
     324        $row = $sth->fetch(PDO::FETCH_BOTH);
     325                if($row[0]==0) $msglogout=1;
     326        if ($sth->rowCount()==1) $perms=$row[0]; else { $msglogout=1; $perms=0; }
    310327        return $perms;
    311 } else return 0;
     328#} else return 0;
    312329}
    313330
     
    321338
    322339function login() {
    323     global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema;
    324     $lang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
     340    global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema, $id_cons_gen, $perms, $msglogout;
    325341    if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']);
    326342    if (!isset($id_comune)) $id_comune=0;
    327     session_regenerate_id();
     343        if(isset($_SESSION['aid'])){
     344                session_regenerate_id();
     345        }
     346        $lang=(isset($_SESSION['lang']) and strlen($_SESSION['lang'])==2) ? $_SESSION['lang']: $language;
    328347    $id_ses=session_id();
    329 #die("test:$tema");
     348
    330349    //include("modules/Elezioni/language/lang-$lang.php");
     350        if($multicomune==''){
     351                $sth = $dbi->prepare("select multicomune from ".$prefix."_config");
     352                $sth->execute();
     353                list($multicomune) = $sth->fetch(PDO::FETCH_NUM);       
     354        }
    331355    include ("header.php");
    332356    echo "<div align=\"middle\"><font class=\"title\"><b>"._GESTIONE."</b></font></center>";
    333     echo "<br>";  # method=\"post\"
    334     echo "<form name=\"login\" method=\"post\" action=\"admin.php\">"
     357    echo "<br>";  # method=\"post\"
     358        if ($msglogout==1) echo "<h1 style=\"color:red;\">Utente non autorizzato</h1><br>";
     359        elseif ($msglogout==2) echo "<h1 style=\"color:red;\">Nome Utente non presente in archivio</h1><br>";
     360        elseif ($msglogout==3) echo "<h1 style=\"color:red;\">Password Errata</h1><br>";
     361    echo "<form name=\"login\" data-ajax=\"false\" method=\"post\" action=\"admin.php\">"
    335362        ."<table class=\"table-menu\">"
    336363        ."<tr><td>"._ADMINID."</td>"
     
    377404        Header("Location: admin.php?id_comune=$id_comune&language=$lang");
    378405*/
    379 global $siteistat;
     406global $siteistat,$perms,$msglogout;
    380407
    381408$ref="Location: admin.php?";
     409#$ref="Location: https://www.eleonline.it/adminmob/admin.php?";
    382410if (isset($_SESSION['id_comune']))
    383411$id_comune=$_SESSION['id_comune'];
     
    388416if (isset($_SESSION['lang']))
    389417$ref=$ref."&language=".$_SESSION['lang'];
    390 
     418$ref.="&msglogout=$msglogout";
    391419$_SESSION=array(); 
    392420session_unset();
     
    396424
    397425}
    398 
    399 
     426#include("TEST tema: $tema--");
     427#include("modules/Elezioni/language/lang-".$_SESSION['lang'].".php");
     428if(isset($id_cons_gen) and isset($id_comune)){
     429        if(!isset($id_cons)){
     430#               $sql = "SELECT 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' and t2.id_comune='$id_comune'";
     431                $sql = "SELECT id_cons from ".$prefix."_ele_comuni where id_comune='$id_comune'";
     432                $sth = $dbi->prepare("$sql");
     433                $sth->execute();       
     434                if ($sth->rowCount()) list($id_cons) = $sth->fetch(PDO::FETCH_NUM);
     435                $_SESSION['id_cons']=$id_cons;
     436        }
     437        if(isset($id_cons)) {
     438                $sql="SELECT id_sez FROM ".$prefix."_ele_operatori where id_cons=$id_cons and aid='$aid' and id_comune=$id_comune";
     439                $resmod = $dbi->prepare("$sql");
     440                $resmod->execute();                             
     441                list($id_sez) = $resmod->fetch(PDO::FETCH_NUM);
     442                if($id_sez) $tema='Futura2';#die( "TEST id_cons:$id_cons:");
     443                $_SESSION['tema']=$tema;
     444        }
     445}
    400446#echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR'];
    401447if (isset($param['op'])) $op=addslashes($param['op']); else $op='ele';
    402448//if (isset($param['op'])) $op=$param['op']; else $op='ele';
     449#die( "OP: $op");
    403450if (isset($_SESSION['aid']) AND $_SESSION['remote']==$_SERVER['REMOTE_ADDR']) {
     451        if($tema=='Futura2' and $op!='logout')
     452        {
     453                include("temi/$tema/index.php");
     454                testata();
     455        }else
    404456switch($op) {
    405457    case "tipo":
  • trunk/admin/aggiornadb.php

    r357 r358  
    122122        $ret=aggiorna($sql,$dbi,'',$num);
    123123}
    124 
     124if(!controllo($prefix.'_ele_operatori','id_circ',++$num))
     125{
     126        $sql="ALTER TABLE `".$prefix."_ele_operatori` ADD `id_circ` INT(11) NOT NULL  DEFAULT 0 AFTER `aid`";
     127        $ret=aggiorna($sql,$dbi,'',$num);
     128}
     129if(!controllo($prefix.'_ele_operatori','id_circ',++$num))
     130{
     131        $sql="ALTER TABLE `".$prefix."_ele_operatori` ADD `id_sez` INT(11) NOT NULL  DEFAULT 0 AFTER `id_circ`";
     132        $ret=aggiorna($sql,$dbi,'',$num);
     133}
    125134if(!controllo($prefix.'_ele_voti_lista','num_lista',++$num))
    126135{
     
    318327$ret=aggiorna_index($sql,$dbi,$sql2,++$num);
    319328
     329$sql="ALTER TABLE `".$prefix."_ele_consultazione` ADD UNIQUE `descrizione` (`descrizione`(100))";
     330$ret=aggiorna_index($sql,$dbi,$sql2,++$num);
    320331
    321332?>
  • trunk/admin/header.php

    r258 r358  
    66/* info@eleonline.it  luciano@aniene.net rgigli@libero.it               */
    77/************************************************************************/
    8 
     8#aggiornare il db: ALTER TABLE `soraldo_ele_operatori` ADD `id_circ` INT(11) NOT NULL DEFAULT '0' AFTER `aid`, ADD `id_sez` INT(11) NOT NULL DEFAULT '0' AFTER `id_circ`;
    99
    1010if (!defined('ADMIN_FILE')) {
    1111    die ("You can't access this file directly...");
    1212}
     13if(isset($_SESSION['aid'])){
     14include_once("modules/Elezioni/query.sql");
    1315
    14 #include("config.php");
    15 #$dbi = mysql_connect($dbhost, $dbuname, $dbpass);
    16 #mysql_select_db($dbname);
    17         if (isset($param['language'])) {
    18                 $_SESSION['lang']=substr($param['language'],0,2);
    19                 $lang=$_SESSION['lang'];
    20         }
    21         elseif (strlen($_SESSION['lang'])==2) $lang=$_SESSION['lang'];
    22         else $lang=$language;
    23 if ($_SESSION['tema']=='facebook')
     16$row=setconsultazione();
     17if(isset($row[0])) {
     18        $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2];
     19} else {
     20        $tipo_cons=0; $descr_cons=''; $id_cons_gen=0;
     21}
     22$row=tipocons();
     23if(isset($row[0])) {
     24        $genere=$row[0];$votog=$row[1];$votol=$row[2];$votoc=$row[3];$conscirc=$row[4];
     25} else {
     26        $genere=0;$votog=0;$votol=0;$votoc=0;$conscirc=0;
     27}
     28}
     29if (isset($param['language'])) {
     30        $_SESSION['lang']=substr($param['language'],0,2);
     31        $lang=$_SESSION['lang'];
     32}
     33elseif (strlen($_SESSION['lang'])==2) $lang=$_SESSION['lang'];
     34else $lang=$language;
     35include_once("modules/Elezioni/language/lang-$lang.php");
     36
     37
     38###############
     39if(!isset($nocell))$nocell='';
     40### tema mobile Futura 2
     41include("inc/mobile.php"); // riconoscimento mobile
     42$is_mobile=is_mobile();
     43
     44if($is_mobile && $nocell!=1){
     45        global $id_sez;
     46#####TEST sezione fissa da impostare iniziando con l'assegnazione del permesso all'operatore di sezione
     47#$id_sez=3378;
     48        $tema="Futura2";
     49} elseif (isset($_SESSION['tema']))
    2450        $tema=$_SESSION['tema'];
    25 else $tema='default';
    26 include("temi/$tema/index.php");
    27 include("modules/Elezioni/language/lang-$lang.php");
     51$_SESSION['tema']=$tema;
     52#else
     53#       $tema='Futura2';
     54#include("temi/$tema/index.php");
    2855
    2956$bgcolor1="#b0b0b0";
    3057function head() {
    31         global $csv,$tema;
     58        global $csv,$tema,$id_cons_gen;
    3259 #   echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
    3360    echo "<!DOCTYPE HTML>\n";
     
    3966    echo "<script type=\"text/javascript\" src=\"inc/ckeditor/ckeditor.js\"></script>"; //ckeditor 2015
    4067    echo "<link rel=\"StyleSheet\" href=\"temi/$tema/style.css\" type=\"text/css\">\n\n\n";
     68        if (file_exists("temi/$tema/themeutils.php")) {
     69                include("temi/$tema/themeutils.php"); #incluso x tema mobile
     70        }
    4171    echo "\n\n\n</head>\n<body style=\"background-image: url(temi/$tema/images/sfondo.jpg);\">";
    42     if (!$csv)testata($tema);
     72 #   if (!$csv)testata($tema);
    4373   
    4474
  • trunk/admin/inc/sql/db.sql

    r357 r358  
    66aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage
    77[_config]
    8 sitename,siteurl,site_logo,slogan,startdate,adminmail,tema,foot,language,blocco,testata,nome_testata,fileout,copyright,versione,patch,siteistat,multicomune,flash,displayerrors,gkey,googlemaps,editor,tema_on,ed_user,secret
     8sitename,siteurl,site_logo,slogan,startdate,adminmail,tema,foot,language,blocco,testata,nome_testata,fileout,copyright,versione,patch,siteistat,multicomune,flash,displayerrors,gkey,googlemaps,editor,tema_on,ed_user
    99[_doc_cons]
    1010id_cons,id_doc,tabella
     
    4646id_cons,mid,title,preamble,content,editimage
    4747[_ele_operatori]
    48 id_cons,id_sede,id_comune,permessi,aid
     48id_cons,id_sede,id_comune,permessi,aid,id_circ,id_sez
    4949[_ele_province]
    5050id,descrizione
  • 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
  • trunk/admin/versione.php

    r357 r358  
    11<?php
    22
    3 $versione = "3.0 rev 357";
     3$versione = "3.0 rev 358";
    44$version_number = $versione;
    5 $datarel = "29 dicembre 2021";
     5$datarel = "23 febbraio 2022";
    66$version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
    77
  • trunk/client/versione.php

    r357 r358  
    11<?php
    22
    3 $versione = "3.0 rev 357";
     3$versione = "3.0 rev 358";
    44$version_number = $versione;
    5 $datarel = "29 dicembre 2021";
     5$datarel = "23 febbraio 2022";
    66$version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
    77
Note: See TracChangeset for help on using the changeset viewer.