![]() 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/ |
<div class="row"> <div class="col-md-12"> <button id="add-pharmacy" class="btn btn-sm btn-primary my-4"> <i class="fa fa-plus"></i> <?php echo e(trans('Syndicate::attributes.warehouse.add_new_pharmacy')); ?> </button> <div id="pharmacies"> <?php $__currentLoopData = $warehouse->pharmacists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pharmacist): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php echo $__env->make('Syndicate::partials.warehouse_pharmacist_fields', ['pharmacist' => $pharmacist, 'index' => $loop->index], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> </div> </div> <?php $__env->startPush('partial_js'); ?> <script> $(document).on('click', '#add-pharmacy', function (e) { newItem(e, '.pharmacy-section', '<?php echo e(route('get_pharmacy_fields')); ?>', '#pharmacies'); }) $(document).on('click', '.remove-section', function (e) { deleteItem(e, $(this), '.pharmacy-section') }); function newItem(link, className, endpoint, sectionId) { link.preventDefault(); let index = $(className).length; $.get(`${endpoint}?index=${index}`, (viewResult) => { $(sectionId).append(viewResult); }) } function deleteItem(link, element, className) { link.preventDefault(); let endpoint = element.prop('href'); let id = element.closest(className).attr('data-id'); let data = { _method: 'delete', id: id, user_id: "<?php echo e($pharmacist->id??null); ?>" }; const success = () => { element.closest(className).remove(); } const failed = (data) => { themeNotify(data); } assertDeleteProcess(endpoint, data, success, failed); } function assertDeleteProcess(endpoint, data, successAction, failedAction) { themeConfirmation( corals.confirmation.title, corals.confirmation.delete.text, 'warning', corals.confirmation.delete.yes, corals.confirmation.cancel, () => ajaxRequest(endpoint, "DELETE", data, successAction, failedAction) ) } function ajaxRequest(endpoint, method, data, successAction, failedAction) { if (data.id == 'new-item') { successAction(); return; } $.ajax({ url: endpoint, type: method, dataType: 'json', data: data, success: function () { successAction(); }, error: function (data) { failedAction(data); } }); } </script> <?php $__env->stopPush(); ?> <?php /**PATH /home/corals/public_html/syn.corals.io/Corals/modules/Syndicate/resources/views/partials/warehouse_fields.blade.php ENDPATH**/ ?>