"; echo ""._CONSULTA.""; echo ""._COLLEGI.""; echo ""; echo "
" .""; echo ""; echo ""; $ressede = mysql_query("SELECT descrizione from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'", $dbi); list($descr_cons)=mysql_fetch_row($ressede); echo "$descr_cons"; echo ""; echo ""; echo ""; if ($desc) { echo ""; echo "
"; }else{ echo ""; echo ""; } $i=0; while (list($id_collegio2,$desc,$descr_cons) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti $i++; $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; echo "
" .""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "$desc"; echo ""; echo "[ "._EDIT."]"; echo "" ."
"; } echo ""; CloseTable(); } function collegi($ok, $do,$desc,$id_collegio) { global $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons, $id_cons_gen,$genere; if ($do !="") { if ($do == "delete") { if ($ok !="1") { ele(); echo "


"._DOMCANCELLA." "._COLLEGIO." $desc ?
"; echo "[ "._NO." ] - ["._YES." ]"; die(); }else{ $result = mysql_query("delete from ".$prefix."_ele_collegi where id_collegio='$id_collegio'", $dbi); if (!$result) return; Header("Location: admin.php?op=inscollegi&id_cons_gen=$id_cons_gen"); } } if ($do == "add") { $result = mysql_query("insert into ".$prefix."_ele_collegi(id_cons_gen,descrizione) values ('$id_cons_gen','$desc')", $dbi) || die("Impossibile inserire il collegio! ".mysql_error()); } if ($do == "update") { $result = mysql_query("update ".$prefix."_ele_collegi set descrizione='$desc' , id_cons_gen='$id_cons_gen' where id_collegio='$id_collegio'", $dbi); if (!$result) return; # echo "update ".$prefix."_ele_collegi set descrizione='$desc' , id_cons_gen='$id_cons_gen' where id_collegio='$id_collegio'"; Header("Location: admin.php?op=inscollegi&id_cons_gen=$id_cons_gen&id_collegio=$id_collegio"); } } } //**************************** switch ($op){ case "inscollegi": if ($desc){ collegi($ok, $do,$desc,$id_collegio); }else collegi('','','',''); break; } ele(); all(); include("footer.php"); ?>