$pubblicato_uk = "f"; if (isset($_POST["pubblicato_eur"]) and $_POST["pubblicato_eur"] == "t") { $pubblicato_eur = "t"; } if (isset($_POST["pubblicato_uk"]) and $_POST["pubblicato_uk"] == "t") { $pubblicato_uk = "t"; } $object = new Sottocategorie(); if (isset($_POST["insert"]) and $_POST["insert"] == "si") { $object->add($fk_cat, $sottocategoria, $sottocategoria_ita, $sottocategoria_ted, $pubblicato_eur, $pubblicato_uk); //recupero l'ultimo id inserito $db = new Db(); $id = $db->get_last_id(); } elseif (isset($_POST["update"]) and $_POST["update"] == "si") { $id = aggiusta_post($_GET["id"]); $object->update($id, $fk_cat, $sottocategoria, $sottocategoria_ita, $sottocategoria_ted, $pubblicato_eur, $pubblicato_uk); //upload dei file update_file("pr_sottocategoria", "sottocategorie_dettaglio.php?errore=file&id=" . $id, $id); } print "<script language='Javascript'>window.location.replace('sottocategorie_dettaglio.php?id=" . $id . "&ins=si');</script>"; } $fkclasse = ""; $sottocategoria = ""; $sottocategoria_ita = ""; $sottocategoria_ted = ""; $pubblicato_eur = ""; $pubblicato_uk = ""; if (isset($_GET["id"]) and $_GET["id"] != "") { $id = aggiusta_post($_GET["id"]); $objCat = new Categorie(); $arrCat = $objCat->getById($array["sc_fkcat"]);