/** * @throws EquipmentTypeIDMissingException */ public static function delete() { if ($_GET['id']) { if ($_GET['sure'] != "true") { $template = new HTMLTemplate("equipment/admin/equipment_type/delete.html"); $paramquery = $_GET; $paramquery['sure'] = "true"; $params = http_build_query($paramquery); $template->set_var("yes_params", $params); $paramquery = $_GET; unset($paramquery['sure']); unset($paramquery['action']); unset($paramquery['id']); $params = http_build_query($paramquery, '', '&'); $template->set_var("no_params", $params); $template->output(); } else { $paramquery = $_GET; unset($paramquery['sure']); unset($paramquery['action']); unset($paramquery['id']); $params = http_build_query($paramquery, '', '&'); $equipment_type = new EquipmentType($_GET['id']); if ($equipment_type->delete()) { Common_IO::step_proceed($params, "Delete Type Category", "Operation Successful", null); } else { Common_IO::step_proceed($params, "Delete Type Category", "Operation Failed", null); } } } else { throw new EquipmentTypeIDMissingException(); } }