<?php $__env->startSection('title'); ?>
    BETLOADED | ADVERTISEMENTS
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page'); ?>
    Manage Ads
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="col" style="min-height: 323px;;">
        <br><br>
        <?php
        $date = new dateTime();
        $d = $date->format('j F, Y');
        ?>
        <?php if(isset($success)): ?>
            <script>
                alert('<?php echo e($success); ?>');
            </script>
        <?php endif; ?>
        <table id="datatable" class="table table-striped table-bordered nowrap" cellspacing="0" width="100%">
            <thead>
            <tr>
                <th>REL</th>
                <th>POSITION</th>
                <th>SHOW ON</th>
                <th>LINK URL</th>
                <th>DESCRIPTION</th>

                <th>Controls</th>
            </tr>
            </thead>
            <tbody>
            <?php foreach($ads->all() as $ad): ?>
                <tr id="d<?php echo e($ad->id); ?>">
                    <td class="red"><?php echo e($ad->id); ?></td>
                    <td><?php echo e($ad->position); ?></td>
                    <td><?php echo e($ad->page); ?></td>
                    <td><?php echo e($ad->website); ?></td>
                    <td><?php echo $ad->description; ?></td>

                    <td>
                        <div class="btn-group">
                            <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
                                Actions
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu pull-right" role="menu" style="background: whitesmoke; -webkit-box-shadow: inset 0px 0px 10px grey;-moz-box-shadow: inset 0px 0px 10px grey;box-shadow: inset 0px 0px 10px grey;">
                                <?php /*<li style="cursor: pointer;"><a class="updateads" href="<?php echo e($ad->id); ?>" data-target="#updateads" data-toggle="modal">EDIT/UPDATE</a>*/ ?>


                                <?php if($ad->status=='0'): ?>
                                    <li style="cursor: pointer;"><a class="hidead" href="<?php echo e($ad->id); ?>" id="h<?php echo e($ad->id); ?>">HIDE THIS</a>
                                <?php else: ?>
                                    <li style="cursor: pointer;"><a class="unhidead" href="<?php echo e($ad->id); ?>" id="h<?php echo e($ad->id); ?>"><span style="color: green;">SHOW THIS</span></a>
                                <?php endif; ?>

                                <li style="cursor: pointer;"><a class="adsdelete" href="<?php echo e(route('/adDelete')); ?>" data-id="<?php echo e($ad->id); ?>">DELETE</a>
                                </li>
                            </ul>
                        </div>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>

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

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