Ignore:
Timestamp:
Mar 13, 2018, 9:26:23 PM (6 years ago)
Author:
roby
Message:

adeguata la funzione di installazione al php7

File:
1 edited

Legend:

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

    r235 r254  
    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,$id_cons_comu;
    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_comu'", $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\">";
     
    243251############
    244252        echo "<hr><br><table width=\"100%\" border=\"3\">";
    245         echo "<tr align=\"center\"><td width=\"15%\" bgcolor=\"$bgcolor1\"><b>"._CONSULTA."</b></td>";
     253        echo "<tr align=\"center\"><td width=\"15%\" bgcolor=\"$bgcolor1\"><b>"._CONSULTA."TEST:$id_cons_comu</b></td>";
    246254#       echo "<td bgcolor=\"$bgcolor1\"><b>"._COLLEGI."</b></td>";
    247255        echo "<td width=\"20%\" bgcolor=\"$bgcolor1\"><b>"._DEFCOMUNE."</b></td>";
     
    253261                }
    254262        echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>";
     263        echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>";
     264        echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._DISGIUNTO."</b></td>";
    255265#       echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SG."</b></td>";
    256266        echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b>&nbsp;"._FUNZIONI."</td></tr>";
     
    260270#       $resmod = mysql_query("SELECT t1.id_collegio,t1.id_comune,t2.descrizione as descr,t1.id_cons, t3.descrizione, t4.chiusa,t4.id_conf FROM ".$prefix."_ele_comu_collegi as t1, ".$prefix."_ele_collegi as t2, ".$prefix."_ele_comuni as t3, ".$prefix."_ele_cons_comune as t4 where t1.id_cons_gen='$id_cons_gen' and t1.id_collegio=t2.id_collegio and t1.id_comune=t3.id_comune and t1.id_comune=t4.id_comune and t2.id_cons_gen=t4.id_cons_gen order by t2.descrizione, t3.descrizione", $dbi);
    261271#       else
    262         $resmod = mysql_query("SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf,t1.solo_gruppo FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione", $dbi);
    263         while (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf,$preferenze2,$fasciacom,$vismf) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti
     272        $resmod = mysql_query("SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf,t1.solo_gruppo,t1.disgiunto FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione", $dbi);
     273        while (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf,$preferenze2,$fasciacom,$vismf2,$sg2,$disgiunto2) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti
    264274                $resconf = mysql_query("SELECT descrizione FROM ".$prefix."_ele_conf where id_conf='$id_conf'", $dbi);
    265275                list($descr_conf) = mysql_fetch_row($resconf);
    266276                $i++;
    267277                $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1'];
    268                 if($tipo_cons==3) echo "<tr><td colspan=\"8\">"; else echo "<tr><td colspan=\"6\">";
     278                if($tipo_cons==3) echo "<tr><td colspan=\"8\">"; else echo "<tr><td colspan=\"8\">";
    269279                echo "<form name=\"modello$i\" action=\"admin.php\">"
    270280                        ."<input type=\"hidden\" name=\"op\" value=\"associazioni\">";
     
    297307
    298308                }
    299                 if ($vismf==0) $sel=_NO; else $sel=_SI;
     309                if ($vismf2==0) $sel=_NO; else $sel=_SI;
     310                echo "<td width=\"10%\">$sel</td>";
     311                if ($sg2==0) $sel=_NO; else $sel=_SI;
     312                echo "<td width=\"10%\">$sel</td>";
     313                if ($disgiunto2==0) $sel=_NO; else $sel=_SI;
    300314                echo "<td width=\"10%\">$sel</td>";
    301315#               if ($sg==0) $sel=_NO; else $sel=_SI;
     
    311325
    312326function 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;
     327        global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg,$disgiunto;
    314328        $delcons=0;
    315329        if ($do !="" and $id_cons_gen>0 and $idcomunenew>0) {
     
    318332                        list($delcons)=mysql_fetch_row($rescomu);
    319333                        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());
     334                        $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());
    321335                        $rescomu = mysql_query("SELECT id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomunenew'", $dbi);
    322336                list($id_cons_comu)=mysql_fetch_row($rescomu);
     
    332346                        $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());
    333347                        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());
     348                        $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());
    335349                        Header("Location: admin.php?op=associazioni&id_cons_gen=$id_cons_gen");
    336350                }elseif ($do == "add") {
Note: See TracChangeset for help on using the changeset viewer.