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


<div class="container-fluid">
  <div class="fade-in">
    <div class="row">
      <div class="col-sm-12">
        <div class="card">
          <div class="card-header"><h4>Videos</h4></div>
            <div class="card-body">
                <div class="row">
                    <a class="btn btn-lg btn-primary ml-3" href="<?php echo e(route('videos.create')); ?>">Add New Video</a>
                </div>
                <br>
                <table class="table table-hover datatable">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Title</th>
                            <th>Status</th>
                            <th></th>
                            <th></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $videos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $video): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($loop->iteration); ?></td>
                                <td>
                                    <?php echo e($video->title); ?>

                                </td>
                                <td>
                                    <?php echo e($video->status? 'Active':'--'); ?>

                                </td>
                                <td>
                                    <a class="btn btn-info" href="<?php echo e(request()->getSchemeAndHttpHost().'/'.$video->path); ?>" target="_blank" rel="noopener noreferrer">
                                    View
                                    </a>
                                </td>
                                <td>
                                <form action="<?php echo e(route('videos.destroy', $video->id )); ?>" method="POST">
                                    <?php echo method_field('DELETE'); ?>
                                    <?php echo csrf_field(); ?>
                                    <button class="btn btn-danger delete-bt">Delete</button>
                                </form>
                                </td>
                                <td>
                                    <?php if(!$video->status): ?>
                                    <a href="<?php echo e(route('activate_video', $video->id )); ?>" class="btn btn-primary">Activate</a>
                                    <?php else: ?>
                                    <a class="btn btn-light disabled">Activate</a>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>

            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

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

<?php $__env->startSection('javascript'); ?>
    <script>
        $(document).ready( function () {
            $('.datatable').DataTable({
                "order" : [[0, "desc"]]
            });
        } );
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\pec_portal\resources\views/dashboard/videos/index.blade.php ENDPATH**/ ?>