
<?php echo $__env->make('tanks.modals.new', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('tanks.modals.update', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('tanks.modals.toggle', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


<?php $__env->startSection('script'); ?>
    <script>
        //edit modal
        const edit = document.querySelectorAll('.edit');
        document.querySelectorAll('.edit').forEach(item => {
            item.addEventListener('click', e => {
                const $select = document.querySelector('#typeTank');
                const $option = $select.querySelector('#myId');
                const type = item.dataset.type;
                document.getElementById("id").value = item.dataset.id;
                document.getElementById("capacityTank").value = item.dataset.capacity;
                $select.value = type;
                $('#editModal').modal('show');
            })
        })

        //toggle modal
        const toggle = document.querySelectorAll('.toggle');
        document.querySelectorAll('.toggle').forEach(item => {
            item.addEventListener('click', e => {
                const id = item.dataset.id;
                document.getElementById("id_toggle").value = item.dataset.id;
                $('#toggleModal').modal('show');
            })
        })
    </script>
    <script>
        $(document).ready(function() {
            $('table.display').DataTable();
        });
    </script>
<?php /**PATH C:\Users\Nasser\Desktop\petrol_store\resources\views/tanks/modals.blade.php ENDPATH**/ ?>