| 12345678910111213141516171819202122 |
- <?php
- /**
- * @var int $id
- * @var int $note_id
- */
- $user = Core::$user;
- $location = Location::get($id);
- if(!$location) throw new Exception("Location not found.");
- if(!Core::$user->hasPermission($location)) throw new Exception("You do not have have permission to access this page.");
- $note = LocationNote::get($note_id);
- if(!$note || $note->location_id != $location->id) throw new Exception("Note not found.");
- $note->dts_deleted = DB::dts();
- $note->commit();
- Core::addAlert("success", "Note deleted successfully.");
- HTTP::redirect("/account/locations/$location->id");
|