<?php
foreach ($data_sub_menu->result() as $dbs) {
    $id_sub = $dbs->id_sub_menu;
    $title = $dbs->title;
    $banner = $dbs->picture;
}
?>
<section id="main-content">
    <section class="wrapper site-min-height">
        <div class="pull-left"><h3><i class="fa fa-angle-right"></i> Banner <?= $title?></h3></div>

        <br><br><hr>
        <div class="col-md-12">
            <form class="form-horizontal style-form" method="POST" action="<?= base_url() ?>admin/sub_menu/simpanBanner" enctype="multipart/form-data">

                <div class="form-group">
                    <input type="hidden" name="id" value="<?= $id_sub ?>">
                    <div class="col-sm-1">
                        Banner
                    </div>
                    <div class="col-sm-4">
                        <input type="file" name="userfile" class="form-control">
                    </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
            if ($banner == "" || $banner == NULL) {
                echo "Belum Ada Banner";
            } else {
                ?>
                <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/menu/<?= $banner ?>">
                                        <img class="img-responsive" src="<?= base_url() ?>assets/menu/<?= $banner ?>" alt="">
                                    </a>
                                </div>
                                <div class="overlay"></div>
                            </div>
                        </div>
                    </div>
                </div><!-- col-lg-4 -->
                <?php
            }
            ?>
        </div>

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