prepare("$sql"); $resmod->execute(); echo ""; echo ""; echo ""; echo ""; echo "" .""; echo ""; echo ""; $sql = "SELECT descrizione from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'"; $ressede = $dbi->prepare("$sql"); $ressede->execute(); list($descr_cons)=$ressede->fetch(PDO::FETCH_NUM); echo ""; echo ""; echo ""; echo ""; if ($desc) { echo ""; echo ""; }else{ echo ""; echo ""; } $i=0; while (list($id_collegio2,$desc,$descr_cons) = $resmod->fetch(PDO::FETCH_NUM)){ //elenco dei modelli inseriti $i++; $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; echo "" .""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
"._CONSULTA.""._COLLEGI."
$descr_cons
$desc[ "._EDIT."]"; 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{ $sql = "delete from ".$prefix."_ele_collegi where id_collegio='$id_collegio'"; $result = $dbi->prepare("$sql"); $result->execute(); if (!$result->rowCount()) return; Header("Location: admin.php?op=inscollegi&id_cons_gen=$id_cons_gen"); } } if ($do == "add") { $sql = "insert into ".$prefix."_ele_collegi(id_cons_gen,descrizione) values ('$id_cons_gen','$desc')"; $result = $dbi->prepare("$sql"); $result->execute(); } if ($do == "update") { $sql= "update ".$prefix."_ele_collegi set descrizione='$desc' , id_cons_gen='$id_cons_gen' where id_collegio='$id_collegio'"; $result = $dbi->prepare("$sql"); $result->execute(); if (!$result->rowCount()) return; 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"); ?>