n_oct/themes/nurgul/partials/seller/prod-update.htm

203 lines
8.3 KiB
HTML
Raw Normal View History

2023-08-25 21:39:39 +00:00
<div class="intro-y flex items-center mt-8">
<h2 class="text-lg font-medium mr-auto">
{{'seller.product.update.title'|_}}
</h2>
<div class="flex items-center ml-auto alert alert-success-soft show flex items-center mb-2" role="alert"
style="padding: 5px;font-size: 12px;padding-top: 2px;padding-bottom: 2px;">USD: {{order.kurs}}</div>
</div>
<div class="grid grid-cols-12 gap-6 mt-5">
<div class="intro-y col-span-12 lg:col-span-8">
<!-- BEGIN: Form Layout -->
<div class="intro-y box p-5">
{{ form_ajax('onUpdateSellerProd') }}
<div>
<label for="crud-form-1" class="form-label">SKU #No</label>
2023-08-26 06:45:56 +00:00
<input id="crud-form-1" type="text" value="SKU" name="sku" class="form-control w-full" placeholder=""
disabled>
2023-08-25 21:39:39 +00:00
</div>
<div class="grid grid-cols-12 gap-2">
<div class="mt-3 col-span-6">
2023-08-26 06:45:56 +00:00
<label for="crud-form-22" class="form-label">{{'product.status.title'|_}} </label>
<select class="tom-select w-full" name="stat">
2023-08-25 21:39:39 +00:00
<option value="1">{{'product.enable'|_}}</option>
2023-08-26 06:45:56 +00:00
<option value="0">{{'product.disable'|_}}</option>
2023-08-25 21:39:39 +00:00
</select>
</div>
2023-08-26 06:45:56 +00:00
<div class="mt-3 col-span-6 product_featured">
2023-08-25 21:39:39 +00:00
<label for="crud-form-2" class="form-label">{{'product.featured.title'|_}} </label>
2023-08-26 06:45:56 +00:00
<select data-placeholder="{{'product.featured.title'|_}}" class="tom-select w-full" name="featured">
2023-08-25 21:39:39 +00:00
<option value="1">{{'product.enable'|_}}</option>
2023-08-26 06:45:56 +00:00
<option value="0">{{'product.disable'|_}}</option>
2023-08-25 21:39:39 +00:00
</select>
</div>
</div>
<div class="grid grid-cols-12 gap-2">
<div class="mt-3 col-span-6">
<label for="crud-form-1" class="form-label">{{'product.name'|_}}</label>
2023-08-26 06:45:56 +00:00
<input type="text" class="form-control w-full" placeholder="{{'product.name'|_}}" name="name">
2023-08-25 21:39:39 +00:00
</div>
<div class="mt-3 col-span-6">
<label for="crud-form-1" class="form-label">{{'product.number'|_}}</label>
<input type="text" class="form-control w-full" placeholder="{{'product.name'|_}}"
name="product_number">
</div>
</div>
<div class="mt-3">
<label>{{'product.short_description'|_}}</label>
<div class="mt-2">
<textarea class="form-control" name="short_description"
style="height: 150px;">{{'product.short_description'|_}}</textarea>
</div>
</div>
<div class="mt-3">
<label>{{'product.description'|_}}</label>
<div class="mt-2">
<textarea class="form-control" name="description"
style="height: 150px;">{{'product.description'|_}}</textarea>
</div>
</div>
<div class="grid grid-cols-12 gap-2">
<div class="mt-3 col-span-6">
<label for="crud-form-3" class="form-label">{{'product.price'|_}}</label>
<div class="input-group">
2023-08-26 06:45:56 +00:00
<input id="crud-form-3" type="number" class="form-control" placeholder="{{'product.price'|_}}"
aria-describedby="input-group-1" name="price">
2023-08-25 21:39:39 +00:00
<div id="input-group-1" class="input-group-text">TMT</div>
</div>
</div>
<div class="mt-3 col-span-6">
<label for="crud-form-3" class="form-label">{{'product.special_price'|_}}</label>
<div class="input-group">
<input id="crud-form-3" type="number" class="form-control"
2023-08-26 06:45:56 +00:00
placeholder="{{'product.special_price'|_}}" aria-describedby="input-group-2"
name="special_price">
2023-08-25 21:39:39 +00:00
<div id="input-group-1" class="input-group-text">TMT</div>
</div>
</div>
</div>
<div>
<label for="crud-form-1" class="form-label">{{'product.qty'|_}}</label>
2023-08-26 06:45:56 +00:00
<input id="crud-form-1" type="number" name="qty" class="form-control w-full"
placeholder="{{'product.qty'|_}}">
2023-08-25 21:39:39 +00:00
</div>
<div class="text-right mt-5">
<a href="{{'detail-order'|page({orderId: order.id})}}" type="button"
class="btn btn-outline-secondary w-24 mr-1">{{'order.form.cancel.btn'|_}}</a>
<button type="submit" class="btn btn-primary w-24">{{'order.form.update.btn'|_}}</button>
</div>
{{ form_close() }}
</div>
<!-- END: Form Layout -->
</div>
2023-08-26 06:45:56 +00:00
<div class="intro-y col-span-12 lg:col-span-4">
<!-- BEGIN: Form Layout -->
<div class="intro-y box p-5" style="margin-bottom: 40px;">
<form data-file-types="image/jpeg|image/png|image/jpg" class="dropzone" data-request="onUploadImg" data-request-files>
<input name="image[]" type="file" multiple class="form-control"/>
<div class="text-right mt-5">
<button data-attach-loading class="btn btn-primary w-24">{{'order.form.update.btn'|_}}</button>
</div>
</form>
</div>
<div class="intro-y box p-5">
{{ form_ajax('onUpdateSellesrProd') }}
<div class="grid grid-cols-12 gap-2">
<div class="mt-3 col-span-12">
<label for="crud-form-22" class="form-label">{{'product.category.title'|_}} </label>
<select class="tom-select w-full" name="stat">
<option value="1">{{'product.enable'|_}}</option>
<option value="0">{{'product.disable'|_}}</option>
</select>
</div>
<div class="text-right mt-5">
<button type="submit" class="btn btn-primary w-24">{{'order.form.update.btn'|_}}</button>
</div>
{{ form_close() }}
</div>
<!-- END: Form Layout -->
</div>
2023-08-25 21:39:39 +00:00
</div>
{% put scripts %}
<script src="{{'assets/seller/js/ckeditor-classic.js'|theme}}"></script>
<script>
getProduct();
// console.log("qqq");
function getProduct() {
$(document).ready(function () {
$.ajax({
url: `https://nurgul.com.tm/app/api/products/{{id}}`,
type: 'GET',
dataType: 'json',
beforeSend: function () {
// $('#deatil_screen').hide();
// $('#loader').show();
},
success: function (data, textStatus, xhr) {
// $('#loader').hide();
// $('#deatil_screen').show();
console.log(data.data);
var product = data.data;
2023-08-26 06:45:56 +00:00
$("select[name='status']").val(product.status);
$("div.product_featured select").val(product.featured);
// $("#product_featured select").val(product.featured).change();
// $('#product_featured option[value='+product.featured+']').attr('selected','selected');
2023-08-25 21:39:39 +00:00
$("input[name='name']").val(product.name);
$("input[name='sku']").val(product.sku);
$("textarea[name='short_description']").val(product.short_description);
$("textarea[name='description']").val(product.description);
$("input[name='name']").val(product.name);
$("input[name='product_number']").val(product.product_number);
$("input[name='price']").val(product.regular_price);
$("input[name='special_price']").val(Number(product.special_price));
$("input[name='qty']").val(product.qty);
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}