if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["sort"])) { $_GET["sort"] = ""; } if (!isset($_GET["order"])) { $_GET["order"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $simcard = new PluginSimcardSimcard(); //Add a new simcard if (isset($_POST["add"])) { $simcard->check(-1, CREATE, $_POST); if ($newID = $simcard->add($_POST)) { Event::log($newID, "simcard", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); // delete a simcard } else { if (isset($_POST["delete"])) { $simcard->check($_POST['id'], DELETE); $ok = $simcard->delete($_POST); if ($ok) { Event::log($_POST["id"], "simcard", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $simcard->redirectToList(); } else { if (isset($_POST["restore"])) {
if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["sort"])) { $_GET["sort"] = ""; } if (!isset($_GET["order"])) { $_GET["order"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $simcard = new PluginSimcardSimcard(); //Add a new computer if (isset($_POST["add"])) { $simcard->check(-1, 'w', $_POST); if ($newID = $simcard->add($_POST)) { } Html::back(); // delete a computer } else { if (isset($_POST["delete"])) { $simcard->check($_POST['id'], 'd'); $ok = $simcard->delete($_POST); if ($ok) { } Html::redirect(getItemTypeSearchURL('PluginSimcardSimcard')); } else { if (isset($_POST["restore"])) { $simcard->check($_POST['id'], 'd'); if ($simcard->restore($_POST)) {