<?php $__env->startSection('middle'); ?>
<script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>
<section class="content">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Edit Product</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" action="<?php echo e(url('update_product')); ?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<input type="hidden" name="product_id" value="<?php echo e($products[0]->product_id); ?>">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Name</label>
<input type="text" name="name" value="<?php echo e($products[0]->name); ?>" class="form-control" placeholder="Enter Product Name Here" required="" >
</div>
<div class="form-group">
<label for="exampleInputEmail1">Category</label>
<select class="form-control" name="category_id" required="required">
<option value="">select Category</option>
<?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($products[0]->category_id==$category->id): ?>
<option value="<?php echo e($category->id); ?>" selected><?php echo e($category->name); ?></option>
<?php else: ?>
<option value="<?php echo e($category->id); ?>"><?php echo e($category->name); ?></option>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<div>
<label for="exampleInputEmail1">Images</label>
</div>
<?php $__currentLoopData = $product_images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-3 pic_div" style="border: 1px solid black">
<img style="height: 150px; width: 150px" src="<?php echo e(url('public/uploads/products')); ?>/<?php echo e($image->image_name); ?>">
<div align="center" style="margin-top: 3px" > <button value="<?php echo e($image->product_image_id); ?>" class="khan3 btn btn-danger "><i class="glyphicon glyphicon-trash"></i></button></div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<input class="form-control" type="file" id="images" name="image[]" multiple />
</div>
<div class="form-group">
<label for="exampleInputPassword1" >Description</label>
<textarea style="height: 550px" class="form-control" name="editor1"><?php echo $products[0]->description;?></textarea>
</div>
<div style="margin-left: 50%;"><h3>Rates</h3></div>
<div class="sessions col-md-12" >
<table class="table table-bordered">
<thead style="background-color: #4ab752;">
<tr class="tr_clone">
<th style="width: 15%;">Quantity</th>
<th style="width: 13%;">Unit</th>
<th style="width: 13%;">(£)Amount</th>
<!-- <th style="width: 7%;">Add Participant</th>-->
<!-- <th style="width: 7%;">Participant Detail</th>-->
<th style="width: 7%;">Action</th>
</tr>
</thead>
<tbody id="session_body">
<?php $__currentLoopData = $product_rates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><input type="number" name="quantity[]" value="<?php echo e($rate->quantity); ?>" placeholder="Enter Quantity Here" class="form-control" required="" step="any"></td>
<td><input type="text" name="unit[]" value="<?php echo e($rate->unit); ?>" placeholder="Enter Unit Here" class="form-control" required=""></td>
<td><input type="text" name="amount[]" value="<?php echo e($rate->amount); ?>" placeholder="Enter Amount Here" class="form-control" required=""></td>
<td><button class="btn btn-info btn-circle puradd1" type="button"><i class="fa fa-plus-square"></i></button>
<button class="btn btn-warning btn-circle removepur1" type="button"><i class="fa fa-times"></i></button>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('body').on('click','.puradd1',function(){
var row = $(this).closest("tr");
var newRow = $('<tr>' +
'<td><input type="number" name="quantity[]" placeholder="Enter Quantity Here" class="form-control" required="" step="any"></td>'+
'<td><input type="text" name="unit[]" placeholder="Enter Unit Here" class="form-control" required=""></td>'+
'<td><input type="text" name="amount[]" placeholder="Enter Amount Here" class="form-control" required=""></td>'+
'<td> ' +
'<button class="btn btn-info btn-circle puradd1" type="button"><i class="fa fa-plus-square"></i></button>' +
' <button class="btn btn-warning btn-circle removepur1" type="button"><i class="fa fa-times"></i></button>' +
'</td>' +
'</tr>');
row.after(newRow);
});
$('body').on('click','.removepur1',function(){
$(this).closest('tr').remove();
$('.puradd1').show();
});
});
</script>
<script type="text/javascript">
CKEDITOR.replace('editor1', {
filebrowserUploadUrl: "<?php echo e(route('ckeditor.upload', ['_token' => csrf_token() ])); ?>",
filebrowserUploadMethod: 'form'
});
</script>
<script>
$(document).ready(function(){
$('.khan3').on('click',function(e){
e.preventDefault();
if (confirm("Are you sure?"))
{
var fired_button = $(this).val();
$(this).closest("div.pic_div").hide();
$.get("<?php echo e(url('delete_product_image')); ?>"+'/'+fired_button,function(response){
});
}
})
});
</script>
<?php $__env->stopSection(); ?>
</body>
</html>
<?php echo $__env->make('admin.head', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]