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


    <?php if(count($advert)): ?>

        <div class="row">
            <div class="col-md-12">


                <div class="portlet light bordered">
                    <div class="portlet-title">
                        <div class="caption font-dark">
                        </div>
                        <div class="tools"> </div>
                    </div>
                    <div class="portlet-body">
                        <table class="table table-striped table-bordered table-hover" id="sample_1">

                            <thead>
                            <tr>
                                <th>ID#</th>
                                <th>Date</th>
                                <th>Title</th>
                                <th>Code</th>
                                <th>Limit</th>
                                <th>Action</th>
                            </tr>
                            </thead>

                            <tbody>
                            <?php  $i=0; ?>
                            <?php foreach($advert as $p): ?>
                                <?php  $i++; ?>
                                <tr>
                                    <td><?php echo e($i); ?></td>
                                    <td><?php echo e(date('d-F-Y',strtotime($p->created_at))); ?></td>
                                    <td><?php echo e($p->title); ?></td>
                                    <td><?php echo e($p->code); ?></td>
                                    <td><?php echo e($p->limit); ?></td>
                                    <td width="26%">
                                        <a href="<?php echo e($p->code); ?>" target="_blank" class="btn btn-success btn-sm"><i class="fa fa-eye"></i> View</a>
                                        <button type="button" class="btn btn-primary btn-sm delete_button"
                                                data-toggle="modal" data-target="#DelModal"
                                                data-id="<?php echo e($p->id); ?>">
                                            <i class='fa fa-check'></i> Accept
                                        </button>
                                        <button type="button" class="btn btn-danger btn-sm delete_button1"
                                                data-toggle="modal" data-target="#DelModal1"
                                                data-id="<?php echo e($p->id); ?>">
                                            <i class='fa fa-times'></i> Rejected
                                        </button>
                                    </td>

                                </tr>
                            <?php endforeach; ?>

                            </tbody>
                        </table>
                    </div>
                </div>

            </div>
        </div><!-- ROW-->

    <?php else: ?>

        <div class="text-center">
            <h3>No Data Available</h3>
        </div>
    <?php endif; ?>
    <div class="modal fade" id="DelModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel"> <i class='fa fa-check'></i> Accept !</h4>
                </div>
                <form method="post" action="<?php echo e(route('video-accept')); ?>" class="form-horizontal">
                    <div class="modal-body">
                        <strong>Are you sure you want to Accept ?</strong>
                        <br>
                        <br>
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="col-sm-4 control-label"><b>Per Click : </b></label>

                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <input name="price" value="" class="form-control input-lg" type="text" required placeholder="Per click ">
                                            <span class="input-group-addon"><strong><?php echo e($site_currency); ?></strong></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>

                    <div class="modal-footer">

                        <?php echo csrf_field(); ?>

                        <input type="hidden" name="id" class="abir_id" value="0">

                        <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
                        <button type="submit" class="btn btn-danger"><i class="fa fa-check"></i> Yes. Sure.</button>

                    </div>
                </form>

            </div>
        </div>
    </div>
    <div class="modal fade" id="DelModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel"> <i class='fa fa-times'></i> Reject !</h4>
                </div>

                <div class="modal-body">
                    <strong>Are you sure you want to Reject ?</strong>
                </div>

                <div class="modal-footer">
                    <form method="post" action="<?php echo e(route('video-reject')); ?>" class="form-inline">
                        <?php echo csrf_field(); ?>

                        <input type="hidden" name="id" class="abir_id" value="0">

                        <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
                        <button type="submit" class="btn btn-danger"><i class="fa fa-check"></i> Yes. Sure.</button>
                    </form>
                </div>

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


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

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

    <script>
        $(document).ready(function () {

            $(document).on("click", '.delete_button', function (e) {
                var id = $(this).data('id');
                $(".abir_id").val(id);

            });

        });
    </script>
    <script>
        $(document).ready(function () {

            $(document).on("click", '.delete_button1', function (e) {
                var id = $(this).data('id');
                $(".abir_id").val(id);

            });

        });
    </script>

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

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