Server IP : 184.154.167.98 / Your IP : 18.119.253.198 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/www/mesa/include/ |
Upload File : |
<?php if(!defined('INCLUDE_DIR')) die('!'); require_once(INCLUDE_DIR.'class.note.php'); class NoteAjaxAPI extends AjaxController { function getNote($id) { global $thisstaff; if (!$thisstaff) Http::response(403, "Login required"); elseif (!($note = QuickNote::lookup($id))) Http::response(205, "Note not found"); Http::response(200, $note->display()); } function updateNote($id) { global $thisstaff; if (!$thisstaff) Http::response(403, "Login required"); elseif (!($note = QuickNote::lookup($id))) Http::response(205, "Note not found"); elseif (!isset($_POST['note']) || !$_POST['note']) Http::response(422, "Send `note` parameter"); $note->body = Format::sanitize($_POST['note']); if (!$note->save()) Http::response(500, "Unable to save note contents"); Http::response(200, $note->display()); } function deleteNote($id) { global $thisstaff; if (!$thisstaff) Http::response(403, "Login required"); elseif (!($note = QuickNote::lookup($id))) Http::response(205, "Note not found"); elseif (!$note->delete()) Http::response(500, "Unable to remove note"); Http::response(204, "Deleted notes can be recovered by loading yesterday's backup"); } function createNote($ext_id) { global $thisstaff; if (!$thisstaff) Http::response(403, "Login required"); elseif (!isset($_POST['note']) || !$_POST['note']) Http::response(422, "Send `note` parameter"); $note = new QuickNote(array( 'staff_id' => $thisstaff->getId(), 'body' => Format::sanitize($_POST['note']), 'created' => new SqlFunction('NOW'), 'ext_id' => $ext_id, )); if (!$note->save(true)) Http::response(500, "Unable to create new note"); $show_options = true; include STAFFINC_DIR . 'templates/note.tmpl.php'; } }