case "setpic": set_pic(); show_menu(); show_info(); break; case "setsymbol": set_symbol(); show_menu(); show_info(); break; case "info": show_menu(); show_info(); break; case "delete_note": delete_note(); show_menu(); show_journal(); break; case "send_note": send_note(); show_menu(); show_journal(); break; case "show_journal": show_menu(); show_journal(); break; case "proc_reply": proc_reply(); show_menu();
} //Validate Form token $token = POST('token'); $tk_key = 'tk_' . $action; if (Token::verify($tk_key, $token) == FALSE) { $error = Token::create_error_message(); Util::response_bad_request($error); } $db = new ossim_db(); $conn = $db->connect(); try { $response = array(); switch ($action) { case 'add_note': $response = add_note($conn, $type); break; case 'edit_note': $response = edit_note($conn); break; case 'delete_note': $response = delete_note($conn); break; default: Av_exception::throw_error(Av_exception::USER_ERROR, _('Invalid Action.')); } } catch (Exception $e) { $db->close(); Util::response_bad_request($e->getMessage()); } $db->close(); echo json_encode($response);
function deletenote($userId, $noteId) { $this->load->helper('note'); delete_note($noteId); redirect("admin/volunteers/show/{$userId}"); }
<?php $id = htmlspecialchars($_GET["id"]); function delete_note($id) { include 'dbconnect.php'; $query = "Delete FROM Notiz WHERE id=" . $id; $result = mysqli_query($connection, $query); if ($result) { echo "ok"; } else { echo "nicht ok"; } } delete_note($id);
<?php session_start(); require_once "../file-includes.php"; $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $note_id = fix_string($request->noteID); $userID = (int) get_userID_session(); delete_note($note_id, $userID);
create_work(filter_input(INPUT_POST, 'action_id', FILTER_SANITIZE_NUMBER_INT)); break; case "deactivate_achievement": deactivate_achievement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "does_username_already_exist": echo json_encode(does_username_already_exist(filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING))); break; case "remove_achievement": remove_achievement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_action": delete_action(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_note": delete_note(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_relation": delete_relation(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_requirement": delete_requirement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_tag": delete_tag(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_todo": delete_todo(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT)); break; case "delete_top_action": delete_top_action(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
<?php if (isset($_POST['ID'])) { delete_note($_POST['ID']); } $id = $_GET['path']; if ((string) (int) $id != $id) { _die("Invalid ID"); } $result = db("SELECT * FROM public.\"notes\" WHERE \"ID\" = " . pg_escape_string($_GET['path'])); if (pg_num_rows($result) == 0) { _die("Does not exists.", "404"); } function delete_note($id) { if ((string) (int) $id != $id) { _die("Invalid ID"); } require_once "lib/tags.php"; $result = db("DELETE FROM public.\"notes\" WHERE \"ID\" = " . pg_escape_string($id)); if ($result) { if (rebuild_tags()) { _die("Note was purged successfully."); } else { _die("There was an error building the tag cloud data. Please run make_tags.php to fix this."); } } else { _die("There was an unexpected error."); } } ?>