- LOAD_TEMPLATE("admin_gmenu_delete");
-}
- elseif ((isset($_POST['ok'])) && (!IS_DEMO()))
-{
- // An action is done...
- switch ($_POST['ok'])
- {
- case "edit": // Edit menu
- foreach ($_POST['sel'] as $sel=>$menu)
- {
- // Secure selector
- $sel = bigintval($sel);
-
- // Update entry
- $query = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%d LIMIT 1",
- array($menu, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel], $sel),__FILE__, __LINE__);
- }
- LOAD_TEMPLATE("admin_data_saved");
- break;
-
- case "del": // Delete menu
- foreach ($_POST['sel'] as $sel=>$menu)
- {
- // Delete enty
- $query = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE ".$AND." AND id=%d LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- }
- LOAD_TEMPLATE("admin_data_saved");
- break;
-
- case "status": // Change access levels
- foreach ($_POST['sel'] as $sel=>$menu)
- {
- // Secure selector
- $sel = bigintval($sel);
-
- // Update entry
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='%s', locked='%s' WHERE ".$AND." AND id=%d LIMIT 1",
- array($_POST['visible'][$sel], $_POST['locked'][$sel], $sel), __FILE__, __LINE__);
- }
- LOAD_TEMPLATE("admin_data_saved");
- break;
-
- default: // Unexpected action
- define('__OK_VALUE', $_POST['ok']);
- LOAD_TEMPLATE("admin_menu_unknown_okay");
- break;
- }
-}
- elseif ((isset($_POST['status'])) && ($chk > 0) && (!IS_DEMO()))
-{