![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/syn.corals.io/storage/framework/views/ |
<style type="text/css"> .select-section button { padding: 6px 12px !important; } .select-section .form-group { margin-bottom: 0; } </style> <div class="select-section <?php echo e($class = \Str::random().'_setting'); ?>"> <table width="100%" class="table table-striped table-responsive values-table"> <thead> <tr> <th width="50%"><?php echo e(trans($label['key'])); ?></th> <th width="50%"><?php echo e(trans($label['value'])); ?></th> <th></th> </tr> </thead> <tbody> <?php $key = $key??'key'; $value = $value??'value'; ?> <?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option_key => $option_value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if(is_array($option_value)){ $option_key = $option_value[$key]; $option_value = $option_value[$value]; } ?> <tr id="tr_<?php echo e($loop->index); ?>" data-index="<?php echo e($loop->index); ?>"> <td> <div class="form-group"> <input name="<?php echo e($name."[$loop->index][{$key}]"); ?>" type="text" value="<?php echo e($option_key); ?>" class="form-control"/> </div> </td> <td> <div class="form-group"> <input name="<?php echo e($name."[$loop->index][{$value}]"); ?>" type="text" value="<?php echo e($option_value); ?>" class="form-control"/> </div> </td> <td> <button type="button" class="btn btn-danger btn-sm remove-value" style="margin:0;" data-index="<?php echo e($loop->index); ?>"><i class="fa fa-remove"></i> </button> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> <button type="button" class="btn btn-success btn-sm add-value"> <i class="fa fa-plus"></i> </button> <span class="help-block"><?php echo app('translator')->get('Corals::labels.add_new_pairs'); ?></span> </div> <script type="text/javascript"> <?php echo e(\Str::slug($name,'_')); ?>_init = function () { if ($(".<?php echo e($class); ?> .values-table").length > 0) { $(document).on('click', '.<?php echo e($class); ?> .add-value', function () { var index = $('.<?php echo e($class); ?> .values-table tr:last').data('index'); if (isNaN(index)) { index = 0; } else { index++; } $('.<?php echo e($class); ?> .values-table tr:last').after('<tr id="tr_' + index + '" data-index="' + index + '"><td><div class="form-group">' + '<input name="<?php echo e($name); ?>[' + index + '][<?php echo e($key); ?>]" type="text"' + 'value="" class="form-control"/></div></td><td><div class="form-group">' + '<input name="<?php echo e($name); ?>[' + index + '][<?php echo e($value); ?>]" type="text"' + 'value="" class="form-control"/></div></td>' + '<td><div class="form-group"><button type="button" class="btn btn-danger btn-sm remove-value" style="margin:0;" data-index="' + index + '">' + '<i class="fa fa-remove"></i></button></div></td>' + '</tr>'); }); $(document).on('click', '.<?php echo e($class); ?> .remove-value', function () { let index = $(this).data('index'); $(".<?php echo e($class); ?> #tr_" + index).remove(); }); } }; window.initFunctions.push('<?php echo e(\Str::slug($name,'_')); ?>_init'); </script> <?php /**PATH /home/corals/public_html/syn.corals.io/Corals/core/Foundation/resources/views/key_value.blade.php ENDPATH**/ ?>