

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

    <div id="page-wrapper">
        <div class="container-fluid">
            <div class="row" id="main">
                <!-- Page Heading -->
                <div class="go-title">
                    <div class="pull-right">
                        <a href="<?php echo url('admin/ads/create'); ?>" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> Add New Advertisement</a>
                    </div>
                    <h3>Advertisements</h3>
                    <div class="go-line"></div>
                </div>
                <!-- Page Content -->
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div id="response">
                            <?php if(Session::has('message')): ?>
                                <div class="alert alert-success alert-dismissable">
                                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                                    <?php echo e(Session::get('message')); ?>

                                </div>
                            <?php endif; ?>
                        </div>
                        <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
                            <thead>
                            <tr>
                                <th>Ad Type</th>
                                <th>Banner Image</th>
                                <th>Redirect URL</th>
                                <th>Banner Size</th>
                                <th>Clicks</th>
                                <th>Status</th>
                                <th>Actions</th>
                            </tr>
                            </thead>
                            <tbody>
                        <?php $__currentLoopData = $ads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e(ucfirst($ad->type)); ?></td>
                                <td>
                                    <?php if($ad->banner_file != null): ?>
                                        <img src="../assets/images/ads/<?php echo e($ad->banner_file); ?>" class="manage-ads" alt="ad1.jpg">
                                    <?php else: ?>
                                        No Need
                                    <?php endif; ?>
                                </td>
                                <td><?php echo e($ad->redirect_url); ?></td>
                                <td><?php echo e($ad->banner_size); ?></td>
                                <td><?php echo e($ad->clicks); ?></td>
                                <td><?php echo e($ad->status); ?></td>
                                <td>

                                    <form method="POST" action="<?php echo action('AdvertiseController@destroy',['id' => $ad->id]); ?>">
                                        <?php echo e(csrf_field()); ?>

                                        <input type="hidden" name="_method" value="DELETE">
                                        <a href="<?php echo url('admin/ads'); ?>/<?php echo e($ad->id); ?>/edit" class="btn btn-primary btn-xs"><i class="fa fa-edit"></i> Edit </a>
                                        <?php if($ad->status==1): ?>
                                            <a href="<?php echo url('admin/ads'); ?>/status/<?php echo e($ad->id); ?>/0" class="btn btn-warning btn-xs"><i class="fa fa-times"></i> Deactive </a>
                                        <?php else: ?>
                                            <a href="<?php echo url('admin/ads'); ?>/status/<?php echo e($ad->id); ?>/1" class="btn btn-primary btn-xs"><i class="fa fa-times"></i> Active </a>
                                        <?php endif; ?>
                                        <button type="submit" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> Remove </button>
                                    </form>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
    </div>
    <!-- /#page-wrapper -->

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

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

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.includes.master-admin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>