header("Location: ../index.php?view=list-menu&stt=fail"); } } break; case "xoa": $id = $_POST['id']; $parent_id = $_POST['parent_id']; if ($parent_id == 0) { $parent_id = '0'; } $menu_obj = new menu(); if ($menu_obj->delMenu($id)) { $temp_arr = $menu_obj->getMenuByParentId($id); if (is_array($temp_arr)) { foreach ($temp_arr as $values) { $menu_obj->updateMenu('', '', $parent_id, '', '', $values['menu_id']); } } header("Location: ../index.php?view=list-menu&stt=success"); } else { header("Location: ../index.php?view=list-menu&stt=fail"); } break; default: if (isset($_POST['menu_name']) && isset($_POST['position']) && isset($_POST['menu_type']) && isset($_POST['parent_id']) && isset($_POST['menu_group'])) { $menu_obj = new menu(); $menu_gr_id = $_POST['menu_group']; $menu_name = $_POST['menu_name']; $position = $_POST['position']; $menu_type = $_POST['menu_type']; $parent_id = $_POST['parent_id'];