| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- namespace App;
- use App\Enums\DocumentTypes;
- /**
- * @var Document[] $documents
- * @var Pagination $pagination
- */
- ?>
- <div class="row mb-3">
- <div class="col">
- <h3><?=htmlspecialchars(__("ARUs"))?></h3>
- </div>
- <div class="col-auto">
- <a class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-document-modal" data-type="<?=DocumentTypes::ADVANCE_REPLACEMENT_UNIT?>">
- <i class="fa fa-fw fa-plus"></i>
- <?=htmlspecialchars(__("Add"))?>
- </a>
- </div>
- </div>
- <?php
- if(empty($documents)) {
- ?>
- <div class="alert alert-info">
- <i class="fa fa-fw fa-info-circle"></i>
- <?=htmlspecialchars(__("No ARU documents to display."))?>
- </div>
- <?php
- }
- else {
- ?>
- <table class="table table-bordered table-hover mb-3">
- <thead>
- <tr>
- <th><?=htmlspecialchars(__("Number"))?></th>
- <th><?=htmlspecialchars(__("Location"))?></th>
- <th><?=htmlspecialchars(__("Status"))?></th>
- <th><?=htmlspecialchars(__("Items"))?></th>
- <th><?=htmlspecialchars(__("Actions"))?></th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($documents as $document) {
- $location = $document->getLocation();
- ?>
- <tr>
- <td class="text-end">
- <?=htmlspecialchars($document->number)?>
- </td>
- <td>
- <a href="<?=htmlspecialchars($location->getUrl())?>">
- <?=htmlspecialchars($location->getDisplayName())?>
- </a>
- </td>
- <td>
- <?=htmlspecialchars($document->getDisplayAruStatus())?>
- </td>
- <td>
- <ul class="list-unstyled mb-0">
- <?php
- foreach($document->getItems() as $item) {
- ?>
- <li>
- <?=htmlspecialchars($item->description)?> × <?=$item->quantity?>
- <?php
- if($item->serial_number) {
- ?>
- <span class="text-muted">
- (S/N: <?=htmlspecialchars($item->serial_number)?>)
- </span>
- <?php
- }
- ?>
- </li>
- <?php
- }
- ?>
- </ul>
- </td>
- <td class="p-1">
- <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($document->getUrl())?>">
- <?=htmlspecialchars(__("View"))?>
- </a>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <?php
- $pagination->render();
- }
|