<?php $__env->startSection('title'); ?>
    STAKEGAINS | PROMOTIONS
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page'); ?>
    Promotions
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="col" style="min-height: 323px;;">
        <br>
<?php /*        <?php echo e(date('Y-m-d H:i:s', strtotime('29-08-2017 01:46pm'))); ?>*/ ?>
        <a href="<?php echo e(route('/createPromotion')); ?>"><button class="btn btn-md btn-success">CREATE PROMOTION</button></a>

        <hr>
        <div class="row">
            <div class="col-xs-12" id="">
                <table class="table table-striped" id="datatable">
                    <thead>
                    <tr>
                        <th>S/N</th>
                        <th>TITLE</th>
                        <th>PUBLISH ON</th>
                        <th>AUDIENCE</th>
                        <th>PUBLISH STATUS</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php $sn=1; ?>
                    <?php foreach($promotions->all() as $promotion): ?>
                        <tr id="prom<?php echo e($promotion->id); ?>">
                            <td><?php echo e($sn++); ?></td>
                            <td><?php echo $promotion->title; ?></td>
                            <td><?php echo \Carbon\Carbon::parse($promotion->publishOn)->format('j M, Y h:ia'); ?></td>
                            <td><?php echo e($promotion->accessible); ?></td>
                            <td><?php if($promotion->publishStatus==1): ?> Publish <?php else: ?> Draft <?php endif; ?></td>
                            <td>
                                <a href="<?php echo e(route('/viewProm')); ?>" class="viewProm" data-id="<?php echo e($promotion->id); ?>" data-target="#promotionView" data-toggle="modal"><i class="fa fa-eye fa-2x"></i></a> &nbsp;
                                <a href="<?php echo e(route('/editPromotion')); ?>" class="viewProm" data-id="<?php echo e($promotion->id); ?>" data-target="#promotionView" data-toggle="modal"><i class="fa fa-edit fa-2x"></i></a> &nbsp;
                                <a href="<?php echo e(route('/deletePromotion')); ?>" data-id="<?php echo e($promotion->id); ?>" class="deletePromotion"><i class="fa fa-trash fa-2x"></i></a>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>


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

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