Edit File: 0f052ef61ab69d08bef4f69adc6872e5fbd7a882.php
<?php $__env->startSection('css'); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <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('اضافه مجموعات من السمات للمنتج رقم ') . $product->id); ?></h4> </div> <div class="card-content"> <div class="card-body"> <div class="row align-items-center"> <div class="col-12"> <?php $__currentLoopData = $product->productfeatures; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pf): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="form-group"> <label for="first-name-column"><?php echo e($pf->feature->name); ?></label> <select class="form-control select_feature" name="productfeatures_ids[]"> <?php $__currentLoopData = $pf->productfeatureproperities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pfp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($pfp->properity->id); ?>"><?php echo e($pfp->properity->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <div class="col-12"> <div class="option-btn d-flex justify-content-center "> <button type="button" class="btn btn-primary mt-2 mb-2 add_groub"><?php echo e(awtTrans('انشاء مجموعة')); ?></button> </div> </div> </div> <div class="row align-items-center append_div"> <?php $__currentLoopData = $product->groups->where('properities' , '!=' , null); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <form action="<?php echo e(route('admin.stores.products.groups.update')); ?>" style="width: 100%" class="d-flex mt-1 d-flex align-center groub_form"> <?php echo csrf_field(); ?> <input type="hidden" name="group_id" value="<?php echo e($group->id); ?>"> <input type="hidden" name="product_id" value="<?php echo e($product->id); ?>"> <input id="<?php echo e($group->properities); ?>" type="hidden" name="ids" class="main_div" value="<?php echo e($group->properities); ?>"> <div style="background: #7367f0 ; width: 45% ; border-radius: 5px; padding:10px ; margin-top: 8px " class="d-flex justify-content-around"> <?php $__currentLoopData = $group->properities_data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $prop): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <h6 class="m-0"><?php echo e($prop->name); ?></h6> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <div style="width: 45% " class="d-flex justify-content-around"> <div class="form-group"> <label > <?php echo e(awtTrans('السعر')); ?> </label> <input type="number" class="form-control" name="price" value="<?php echo e($group->price); ?>" > </div> </div> <div style="width: 10%" class="d-flex justify-content-around"> <a href="#" class="position-absolute" style="left: 2%" > <i class="fa fa-trash text-danger delete_group" data-id="<?php echo e($group->id); ?>" style="font-size: 25px" aria-hidden="true"></i> </a> <a href="#" type="submit" class="submit_form position-absolute" style="left: 5%" > <i class="fa fa-edit" style="font-size: 25px" aria-hidden="true"></i> </a> </div> </form> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <div class="col-12"> <div class="option-btn d-flex justify-content-center "> <a style="color: white" href="<?php echo e(route('admin.stores.products', ['id'=>$product->store_id])); ?>" type="button" class=" btn btn-primary mt-2 mb-2 "><?php echo e(awtTrans('انهاء المنتج')); ?></a> </div> </div> </div> </div> </div> </div> </div> </section> <?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?> <script> $(document).on('click', '.add_groub', function () { var array = [] ; var names = [] ; var prop = '' ; var count = 0 ; $('.select_feature').each(function(i, obj) { array.push($(this).val()) names.push($(this).find(":selected").text()) }); $('.main_div').each(function(i, obj) { var array2 = JSON.parse(this.id) if(array.sort().join(',') === array2.sort().join(',')){ count = count + 1 } }); $(names).each(function(i, obj) { prop += `<h6 class="m-0">${obj}</h6>` ; }); if (count == 0) { $('.append_div').prepend(` <form action="<?php echo e(route('admin.stores.products.groups.update')); ?>" style="width: 100%" class="d-flex mt-1 d-flex align-center groub_form"> <?php echo csrf_field(); ?> <input type="hidden" name="group_id" value="" class="group_id"> <input type="hidden" name="product_id" value="<?php echo e($product->id); ?>"> <input id="[${array}]" type="hidden" name="ids" class="main_div" value="[${array}]"> <div style="background: #7367f0 ; width: 45% ; border-radius: 5px; padding:10px ; margin-top: 8px " class="d-flex justify-content-around"> ${prop} </div> <div style="width: 45% " class="d-flex justify-content-around"> <div class="form-group"> <label > <?php echo e(awtTrans('السعر')); ?> </label> <input type="number" class="form-control" name="price" value="<?php echo e($product->groupOne()->price); ?>" > </div> </div> <div style="width: 10%" class="d-flex justify-content-around"> <a href="#" class="position-absolute" style="left: 2%" > <i class="fa fa-trash text-danger delete_group" style="font-size: 25px" aria-hidden="true"></i> </a> <a href="#" class="position-absolute submit_form" style="left: 5%" > <i class="fa fa-check" style="font-size: 25px" aria-hidden="true"></i> </a> </div> </form> `) }else{ toastr.error('<?php echo e(awtTrans("تم اضافة المجموعة سابقا")); ?>') } }); </script> <script> $(document).ready(function() { $(document).on('submit', '.groub_form', 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, success: (response) => { toastr.success('<?php echo e(awtTrans("تم العملية بنجاح ")); ?>') $(this).find('.submit_form') . html(`<i class="fa fa-edit" style="font-size: 25px" aria-hidden="true"></i>`); $(this).find('.group_id') . val(response.group.id); } }); }); }); $(document).on('click' , '.submit_form', function (e) { e.preventDefault(); $(this).parents('.groub_form').submit() }) $(document).on('click' , '.delete_group', function (e) { e.preventDefault(); var id = $(this).data('id') if (id) { $.ajax({ url: '<?php echo e(url("admin/stores/products/group-delete")); ?>', method: 'post', data: {id : id}, dataType: 'json', success: (response) => { toastr.success('<?php echo e(awtTrans("تم حذف المجموعة بنجاح")); ?>') $(this).parents('.groub_form').remove() } }); }else{ $(this).parents('.groub_form').remove() } }); </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/products/groups.blade.php ENDPATH**/ ?>
Back to File Manager