Changeset 235 for trunk/admin/modules/Elezioni/ele_associazioni.php
- Timestamp:
- May 31, 2015, 1:59:14 AM (9 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin
-
Property svn:ignore
set to
config.php
-
Property svn:ignore
set to
-
trunk/admin/modules/Elezioni/ele_associazioni.php
r226 r235 45 45 if (isset($_GET['preferenze'])) $preferenze=intval($_GET['preferenze']); else $preferenze=1; 46 46 if (isset($_GET['vismf'])) $vismf=intval($_GET['vismf']); else $vismf=0; 47 if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg=0; 47 48 48 49 $offset=15; … … 55 56 // 56 57 function all() { 57 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 ;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; 58 59 $aid=$_SESSION['aid']; 59 60 $dbi=$_SESSION['dbi']; … … 131 132 } 132 133 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; 134 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>"; 133 135 # echo "<input type=\"hidden\" name=\"pag_cons\" value=\"admin.php?op=associazioni&id_cons_gen=\">"; 134 136 echo "</tr>"; … … 209 211 } 210 212 unset($sel); 211 $rescomu = mysql_query("SELECT vismf from ".$prefix."_ele_cons_comune where id_cons='$id_cons'", $dbi);212 list($vismf )=mysql_fetch_row($rescomu);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); 213 215 echo "<td><select name=\"vismf\">"; 214 216 if ($vismf==0) $sel="selected"; else $sel=""; 215 217 echo "<option value=\"0\" $sel>No"; 216 218 if ($vismf==1) $sel="selected"; else $sel=""; 219 echo "<option value=\"1\" $sel>Si"; 220 echo "</select></td>"; 221 echo "<td><select name=\"sg\">"; 222 if ($sg==0) $sel="selected"; else $sel=""; 223 echo "<option value=\"0\" $sel>No"; 224 if ($sg==1) $sel="selected"; else $sel=""; 217 225 echo "<option value=\"1\" $sel>Si"; 218 226 echo "</select></td>"; … … 245 253 } 246 254 echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; 255 # echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SG."</b></td>"; 247 256 echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b> "._FUNZIONI."</td></tr>"; 248 257 ############### … … 251 260 # $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); 252 261 # else 253 $resmod = mysql_query("SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf 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);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); 254 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 255 264 $resconf = mysql_query("SELECT descrizione FROM ".$prefix."_ele_conf where id_conf='$id_conf'", $dbi); … … 290 299 if ($vismf==0) $sel=_NO; else $sel=_SI; 291 300 echo "<td width=\"10%\">$sel</td>"; 301 # if ($sg==0) $sel=_NO; else $sel=_SI; 302 # echo "<td width=\"10%\">$sel</td>"; 292 303 echo "<td width=\"10\"><input type=\"hidden\" name=\"ok\" value=0><input type=\"submit\" name=\"edit$i\" value=\""._EDIT."\">" 293 304 ."</td></tr></table></form></td></tr>\n"; … … 300 311 301 312 function associazioni($ok, $do,$descr_comu,$id_cons_comu,$id_collegio,$id_comune,$chiusa,$id_conf,$preferenze) { 302 global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf ;313 global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg; 303 314 $delcons=0; 304 315 if ($do !="" and $id_cons_gen>0 and $idcomunenew>0) { … … 307 318 list($delcons)=mysql_fetch_row($rescomu); 308 319 if (!$max){ //se no la inserisce 309 $result = mysql_query("insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf ) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf')", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error());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()); 310 321 $rescomu = mysql_query("SELECT id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomunenew'", $dbi); 311 322 list($id_cons_comu)=mysql_fetch_row($rescomu); … … 321 332 $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()); 322 333 if (!$result) return; 323 $result = mysql_query("update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi)|| die(mysql_error());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()); 324 335 Header("Location: admin.php?op=associazioni&id_cons_gen=$id_cons_gen"); 325 336 }elseif ($do == "add") {
Note:
See TracChangeset
for help on using the changeset viewer.