|
|
@@ -12,14 +12,15 @@ use App\Helpers\HtmlHelper;
|
|
|
$core = Core::getInstance();
|
|
|
$user = $core->getUser();
|
|
|
|
|
|
-$suppliers = Supplier::getAll();
|
|
|
$request = Request::fromRequest();
|
|
|
|
|
|
if($product->isNew()) {
|
|
|
$supplier_id = $request->int("supplier_id");
|
|
|
+ $new = 1;
|
|
|
}
|
|
|
else {
|
|
|
$supplier_id = $product->supplier_id;
|
|
|
+ $new = 0;
|
|
|
}
|
|
|
|
|
|
?>
|
|
|
@@ -30,28 +31,21 @@ else {
|
|
|
$user->insertCsrfToken();
|
|
|
?>
|
|
|
|
|
|
- <div class="mb-3">
|
|
|
- <label class="form-label" for="supplier-id"><?=htmlspecialchars(__("Supplier"))?></label>
|
|
|
- <select class="form-select" name="supplier_id" id="supplier-id" required>
|
|
|
- <option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
|
|
|
- <?php
|
|
|
- HtmlHelper::renderOptions(Supplier::getOptions(), $supplier_id);
|
|
|
- ?>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="mb-3">
|
|
|
- <label class="form-label" for="name"><?=htmlspecialchars(__("Name"))?></label>
|
|
|
- <input class="form-control" type="text" id="name" name="name" placeholder="<?=htmlspecialchars(__("Type name"))?>" value="<?=htmlspecialchars($product->name)?>" maxlength="255" required />
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="mb-3">
|
|
|
- <label class="form-label" for="sku"><?=htmlspecialchars(__("SKU"))?></label>
|
|
|
- <input class="form-control" type="text" id="sku" name="sku" placeholder="<?=htmlspecialchars(__("Type SKU"))?>" value="<?=htmlspecialchars($product->sku)?>" maxlength="255" required />
|
|
|
- </div>
|
|
|
+ <input type="hidden" id="new" value="<?=$new?>" />
|
|
|
|
|
|
<div class="row">
|
|
|
- <div class="col-6">
|
|
|
+ <div class="col-sm-6">
|
|
|
+ <div class="mb-3">
|
|
|
+ <label class="form-label" for="supplier-id"><?=htmlspecialchars(__("Supplier"))?></label>
|
|
|
+ <select class="form-select" name="supplier_id" id="supplier-id" required>
|
|
|
+ <option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
|
|
|
+ <?php
|
|
|
+ HtmlHelper::renderOptions(Supplier::getOptions(), $supplier_id);
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-6">
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label" for="type"><?=htmlspecialchars(__("Type"))?></label>
|
|
|
<select class="form-select" name="type" id="type" required>
|
|
|
@@ -67,6 +61,21 @@ else {
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="mb-3">
|
|
|
+ <label class="form-label" for="name"><?=htmlspecialchars(__("Name"))?></label>
|
|
|
+ <input class="form-control" type="text" id="name" name="name" placeholder="<?=htmlspecialchars(__("Type name"))?>" value="<?=htmlspecialchars($product->name)?>" maxlength="255" required />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-6">
|
|
|
+ <div class="mb-3">
|
|
|
+ <label class="form-label" for="sku"><?=htmlspecialchars(__("SKU"))?></label>
|
|
|
+ <input class="form-control" type="text" id="sku" name="sku" placeholder="<?=htmlspecialchars(__("Type SKU"))?>" value="<?=htmlspecialchars($product->sku)?>" maxlength="255" required />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="col-6">
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label" for="price"><?=htmlspecialchars(__("Price"))?></label>
|