?> <li><a href="#tabs-6">Immagine</a></li> <?php } ?> </ul> <div id="tabs-1"> <table width="100%" border="0" cellspacing="2" cellpadding="2" class="testo"> <tr> <td class="backscuro" width="180">Classe merceologica*</td> <td class="backchiaro"> <select name="fkclasse" id="marchio" class="select" onChange="ajaxCategorie('','');"><option value="">--</option> <?php $objCM = new Classi(); $arrCM = $objCM->getAll(" order by cm_sorting"); foreach ($arrCM as $itemCM) { print "<option value='" . $itemCM["cm_id"] . "'"; if ($fkclasse == $itemCM["cm_id"]) { print " selected"; } print ">" . $itemCM["cm_nome"] . "</option>"; } ?> </select> </td> </tr> <tr> <td width="180" class="backscuro">Categoria*</td> <td width="655" class="backchiaro" id="td_cat"><p class="notaPreAjax">Seleziona la classe merceologica</p><input type='hidden' name='categoria' value='' /></td>
<?php //controllo se si sta facendo un inserimento if (isset($_POST["save"]) and $_POST["save"] == "si") { $nome = $_POST["nome"]; $nome_ita = $_POST["nome_ita"]; $nome_ted = $_POST["nome_ted"]; $object = new Classi(); if (isset($_POST["insert"]) and $_POST["insert"] == "si") { $object->add($nome, $nome_ita, $nome_ted); //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, $nome, $nome_ita, $nome_ted); //upload dei file update_file("pr_classe_merceologica", "classi_dettaglio.php?errore=file&id=" . $id, $id); } print "<script language='Javascript'>window.location.replace('classi_dettaglio.php?id=" . $id . "&ins=si');</script>"; } $nome = ""; $nome_ita = ""; $nome_ted = ""; if (isset($_GET["id"]) and $_GET["id"] != "") { $id = aggiusta_post($_GET["id"]); $nome = $array["cm_nome"]; $nome_ita = $array["cm_nome_ita"]; $nome_ted = $array["cm_nome_ted"]; } ?>