Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vapecompany/demo.vapecompany.com.bd/storage/framework/views/ |
Upload File : |
<?php $__env->startSection('content'); ?> <style type="text/css"> .btn-file { position: initial; overflow: hidden; } .btn-file input[type=file] { position: absolute; top: 0; right: 0; min-width: 100%; min-height: 100%; font-size: 100px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; background: white; cursor: inherit; display: block; } #img-upload{ width: 100%; height: 100% } #img-container{ width: 100px; height: 100px; margin: 10px 0; border: 1px solid; } #checkerr .text-danger{ position: absolute; top: 80px; } #imgerr label{ top: 32px; position: absolute; left: 105px; } </style> <!-- ============================================================== --> <!-- Page wrapper --> <!-- ============================================================== --> <div class="page-wrapper"> <!-- ============================================================== --> <!-- Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <div class="page-breadcrumb"> <div class="row"> <div class="col-5 align-self-center"> <h4 class="page-title">Product Edit</h4> <div class="d-flex align-items-center"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item active" aria-current="page">Product</li> </ol> </nav> </div> </div> </div> </div> <!-- ============================================================== --> <!-- End Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Container fluid --> <!-- ============================================================== --> <div class="container-fluid"> <!-- ============================================================== --> <!-- Start Page Content --> <!-- ============================================================== --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <form id="addProduct" type="POST"> <?php echo csrf_field(); ?> <h4 class="card-title">Edit Product</h4> <?php echo $__env->make('backend.layout.verror_message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <div class="form-group row"> <input type="hidden" name="product_id" value="<?php echo e($product->product_id); ?>"> <label for="product_name" class="col-sm-3 text-right control-label col-form-label">Product Code</label> <div class="col-sm-9"> <input disabled="" name="product_code" type="text" class="form-control" id="product_code" value="<?php echo e($product->product_code); ?>" placeholder="Product Code"> </div> </div> <div class="form-group row"> <label for="brand" class="col-sm-3 text-right control-label col-form-label">Category</label> <div class="col-sm-9"> <select name="category" class="form-control select2 "> <option value="">Select Category</option> <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($category->category_id == $product->category_id): ?> <option selected="selected" value="<?php echo e($category->category_id); ?>"><?php echo e($category->category_name); ?></option> <?php else: ?> <option value="<?php echo e($category->category_id); ?>"><?php echo e($category->category_name); ?></option> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="form-group row"> <label for="product_name" class="col-sm-3 text-right control-label col-form-label">Product Name</label> <div class="col-sm-9"> <input name="product_name" type="text" class="form-control" id="product_name" value="<?php echo e($product->product_name); ?>" placeholder="Product Name"> </div> </div> <div class="form-group row"> <label for="mymce" class="col-sm-3 text-right control-label col-form-label">Short Description</label> <div class="col-sm-9"> <textarea id="mymce" name="specification"><?php echo e($product->short_description); ?></textarea> </div> </div> <div class="form-group row"> <label for="mymce2" class="col-sm-3 text-right control-label col-form-label">Description</label> <div class="col-sm-9"> <textarea id="mymce2" name="specification"><?php echo e($product->description); ?></textarea> </div> </div> <div class="form-group row"> <label class="col-sm-3 text-right control-label col-form-label">Images</label> <div class="col-sm-9"> <div class="input-group"> <span class="input-group-btn"> <span class="btn btn-default btn-file" id="imgerr"> Browse… <input name="product_image" type="file" id="imgInp"> </span> </span> <input type="text" class="form-control" readonly> </div> <div id="img-container"> <input type="hidden" name="oldfile" value="<?php echo e($product->product_image); ?>"> <img id='img-upload' src="<?php echo e(url('public/images/product/').'/'.$product->product_image); ?>" /> </div> </div> </div> <div class="form-group row"> <label for="product_price" class="col-sm-3 text-right control-label col-form-label">Sale Price</label> <div class="col-sm-9"> <input name="sale_price" type="text" class="form-control" value="<?php echo e($product->sale_price); ?>" id="sale_price" placeholder="Sale Price"> </div> </div> <!-- <div class="form-group row"> <label for="product_price" class="col-sm-3 text-right control-label col-form-label">Sale Price</label> <div class="col-sm-9"> <input name="sale_price" type="text" class="form-control" value="<?php echo e($product->sale_price); ?>" id="product_price" placeholder="Model No."> </div> </div> --> <!-- <div class="form-group row"> <label for="product_price" class="col-sm-3 text-right control-label col-form-label">WholeSale Price</label> <div class="col-sm-9"> <input name="wholesale_price" type="text" class="form-control" value="<?php echo e($product->wholesale_price); ?>" id="product_price" placeholder="Model No."> </div> </div> --> <div class="form-group row"> <label for="product_price" class="col-sm-3 text-right control-label col-form-label">Purchase Price</label> <div class="col-sm-9"> <input name="purchase_price" type="text" class="form-control" value="<?php echo e($product->purchase_price); ?>" id="product_price" placeholder="Model No."> </div> </div> <div class="form-group row"> <label for="product_price" class="col-sm-3 text-right control-label col-form-label"></label> <div class="col-sm-9"> <div class="custom-control custom-checkbox" id=""> <input value="1" name="status" <?php if($product->status == 1): ?> checked="" <?php endif; ?> type="checkbox" class="custom-control-input" id="status" > <label class="custom-control-label" for="status">Staus</label> </div> </div> </div> <div class="form-group mb-0 text-right"> <button type="submit" class="btn btn-info waves-effect waves-light">Update</button> <!-- <button type="submit" class="btn btn-dark waves-effect waves-light">Cancel</button> --> </div> </form> </div> </div> </div> </div> <!-- ============================================================== --> <!-- End PAge Content --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Right sidebar --> <!-- ============================================================== --> <!-- .right-sidebar --> <!-- ============================================================== --> <!-- End Right sidebar --> <!-- ============================================================== --> </div> <!-- ============================================================== --> <!-- End Container fluid --> <?php $__env->stopSection(); ?> <?php $__env->startSection('script'); ?> <script src="<?php echo e(url('public/backend/js/jquery.validate.min.js')); ?>"></script> <script src="<?php echo e(url('public/backend/js/tinymce.min.js')); ?>"></script> <script type="text/javascript"> //$('.select2').select2(); $(document).ready( function() { //product validtion form and insert $("#addProduct").validate({ rules: { product_name: { required: true, maxlength: 200, }, // product_image: { // required: true, // }, }, submitHandler: submitForm }); function submitForm() { event.preventDefault(); var data1 = new FormData(document.getElementById('addProduct')); console.log(data1); $.ajax({ type : 'POST', url : "<?php echo e(url('admin/product_edit')); ?>", data : data1, cache:false, contentType: false, processData: false, success : function (data) { console.log(data); if(data.errors=='0'){ $('.alert-success').show(); $('.alert-danger').hide(); $('.alert-success').append('<p>'+data.success+'</p>'); window.location.href = "<?php echo e(url('admin/all_product')); ?>"; //$("#addProduct").get(0).reset(); }else{ var val=""; $.each(data.errors, function(key, value){ $('.alert-danger').show(); $('.alert-success').hide(); val+= '<p>'+value+'</p>'; }); $('.alert-danger').html(val); } },error: function(response) { //console.log(response); } }); return false; } //end validation and insert //image upload $(document).on('change', '.btn-file :file', function() { var input = $(this), label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.trigger('fileselect', [label]); }); $('.btn-file :file').on('fileselect', function(event, label) { var input = $(this).parents('.input-group').find(':text'), log = label; if( input.length ) { input.val(log); } else { if( log ) alert(log); } }); function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#img-upload').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $("#imgInp").change(function(){ readURL(this); }); }); // end image upload //tinymc $(function () { if ($("#mymce").length > 0) { tinymce.init({ selector: "textarea#mymce", theme: "modern", height: 300, setup: function (editor) { editor.on('change', function () { tinymce.triggerSave(); }); }, plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "save table contextmenu directionality emoticons template paste textcolor" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons", }); } if ($("#mymce2").length > 0) { tinymce.init({ selector: "textarea#mymce2", theme: "modern", height: 300, setup: function (editor) { editor.on('change', function () { tinymce.triggerSave(); }); }, plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "save table contextmenu directionality emoticons template paste textcolor" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons", }); } }); //end tinymc </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('backend.layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/vapecompany/Demo.vapecompany.com.bd/resources/views/backend/product/edit.blade.php ENDPATH**/ ?>