| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- namespace App;
- use App\Enums\DocumentTypes;
- /**
- * @var Document[] $documents
- */
- ?>
- <div class="row mb-3">
- <div class="col">
- <h3><?=htmlspecialchars(__("Goods-In"))?></h3>
- </div>
- <div class="col-auto">
- <a class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-document-modal" data-type="<?=DocumentTypes::GOODS_IN?>">
- <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 goods-in documents to display."))?>
- </div>
- <?php
- }
- else {
- ?>
- <table class="table table-bordered table-hover">
- <thead>
- <tr>
- <th><?=htmlspecialchars(__("Number"))?></th>
- <th><?=htmlspecialchars(__("Location"))?></th>
- <th><?=htmlspecialchars(__("Items"))?></th>
- <th><?=htmlspecialchars(__("Actions"))?></th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($documents as $document) {
- $location = $document->getLocation();
- $supplier = $document->getSupplier();
- ?>
- <tr>
- <td class="text-right">
- <?=htmlspecialchars($document->number)?>
- </td>
- <td>
- <?php
- if($location) {
- ?>
- <a href="<?=htmlspecialchars($location->getUrl())?>">
- <?=htmlspecialchars($location->getDisplayName())?>
- </a>
- <?php
- }
- else if($supplier) {
- ?>
- <a href="<?=htmlspecialchars($supplier->getUrl())?>">
- <?=htmlspecialchars($supplier->name)?>
- </a>
- <?php
- }
- ?>
- </td>
- <td>
- Items
- </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
- }
|