Edit File: 5ebd0847a0ef3d016af60267fcc7a1c6e28f208d.php
<?php $__env->startSection('css'); ?> <link rel="stylesheet" type="text/css" href="<?php echo e(asset('admin/app-assets/css-rtl/plugins/forms/validation/form-validation.css')); ?>"> <link rel="stylesheet" type="text/css" href="<?php echo e(asset('admin/app-assets/vendors/css/extensions/sweetalert2.min.css')); ?>"> <link rel="stylesheet" type="text/css" href="<?php echo e(asset('admin/app-assets/vendors/css/pickers/pickadate/pickadate.css')); ?>"> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <!-- // Basic multiple Column Form section start --> <section id="multiple-column-form"> <div class="row match-height"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="card-title"><?php echo e(awtTrans('اضافه كوبون خصم ')); ?></h4> </div> <div class="card-content"> <div class="card-body"> <form method="POST" action="<?php echo e(route('admin.coupons.store')); ?>" class="store form-horizontal" novalidate> <?php echo csrf_field(); ?> <div class="form-body"> <div class="row"> <div class="col-md-6 col-12"> <div class="form-group"> <label for="first-name-column"><?php echo e(awtTrans('رقم الكوبون')); ?></label> <div class="controls"> <input type="text" name="code" class="form-control discount" placeholder="<?php echo e(awtTrans('اكتب رقم الكوبون')); ?>" required data-validation-required-message="<?php echo e(awtTrans('هذا الحقل مطلوب')); ?>" > </div> </div> </div> <div class="col-md-6 col-12"> <div class="form-group"> <label for="first-name-column"><?php echo e(awtTrans('عدد مرات الاستخدام')); ?></label> <div class="controls"> <input type="number" name="num_to_use" class="form-control" placeholder="<?php echo e(awtTrans('اكتب عدد مرات الاستخدام')); ?>" required data-validation-required-message="<?php echo e(awtTrans('هذا الحقل مطلوب')); ?>" > </div> </div> </div> <div class="col-md-6 col-12"> <div class="form-group"> <label for="first-name-column"><?php echo e(awtTrans('نوع الخصم')); ?></label> <div class="controls"> <select name="type" class="select2 form-control" required data-validation-required-message="<?php echo e(awtTrans('هذا الحقل مطلوب')); ?>" > <option value><?php echo e(awtTrans('اختر نوع الخصم')); ?></option> <option value="percentage"><?php echo e(awtTrans('نسبة')); ?></option> <option value="amount"><?php echo e(awtTrans('رقم ثابت')); ?></option> </select> </div> </div> </div> <div class="col-md-6 col-12"> <div class="form-group"> <label for="first-name-column"><?php echo e(awtTrans('الحالة')); ?></label> <div class="controls"> <select name="is_available" class="select2 form-control" required data-validation-required-message="<?php echo e(awtTrans('هذا الحقل مطلوب')); ?>" > <option value><?php echo e(awtTrans('اختر الحالة')); ?></option> <option value="true"><?php echo e(awtTrans('مفعل')); ?></option> <option value="false"><?php echo e(awtTrans('غير مفعل')); ?></option> </select> </div> </div> </div> <div class="col-md-6 col-12"> <div class="form-group"> <label for="first-name-column"><?php echo e(awtTrans('قيمة الخصم')); ?></label> <div class="controls"> <input type="number" name="value" class="form-control" placeholder="<?php echo e(awtTrans('اكتب قيمة الخصم')); ?>" required data-validation-required-message="<?php echo e(awtTrans('هذا الحقل مطلوب')); ?>" > </div> </div> </div> <div class="col-md-6 col-12"> <div class="form-group"> <label for="first-name-column"><?php echo e(awtTrans('تاريخ الانتهاء')); ?></label> <div class="controls"> <input type="date" name="end_at" class=" form-control" required data-validation-required-message="<?php echo e(awtTrans('هذا الحقل مطلوب')); ?>" > </div> </div> </div> <div class="col-12 d-flex justify-content-center mt-3"> <button type="submit" class="btn btn-primary mr-1 mb-1 submit_button"><?php echo e(awtTrans('اضافة')); ?></button> <a href="<?php echo e(url()->previous()); ?>" type="reset" class="btn btn-outline-warning mr-1 mb-1"><?php echo e(awtTrans(' رجوع ')); ?></a> </div> </div> </div> </form> </div> </div> </div> </div> </div> </section> <?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?> <script src="<?php echo e(asset('admin/app-assets/vendors/js/forms/validation/jqBootstrapValidation.js')); ?>"></script> <script src="<?php echo e(asset('admin/app-assets/js/scripts/forms/validation/form-validation.js')); ?>"></script> <script src="<?php echo e(asset('admin/app-assets/vendors/js/extensions/sweetalert2.all.min.js')); ?>"></script> <script src="<?php echo e(asset('admin/app-assets/js/scripts/extensions/sweet-alerts.js')); ?>"></script> <script src="<?php echo e(asset('admin/app-assets/vendors/js/pickers/pickadate/picker.js')); ?>"></script> <script src="<?php echo e(asset('admin/app-assets/vendors/js/pickers/pickadate/picker.date.js')); ?>"></script> <script src="<?php echo e(asset('admin/app-assets/js/scripts/pickers/dateTime/pick-a-datetime.js')); ?>"></script> <script > $(document).on('change' , '.discount' , function () { $(".discount").val( $(".discount").val().replace(/\s/g, '')) }); </script> <?php echo $__env->make('admin.shared.addImage', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <!--<?php echo $__env->make('admin.shared.submitAddForm', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>--> <script> $(document).ready(function() { $(document).on('submit', '.store', function(e) { e.preventDefault(); var url = $(this).attr('action') $.ajax({ url: url, method: 'post', data: new FormData($(this)[0]), dataType: 'json', processData: false, contentType: false, beforeSend: function() { $(".submit_button").html( '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>' ).attr('disable', true) }, success: function(response) { if(response.key == 'fail'){ $(".text-danger").remove() $('.store input').removeClass('border-danger') $(".submit_button").html("<?php echo e(awtTrans('اضافة')); ?>").attr( 'disable', false) Swal.fire({ position: 'top-start', type: 'error', title: response.msg, showConfirmButton: false, timer: 1500, confirmButtonClass: 'btn btn-primary', buttonsStyling: false, }) } else { $(".text-danger").remove() $('.store input').removeClass('border-danger') $(".submit_button").html("<?php echo e(awtTrans('اضافة')); ?>").attr( 'disable', false) Swal.fire({ position: 'top-start', type: 'success', title: '<?php echo e(awtTrans('تمت الاضافة بنجاح')); ?>', showConfirmButton: false, timer: 1500, confirmButtonClass: 'btn btn-primary', buttonsStyling: false, }) setTimeout(function() { window.location.replace(response.url) }, 1000); } }, error: function(xhr) { $(".submit_button").html("<?php echo e(awtTrans('اضافة')); ?>").attr( 'disable', false) $(".text-danger").remove() $('.store input').removeClass('border-danger') $.each(xhr.responseJSON.errors, function(key, value) { $('.store input[name=' + key + ']').addClass( 'border-danger') $('.store input[name=' + key + ']').after( `<span class="mt-5 text-danger">${value}</span>`); $('.store select[name=' + key + ']').after( `<span class="mt-5 text-danger">${value}</span>`); }); }, }); }); }); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('admin.layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/wwineerc/public_html/resources/views/admin/coupons/create.blade.php ENDPATH**/ ?>
Back to File Manager