Ignore:
Timestamp:
Apr 28, 2017, 11:31:47 PM (7 years ago)
Author:
roby
Message:

admin: modificata la gestione del voto disgiunto

File:
1 edited

Legend:

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

    r235 r257  
    4646if (isset($_GET['vismf'])) $vismf=intval($_GET['vismf']); else $vismf=0;
    4747if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg=0;
     48if (isset($_GET['disgiunto'])) $disgiunto=intval($_GET['disgiunto']); else $disgiunto=0;
    4849
    4950$offset=15;
     
    5657        //
    5758        function all() {
    58         global $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help,$preferenze,$idfascia,$vismf,$sg;
     59        global $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help,$preferenze,$idfascia,$vismf,$sg,$disgiunto;
    5960$aid=$_SESSION['aid'];
    6061$dbi=$_SESSION['dbi'];
     
    133134        echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>";
    134135        echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>";
     136        echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._DISGIUNTO."</b></td>";
    135137#       echo "<input type=\"hidden\" name=\"pag_cons\" value=\"admin.php?op=associazioni&amp;id_cons_gen=\">";
    136138        echo "</tr>";
     
    211213        }
    212214        unset($sel);
    213         $rescomu = mysql_query("SELECT vismf,solo_gruppo from ".$prefix."_ele_cons_comune where id_cons='$id_cons'", $dbi);
    214         list($vismf,$sg)=mysql_fetch_row($rescomu);
     215        $rescomu = mysql_query("SELECT vismf,solo_gruppo,disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons'", $dbi);
     216        list($vismf,$sg,$disgiunto)=mysql_fetch_row($rescomu);
    215217        echo "<td><select name=\"vismf\">";
    216218        if ($vismf==0) $sel="selected"; else $sel="";
     
    225227        echo "<option value=\"1\" $sel>Si";
    226228        echo "</select></td>";
    227 
     229        echo "<td><select name=\"disgiunto\">";
     230        if ($disgiunto==0) $sel="selected"; else $sel="";
     231        echo "<option value=\"0\" $sel>No";
     232        if ($disgiunto==1) $sel="selected"; else $sel="";
     233        echo "<option value=\"1\" $sel>Si";
     234        echo "</select></td>";
     235       
    228236        echo "<td><input type=\"hidden\" name=\"ok\" value=0>";
    229237        echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">";
     
    311319
    312320function associazioni($ok, $do,$descr_comu,$id_cons_comu,$id_collegio,$id_comune,$chiusa,$id_conf,$preferenze) {
    313         global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg;
     321        global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg,$disgiunto;
    314322        $delcons=0;
    315323        if ($do !="" and $id_cons_gen>0 and $idcomunenew>0) {
     
    318326                        list($delcons)=mysql_fetch_row($rescomu);
    319327                        if (!$max){                     //se no la inserisce
    320                         $result = mysql_query("insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf,solo_gruppo) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf','$sg')", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error());
     328                        $result = mysql_query("insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf,solo_gruppo,disgiunto) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf','$sg','$disgiunto')", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error());
    321329                        $rescomu = mysql_query("SELECT id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomunenew'", $dbi);
    322330                list($id_cons_comu)=mysql_fetch_row($rescomu);
     
    332340                        $result = mysql_query("update ".$prefix."_ele_comu_collegi set id_collegio= '$id_collegio' $newid where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi) || die(mysql_error());
    333341                        if (!$result) return;
    334                         $result = mysql_query("update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf',solo_gruppo='$sg' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi)|| die(mysql_error());
     342                        $result = mysql_query("update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf',solo_gruppo='$sg',disgiunto='$disgiunto' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi)|| die(mysql_error());
    335343                        Header("Location: admin.php?op=associazioni&id_cons_gen=$id_cons_gen");
    336344                }elseif ($do == "add") {
Note: See TracChangeset for help on using the changeset viewer.