
<?php $__env->startSection('content'); ?>
    <!-- begin::main content -->
    <main class="main-content">
        <div class="container">
            <!-- begin::page header -->
            <div class="page-header">
                <h3><?php echo e(__('message.librarycard')); ?></h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?php echo e(asset('dashboard')); ?>"><?php echo e(__('message.dashboard')); ?></a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.list')); ?></li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->
            <?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
            <div class="card">
                <div class="card-header mt-3">
                    <form method="GET" action="<?php echo e(asset('librarycard')); ?>">
                        <div class="row mb-3">
                            <div class="col-md-2">
                                <select class="form-control select2" id="entry" name="entry">
                                    <option value="" disabled selected>25</option>
                                    <option value="50" <?php
                                    if (isset($_GET['entry'])) {
                                        if ($_GET['entry'] == '50') {
                                            echo 'selected';
                                        }
                                    }
                                    ?>>50</option>
                                    <option value="100" <?php
                                    if (isset($_GET['entry'])) {
                                        if ($_GET['entry'] == '100') {
                                            echo 'selected';
                                        }
                                    }
                                    ?>>100</option>
                                    <option value="1000" <?php
                                    if (isset($_GET['entry'])) {
                                        if ($_GET['entry'] == '1000') {
                                            echo 'selected';
                                        }
                                    }
                                    ?>>1000</option>
                                    <option value="5000" <?php
                                    if (isset($_GET['entry'])) {
                                        if ($_GET['entry'] == '5000') {
                                            echo 'selected';
                                        }
                                    }
                                    ?>>5000</option>
                                </select>
                            </div>
                            <div class="col-md-4">
                                <input type="text" id="search" name="search" class="form-control"
                                    value="<?php echo e(Request::has('search') ? Request::get('search') : ''); ?>"
                                    placeholder="Search by Type...">
                            </div>
                            <div class="col-md-6">
                                
                                <button type="submit" class="btn btn-success">
                                    <i class="fa fa-search fa-lg"></i></button>
                                
                                <a href="<?php echo e(asset('librarycard')); ?>" class="btn btn-primary text-white"><i
                                        class="fa fa-recycle fa-lg"></i></a>
                                <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('add-librarycard')){ ?>
                                
                                <a href="<?php echo e(route('librarycard.add')); ?>" class="btn btn-info text-white"> <i
                                        class="fa fa-plus fa-lg"></i>&nbsp; <?php echo e(__('message.add')); ?>

                                    <?php echo e(__('message.librarycard')); ?></a>
                                <?php } ?>
                                <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('delete-librarycard')){ ?>
                                
                                <a id="delete-multiple" href="javascript:;" class="btn btn-danger text-white pull-right"> <i
                                        class="fa fa-trash-o fa-lg"></i></a>
                                <?php } ?>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="card-body">
                    <?php if(isset($libraries)): ?>
                        <div class="table-responsive">
                            <table id="students" class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th>
                                            <input type="checkbox" id="checkAll">
                                        </th>
                                        <th><?php echo e(__('message.si')); ?></th>
                                        <th><?php echo e(__('message.cardtype')); ?></th>
                                        <th><?php echo e(__('message.cardnumber')); ?></th>
                                        <th><?php echo e(__('message.studentname')); ?></th>
                                        <th><?php echo e(__('message.phone')); ?></th>
                                        <th><?php echo e(__('message.email')); ?></th>
                                        <th><?php echo e(__('message.booklimit')); ?></th>
                                        <th>Issue Date</th>
                                        <th>Expire Date</th>
                                        <th><?php echo e(__('message.action')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php if(!empty($libraries)): ?>
                                        <?php $__currentLoopData = $libraries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $libr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td>
                                                    <input class="parentids" type="checkbox" value="<?php echo e($libr->id); ?>"
                                                        name="enquireids[]">
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($key + 1); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($libr->card_type); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($libr->card_number); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($libr->name); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($libr->phone); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($libr->email); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($libr->book_limit); ?></span>
                                                </td>
                                                <td>
                                                    <span
                                                        class="font-size-13"><?php echo e(date('d-m-Y', strtotime($libr->issue_date))); ?></span>
                                                </td>
                                                <td>
                                                    <span
                                                        class="font-size-13"><?php echo e(date('d-m-Y', strtotime($libr->expire_date))); ?></span>
                                                </td>
                                                <td>
                                                    
                                                    <div class="dropdown">
                                                        <button class="btn btn-sm btn-dark dropdown-toggle" type="button"
                                                            data-toggle="dropdown">
                                                            <?php echo e(__('message.action')); ?>

                                                        </button>
                                                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                                                            <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('edit-librarycard')){ ?>
                                                            <a class="dropdown-item"
                                                                href="<?php echo e(route('librarycard.edit', $libr->id)); ?>"><?php echo e(__('message.edit')); ?></a>
                                                            <?php } ?>
                                                            <?php if(Auth::user()->hasRole('superadmin') || Auth::user()->can('delete-librarycard')){ ?>
                                                            <a class="dropdown-item delete-confirm"
                                                                link="<?php echo e(route('librarycard.destroy', $libr->id)); ?>"
                                                                href="javascript:;"><?php echo e(__('message.delete')); ?></a>
                                                            <?php } ?>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                        <h1>No Record Found!!</h1>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                        
                        <div class="pagination-block">
                            <?php echo e($libraries->appends(request()->query())->links('includes.paginationlinks')); ?>

                            <label>Showing total <?php echo $libraries->total(); ?> results</label>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </main>
    <!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
    <script src="<?php echo e(asset('public/admin/vendors/dataTable/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('public/admin/vendors/dataTable/dataTables.bootstrap4.min.js')); ?>"></script>
    <script src="<?php echo e(asset('public/admin/vendors/dataTable/dataTables.responsive.min.js')); ?>"></script>
    <script>
        $(document).on("click", ".change-password", function() {
            $(".modal-body #user_unique_id").val($(this).data('user_unique_id'));
            $('#changepasswordModal').modal('show');
        });
        $("#checkAll").click(function() {
            $('.parentids').not(this).prop('checked', this.checked);
        });
        // Delete Multiple
        $("#delete-multiple").click(function() {
            var URL = "<?php echo e(asset('librarycard/multidelete')); ?>";
            var parent_ids = [];
            $('.parentids:checkbox:checked').each(function() {
                parent_ids.push($(this).val());
            });
            swal({
                title: 'Are you sure?',
                text: 'Once deleted, you will not be recover!',
                icon: 'warning',
                dangerMode: true,
                buttons: ["Cancel", "Yes!"],
            }).then(function(value) {
                if (value) {
                    $.ajaxSetup({
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        }
                    });
                    $.ajax({
                        type: "post",
                        data: {
                            "student_ids": parent_ids
                        },
                        url: URL,
                        dataType: "html",
                        success: function(result) {}
                    });
                    swal("success!", "Successfully deleted!", "success");
                    window.location.reload();
                }
            });
        });
    </script>
    <?php if(!empty(Request::get('type'))): ?>
        <script>
            $("#type").val("<?php echo e(Request::get('type')); ?>").trigger('change');
        </script>
    <?php endif; ?>
    <!-- end::dataTable -->
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\xampp\htdocs\school_saas_erp\resources\views/library_card/list.blade.php ENDPATH**/ ?>