| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- namespace App;
- use App\Helpers\HtmlHelper;
- /**
- * @var Product[] $products
- * @var Pagination $pagination
- * @var int $product_id
- * @var int $supplier_id
- * @var string $name
- * @var string $sku
- * @var int $type
- */
- ?>
- <div class="row mb-3">
- <div class="col">
- <h3><?=htmlspecialchars(__("Products"))?></h3>
- </div>
- <div class="col-auto">
- <a class="btn btn-success" href="/products/add">
- <i class="fa fa-fw fa-plus"></i>
- <?=htmlspecialchars(__("Add"))?>
- </a>
- </div>
- </div>
- <div class="card mb-3">
- <div class="card-header">
- <?=htmlspecialchars(__("Filters"))?>
- </div>
- <div class="card-body">
- <form action="/products" method="get">
- <div class="row">
- <div class="col-sm-4">
- <div class="mb-3">
- <label class="form-label" for="product-id"><?=htmlspecialchars(__("ID"))?></label>
- <input class="form-control" type="number" name="product_id" id="product-id" placeholder="<?=htmlspecialchars(__("Type ID"))?>" value="<?=htmlspecialchars($product_id)?>" />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="mb-3">
- <label class="form-label" for="supplier-id"><?= htmlspecialchars(__("Supplier")) ?></label>
- <select class="form-control" name="supplier_id" id="supplier-id">
- <option value=""><?= htmlspecialchars(__("Any Supplier")) ?></option>
- <?php
- HtmlHelper::renderOptions(Supplier::getOptions(), $supplier_id);
- ?>
- </select>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="mb-3">
- <label class="form-label" for="name"><?= htmlspecialchars(__("Name")) ?></label>
- <input class="form-control" type="text" name="name" id="name" placeholder="<?= htmlspecialchars(__("Type name")) ?>" value="<?=htmlspecialchars($name)?>" />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="mb-3">
- <label class="form-label" for="sku"><?= htmlspecialchars(__("SKU")) ?></label>
- <input class="form-control" type="text" name="sku" id="sku" placeholder="<?= htmlspecialchars(__("Type SKU")) ?>" value="<?=htmlspecialchars($sku)?>" />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="mb-3">
- <label class="form-label" for="type"><?=htmlspecialchars(__("Type"))?></label>
- <select class="form-control" name="type" id="type">
- <option value=""><?=htmlspecialchars(__("Any Type"))?></option>
- <?php
- HtmlHelper::renderOptions(Product::getTypeOptions(), $type);
- ?>
- </select>
- </div>
- </div>
- </div>
- <button class="btn btn-primary" type="submit">
- <?=htmlspecialchars(__("Submit"))?>
- </button>
- </form>
- </div>
- </div>
- <?php
- if(empty($products)) {
- ?>
- <div class="alert alert-info">
- <i class="fa fa-fw fa-info-circle"></i>
- <?=htmlspecialchars(__("No products to display."))?>
- </div>
- <?php
- }
- else {
- View::include("products_table", compact("products"));
- $pagination->render();
- }
|