

<?php $__env->startSection('content'); ?>
    <div class="header bg-gradient-primary pb-8 pt-5 pt-md-8"></div>
    <div class="container-fluid mt--7">
        <?php if(session()->get('success')): ?>
            <div class="alert alert-success">
                <?php echo e(session()->get('success')); ?>  
            </div>
        <?php endif; ?>

        <?php if(auth()->user()->hasRole('super_admin', 'admin')): ?>
            <div class="row">
                <div class="col">
                    <div class="card shadow">
                        <div class="card-header border-0">
                            <div class="row align-items-center">
                                <div class="col-8">
                                    <h3 class="mb-0">Campaigns</h3>
                                </div>
                                <div class="col-4 text-right">
                                    <a href="<?php echo e(route('campaigns.create')); ?>" class="btn btn-sm btn-primary">Add Campaign</a>
                                </div>
                            </div>
                        </div>
                        <div class="col-12"> </div>
                        <div class="table-responsive">
                            <div class="row w-100">
                                <div class="col-sm-12 col-md-6">
                                    
                                </div>
                                <div class="col-sm-12 col-md-6">
                                    <form action="" role="search">
                                        <div id="datatable-basic_filter" class="dataTables_filter">
                                            <label>Search:<input type="search" name="q" class="form-control form-control-sm" placeholder="Enter name" value="<?php echo e($search); ?>"></label>
                                        </div>
                                    </form>
                                    
                                </div>
                            </div>
                            <table class="table align-items-center table-flush">
                                <thead class="thead-light">
                                    <tr>
                                        <th scope="col">ID</th>
                                        <th scope="col">Name</th>
                                        <th scope="col">Status</th>
                                        <th scope="col">Actions</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $campaigns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $campaign): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($campaign->id); ?></td>
                                            <td><?php echo e($campaign->name); ?></td>
                                            <td> <?php echo e($campaign->enabled); ?></td>
                                            <td class="text-left">
                                                <div class="dropdown">
                                                    <a class="btn btn-sm btn-icon-only text-light" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-ellipsis-v"></i></a>
                                                    <div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
                                                        <a class="dropdown-item" href="<?php echo e(route('campaigns.edit', $campaign->id)); ?>">Edit</a>
                                                        <form action="<?php echo e(route('campaigns.destroy', $campaign->id)); ?>" method="post">
                                                            <?php echo csrf_field(); ?>
                                                            <?php echo method_field('DELETE'); ?>
                                                            <button type="button" class="dropdown-item" onclick="return confirm('Are you sure to delete?')"> Delete</button>
                                                        </form>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?>
        <?php echo $__env->make('layouts.footers.auth', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>

    <script>
        // var slider = document.getElementById("engagement_rate_range");
        // var output = document.getElementById("engagement_rate_range_count");
        // output.innerHTML = slider.value;

        // slider.oninput = function() {
        //     output.innerHTML = this.value;
        // }
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\umesh\xampp\htdocs\projects\instagram-stat\resources\views/campaigns/index.blade.php ENDPATH**/ ?>