<?php $__env->startSection('title', 'Campaing List'); ?>

<?php $__env->startPush('css'); ?>
    <!-- DataTables -->
  <link rel="stylesheet" href="/assets/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="/assets/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
<?php $__env->stopPush(); ?>

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

<!-- Content Header (Page header) -->
<section class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1>Campaing List</h1>
            </div>
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="<?php echo e(routeHelper('dashboard')); ?>">Home</a></li>
                    <li class="breadcrumb-item active">Campaing List</li>
                </ol>
            </div>
        </div>
    </div><!-- /.container-fluid -->
</section>

<!-- Main content -->
<section class="content">

    <div class="card">
        <div class="card-header">
            <div class="row">
                <div class="col-sm-6">
                    <h3 class="card-title">Campaing List</h3>
                </div>
                <div class="col-sm-6 text-right">
                    <a href="<?php echo e(route('admin.campaing.create')); ?>" class="btn btn-success">
                        <i class="fas fa-plus-circle"></i>
                        Add Campaing
                    </a>
                </div>
            </div>
        </div>
        <!-- /.card-header -->
        <div class="card-body">
            <table id="example1" class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th>SL</th>
                        <th>Cover Photo</th>
                        <th>Name</th>
                        <th>total product</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $campaigns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e($key + 1); ?></td>
                            <td>
                                <?php if($data->cover_photo == 'default.png'): ?>
                                    <img src="https://via.placeholder.com/150" alt="Cover Photo" width="60px">
                                <?php else: ?>
                                    <img src="/uploads/campaign/<?php echo e($data->cover_photo); ?>" alt="Cover Photo" width="60px">
                                <?php endif; ?>
                                    
                            </td>
                            <td><?php echo e($data->name); ?></td>
                            <td><?php echo e($data->products->count()); ?></td>
                            <td>
                                <?php if($data->status): ?>
                                    <span class="badge badge-success">Active</span>
                                <?php else: ?>
                                    <span class="badge badge-danger">Disable</span>
                                <?php endif; ?>  
                            </td>
                            <td>
                                <a href="<?php echo e(routeHelper('campaing/edit/'.$data->id)); ?>" class="btn btn-info btn-sm">
                                    <i class="fas fa-edit"></i>
                                </a>
                                <a href="<?php echo e(routeHelper('campaing/comment/'.$data->id)); ?>" class="btn btn-info btn-sm">
                                    <i class="fas fa-comments"></i>
                                </a>
                                <?php if($data->status): ?>
                                <a href="<?php echo e(routeHelper('campaing/status/'.$data->id)); ?>" class="btn btn-warning btn-sm">
                                    <i class="fas fa-thumbs-up"></i>
                                </a>
                                <?php else: ?>
                                <a href="<?php echo e(routeHelper('campaing/status/'.$data->id)); ?>" class="btn btn-warning btn-sm">
                                    <i class="fas fa-thumbs-down"></i>
                                </a>
                                <?php endif; ?>
                                
                                <a href="javascript:void(0)" data-id="<?php echo e($data->id); ?>" id="deleteData" class="btn btn-danger btn-sm"">
                                    <i class="nav-icon fas fa-trash-alt"></i>
                                </a>
                                <form id="delete-data-form-<?php echo e($data->id); ?>" action="<?php echo e(routeHelper('campaing/delete/'. $data->id)); ?>" method="POST">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                </form>

                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    
                </tbody>
            </table>
        </div>
        <!-- /.card-body -->
    </div>
      <!-- /.card -->    

</section>
<!-- /.content -->

<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
    <!-- DataTables  & Plugins -->
    <script src="/assets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="/assets/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
    <script src="/assets/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
    <script src="/assets/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
    <script>
        $(function () { 
            $("#example1").DataTable();
        })
    </script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.admin/e-commerce.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/apleusbj/public_html/resources/views/admin/e-commerce/campaign/index.blade.php ENDPATH**/ ?>