<section id="main-content">
    <section class="wrapper site-min-height">
        <div class="pull-left"><h3><i class="fa fa-angle-right"></i> Gallery</h3></div>
        <div class="pull-right" style="padding-right: 10px;padding-top: 20px;">
            <a href="<?= base_url() ?>admin/slider/changeorder">
                <button type="button" class="btn btn-info btn-xs">Change Order</button>
            </a>
        </div>
        <br><br><hr>
        <div class="col-md-12">
            <form class="form-horizontal style-form" method="POST" action="<?= base_url() ?>admin/slider/simpanData" enctype="multipart/form-data">
                
                <div class="form-group">
                    <div class="col-sm-1">
                        New Slider
                    </div>
                    <div class="col-sm-4">
                        <input type="file" name="userfile" class="form-control">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" name="title" class="form-control" placeholder="Title">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" name="order" class="form-control" placeholder="no order">
                    </div>
                    <div class="col-sm-1">
                        <button type="submit" name="simpan" class="btn btn-primary">Save</button>
                    </div>
                </div>
            </form>
        <hr>
        </div>
        <div class="row mt">
            <?php
            $kolom = 3;
            $i = 0;
            if ($data_slider->num_rows == 0) {
                echo " Data Slider Masih Kosong";
            } else {
                foreach ($data_slider->result() as $slider) {
                    $id = $slider->id;
                    $title = $slider->title;
                    $picture = $slider->picture;
                    if ($i >= $kolom) {
                        echo '</div><div class="row mt">';
                        $i = 0;
                    }
                    $i++;
                    ?>
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 desc">
                        <div class="project-wrapper">
                            <div class="project">
                                <div class="photo-wrapper">
                                    <div class="photo">
                                        <a class="fancybox" href="<?= base_url() ?>assets/slider/<?= $picture ?>">
                                            <img class="img-responsive" src="<?= base_url() ?>assets/slider/<?= $picture ?>" alt="">
                                        </a>
                                    </div>
                                    <div class="overlay"></div>
                                </div>
                            </div>
                            <a href="<?= base_url()?>admin/slider/hapusSlider/<?= $id ?>/<?= $picture ?>">Hapus</a>
                        </div>
                    </div><!-- col-lg-4 -->
                    <?php
                }
            }
            ?>
        </div>

    </section><!--/wrapper -->
</section><!-- /MAIN CONTENT -->