

<?php $__env->startSection('title'); ?>
    SPORTPESA | SLIDER MANAGER
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page'); ?>
    Slider Manager
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="col">
        <br>
        <?php
        $date = new dateTime();
        $d = $date->format('j F, Y');
        ?>
        <?php if(isset($success)): ?>
            <script>
                alert('<?php echo e($success); ?>');
            </script>
        <?php endif; ?>

            <div class="row">
                    <div class="col-md-6">
                        <form action="<?php echo e(url('/sliderManager')); ?>" method="POST" enctype="multipart/form-data">
                        <div class="col-sm-12">
                            <label>SLIDER IMAGE</label>
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <div class="fileupload-new thumbnail" style="width: 440px; height: 200px;"><img src="<?php echo e(asset('images/sliderDummy.JPG')); ?>" alt="" /></div>
                                <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 160px; max-height: 150px; line-height: 20px;"></div>
                                <div>
                                    <span class="btn btn-sm btn-file btn-default"><span class="fileupload-new">SELECT IMAGE</span><span class="fileupload-exists">Change</span>
                                     <input type="file" name="file" required/></span>
                                    <a href="#" class="btn btn-sm btn-danger fileupload-exists" data-dismiss="fileupload">Remove</a>
                                </div>
                            </div>
                            <div class="form-group col-sm-11">
                                <select name="location" class="form-control" required id="">
                                    <option value="">Choose Location</option>
                                    <option value="1">First Slider</option>
                                    <option value="2">Second Slider</option>
                                </select>
                            </div>

                            <?php echo csrf_field(); ?>

                            <div class="form-group">
                                <button class="btn btn-md btn-success" name="submit" id="">UPLOAD IMAGE</button>
                            </div>
                        </div>
                      </form>

                    </div>

                <div class="col-md-6">
                    <h4>EXISTING IMAGES</h4>
                    <hr>
                    <table class="table table-responsive">
                        <?php
                            $data = App\Slider::get()->sortByDesc('id');
                        ?>
                        <?php if(count($data)>0): ?>
                            <?php foreach($data->all() as $item): ?>
                                <tr id="slider<?php echo e($item->id); ?>">
                                <td><img src="<?php echo e($path2); ?>/slider/<?php echo e($item->path); ?>" alt="" class="img-responsive"></td>
                                <td>
                                    <?php /*<?php if($item->status=='0'): ?>*/ ?>
                                        <?php /*<button class="btn btn-xs btn-warning">Hide This</button>*/ ?>
                                    <?php /*<?php else: ?>*/ ?>
                                        <?php /*<button class="btn btn-xs btn-warning">Unhidden</button>*/ ?>
                                    <?php /*<?php endif; ?>*/ ?>
                                    <button class="btn btn-xs btn-danger trashSlide" data-id="<?php echo e($item->id); ?>">Trash This</button>
                                </td>
                                </tr>
                            <?php endforeach; ?>
                        <?php else: ?>
                            <h3><center>Nothing to Show</center></h3>
                        <?php endif; ?>
                    </table>

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


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

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