<?php if(session()->has('admin_userid')): ?>
   
<?php else: ?> 
 <script>window.location.href="admin";</script>
<?php endif; ?>


<?php $__env->startSection('content'); ?>

    <div class="container-fluid">
        <div class="row bg-title">
            <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                <h4 class="page-title">Manage Parking Providers </h4> </div>
        </div>
            <?php
                $get_provider =DB::table('parking_provider')->get();
                $count = 1;
            ?>
        <div class="col-sm-12">
            <div class="white-box">
                <div style="display: flex; margin-bottom: 2%;">
                    <h3 class="box-title m-b-0">Parking Providers Details</h3>
                    <a href="<?php echo e('add_parking'); ?>" class="btn btn-primary" style="margin-left: 77%; z-index:999;" ><i class="fa fa-plus"></i>&nbsp; Add</a>
                </div>
                <div class="table-responsive">
                    <table id="myTable" class="table table-striped">
                        <thead>
                            <tr>
                                <th>S.No</th>
                                <th>Name</th>
                                <th>Service type</th>
                                <th>Logo</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $get_provider; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $provider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($count); ?></td>
                                <td><?php echo e($provider->provider_name); ?></td>
                                <td><?php echo e($provider->service_type); ?></td>
                                <td><img src="<?php echo e($provider->logo); ?>" alt="logo" width="100px; height:100px;"></td>
                                <td>
                                    <button class="btn"><i class="fa fa-eye"></i></button>
                                    <button class="btn" onclick="window.location.href='edit_parking?providerid=<?php echo e($provider->providerid); ?>'"><i class="fa fa-edit"></i></button>
                                    <button class="btn" onclick="window.location.href='delete_parking&id=<?php echo e($provider->providerid); ?>'"><i class="fa fa-trash-o"></i></button>
                                </td>
                            </tr>
                            <?php
                             $count++   
                            ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
</div>
    <script src="assets/plugins/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="assets/plugins/bower_components/datatables/jquery.dataTables.min.js"></script>
    <!-- start - This is for export functionality only -->
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.print.min.js"></script>

    <link href="assets/plugins/bower_components/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
    <link href="https://cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css" rel="stylesheet" type="text/css" />
    <script>
        $(document).ready(function() {
            $('#myTable').DataTable();
            $(document).ready(function() {
                var table = $('#example').DataTable({
                    "columnDefs": [{
                        "visible": false,
                        "targets": 2
                    }],
                    "order": [
                        [2, 'asc']
                    ],
                    "displayLength": 25,
                    "drawCallback": function(settings) {
                        var api = this.api();
                        var rows = api.rows({
                            page: 'current'
                        }).nodes();
                        var last = null;
    
                        api.column(2, {
                            page: 'current'
                        }).data().each(function(group, i) {
                            if (last !== group) {
                                $(rows).eq(i).before(
                                    '<tr class="group"><td colspan="5">' + group + '</td></tr>'
                                );
    
                                last = group;
                            }
                        });
                    }
                });
    
                // Order by the grouping
                $('#example tbody').on('click', 'tr.group', function() {
                    var currentOrder = table.order()[0];
                    if (currentOrder[0] === 2 && currentOrder[1] === 'asc') {
                        table.order([2, 'desc']).draw();
                    } else {
                        table.order([2, 'asc']).draw();
                    }
                });
            });
        });
        $('#example23').DataTable({
            dom: 'Bfrtip',
            buttons: [
                'copy', 'csv', 'excel', 'pdf', 'print'
            ]
        });
        </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('backend.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\indigo-parking\resources\views/backend/manage-providers.blade.php ENDPATH**/ ?>