<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/video/simpanData" >

                <div class="form-group">
                    <div class="col-sm-1">
                        New Video
                    </div>
                    <div class="col-sm-3">
                        <input type="text" required name="title" class="form-control" placeholder="Title">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" required name="linkvideo" class="form-control" placeholder="Link Video">
                    </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 Video Masih Kosong";
            } else {
                foreach ($data_slider->result() as $slider) {
                    $id = $slider->id;
                    $title = $slider->title;
                    $source = $slider->linkvideo;
                    if ($i >= $kolom) {
                        echo '</div><div class="row mt">';
                        $i = 0;
                    }
                    $i++;
                    ?>

                    <div class="col-sm-4 mb-xs-40">
                        <div class="video">
                            <iframe width="640" height="360" src="<?= $source ?>" allowfullscreen></iframe>
                            <a href="<?= base_url() ?>admin/video/hapus/<?= $id ?>/<?= $title ?>">Hapus</a>
                        </div>
                    </div>


                    <?php
                }
            }
            ?>
        </div>

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