Changeset 254 for trunk/admin/modules/Elezioni/ele_associazioni.php
- Timestamp:
- Mar 13, 2018, 9:26:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_associazioni.php
r235 r254 46 46 if (isset($_GET['vismf'])) $vismf=intval($_GET['vismf']); else $vismf=0; 47 47 if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg=0; 48 if (isset($_GET['disgiunto'])) $disgiunto=intval($_GET['disgiunto']); else $disgiunto=0; 48 49 49 50 $offset=15; … … 56 57 // 57 58 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; 59 60 $aid=$_SESSION['aid']; 60 61 $dbi=$_SESSION['dbi']; … … 133 134 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; 134 135 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>"; 136 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._DISGIUNTO."</b></td>"; 135 137 # echo "<input type=\"hidden\" name=\"pag_cons\" value=\"admin.php?op=associazioni&id_cons_gen=\">"; 136 138 echo "</tr>"; … … 211 213 } 212 214 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); 215 217 echo "<td><select name=\"vismf\">"; 216 218 if ($vismf==0) $sel="selected"; else $sel=""; … … 225 227 echo "<option value=\"1\" $sel>Si"; 226 228 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 228 236 echo "<td><input type=\"hidden\" name=\"ok\" value=0>"; 229 237 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"; … … 243 251 ############ 244 252 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>"; 246 254 # echo "<td bgcolor=\"$bgcolor1\"><b>"._COLLEGI."</b></td>"; 247 255 echo "<td width=\"20%\" bgcolor=\"$bgcolor1\"><b>"._DEFCOMUNE."</b></td>"; … … 253 261 } 254 262 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>"; 255 265 # echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SG."</b></td>"; 256 266 echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b> "._FUNZIONI."</td></tr>"; … … 260 270 # $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); 261 271 # 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 inseriti272 $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 264 274 $resconf = mysql_query("SELECT descrizione FROM ".$prefix."_ele_conf where id_conf='$id_conf'", $dbi); 265 275 list($descr_conf) = mysql_fetch_row($resconf); 266 276 $i++; 267 277 $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\">"; 269 279 echo "<form name=\"modello$i\" action=\"admin.php\">" 270 280 ."<input type=\"hidden\" name=\"op\" value=\"associazioni\">"; … … 297 307 298 308 } 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; 300 314 echo "<td width=\"10%\">$sel</td>"; 301 315 # if ($sg==0) $sel=_NO; else $sel=_SI; … … 311 325 312 326 function 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; 314 328 $delcons=0; 315 329 if ($do !="" and $id_cons_gen>0 and $idcomunenew>0) { … … 318 332 list($delcons)=mysql_fetch_row($rescomu); 319 333 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()); 321 335 $rescomu = mysql_query("SELECT id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomunenew'", $dbi); 322 336 list($id_cons_comu)=mysql_fetch_row($rescomu); … … 332 346 $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()); 333 347 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()); 335 349 Header("Location: admin.php?op=associazioni&id_cons_gen=$id_cons_gen"); 336 350 }elseif ($do == "add") {
Note:
See TracChangeset
for help on using the changeset viewer.