prepare("$sql");
$resmod->execute();
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");
?>