| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- /**
- * @var Location $location
- */
- $user = Core::$user;
- $action = sprintf("/account/locations/%d/add-note", $location->id);
- $notes = $location->getNotes();
- ?>
- <div class="tab-pane fade" id="notes" role="tabpanel" aria-labelledby="notes-tab">
- <form class="card mb-3" action="<?=htmlspecialchars($action)?>" method="post">
- <div class="card-header">
- <?=htmlspecialchars(__("Add Note"))?>
- </div>
- <div class="card-body">
- <label class="sr-only" for="note-content">
- <?=htmlspecialchars(__("Note"))?>
- </label>
- <textarea name="content" id="note-content" rows="4" class="form-control" placeholder="<?=htmlspecialchars(__("Type note"))?>"></textarea>
- </div>
- <div class="card-footer">
- <button class="btn btn-success" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">
- <?=htmlspecialchars(__("Add Note"))?>
- </button>
- </div>
- </form>
- <?php
- if(empty($notes)) {
- ?>
- <div class="alert alert-info">
- <i class="fa fa-fw fa-info-circle"></i>
- <?=htmlspecialchars(__("No notes have been added to this location."))?>
- </div>
- <?php
- }
- else {
- ?>
- <div class="list-group">
- <?php
- foreach($notes as $note) {
- $user = $note->getUser();
- $dt = $note->getDateTimeCreated();
- $dt->setTimezone(new DateTimeZone(TIMEZONE));
- ?>
- <div class="list-group-item">
- <div>
- <strong><?=htmlspecialchars($user->getDisplayName())?></strong>
- <span class="float-right text-muted"><?=htmlspecialchars($dt->format("d/m/Y H:i"))?></span>
- </div>
- <div>
- <?=$note->getContentHTML()?>
- </div>
- </div>
- <?php
- }
- ?>
- </div>
- <?php
- }
- ?>
- </div>
|