<!-- Home Section -->
<div class="home-section fullscreen-container" id="home">
    <div class="fullscreenbanner-s bg-dark">
        <ul>

            <!-- Slide Item -->
            <?php
            foreach ($slider->result() as $sld) {
                ?>
                <li data-transition="fade" data-slotamount="7" data-title="Intro Slide">
                    <img src="<?= base_url() ?>assets/slider_toko/<?= $sld->picture ?>" alt="">            
                </li>
                <?php
            }
            ?>

            <!-- End Slide Item -->

        </ul>
        <div class="tp-bannertimer tp-bottom"></div> 
    </div>
</div>
<!-- End Head Section -->
<br/><br/><br/>
<!-- Section -->
<section class="page-section pt-20">
    <div class="container relative">

        <div class="row">

            <!-- Content -->
            <div class="col-sm-8">

                <div class="row multi-columns-row">

                    <!-- Shop Item -->
                    <?php
                    foreach ($produk as $pdk) {
                        $category_id = $pdk->category_id;
                        if($category_id != 2){
                            //echo $category_id;
                        ?>
                        <div class="col-md-4 col-lg-4 mb-60 mb-xs-40">

                            <div class="post-prev-img">

                                <a href="<?= base_url() ?>detailProduk/produk/<?= $pdk->id ?>/<?php echo url_title($pdk->product_name) ?>.html">
                                    <img src="<?= base_url() ?>assets/product_image/<?= $pdk->product_image ?>" alt="" /></a>

                                <?php
                                $diskon = $pdk->discount;
                                if ($diskon != 0) {
                                    ?>
                                    <div class="intro-label">
                                        <span class="label label-danger bg-red">Diskon <?= $diskon ?>%</span>
                                    </div>
                                    <?php
                                }
                                ?>

                            </div>

                            <div class="post-prev-title font-alt align-center">
                                <a href="<?= base_url() ?>detailProduk/produk/<?= $pdk->id ?>/<?php echo url_title($pdk->product_name) ?>.html">
                                    <?= $pdk->product_name ?></a>
                            </div>

                            <div class="post-prev-text align-center">
                                <?php
                                $diskon = $pdk->discount;
                                $old_price = $pdk->price;
                                if ($diskon > 0) {
                                    $new_price = $old_price - ($diskon / 100 * $old_price);
                                    ?>
                                    <del>Rp. <?= number_format($old_price) ?></del>
                                    &nbsp;
                                    <strong>Rp. <?= number_format($new_price) ?></strong>
                                    <?php
                                } else {
                                    ?>
                                    <strong>Rp. <?= number_format($old_price) ?></strong>
                                    <?php
                                }
                                ?>
                            </div>

                            <div class="post-prev-more align-center">
                                <a href="<?= base_url() ?>detailProduk/produk/<?= $pdk->id ?>/<?php echo url_title($pdk->product_name) ?>.html" class="btn btn-mod btn-gray btn-round">
                                    <i class="fa fa-shopping-cart"></i> Detail
                                </a>
                            </div>

                        </div>
                        <!-- End Shop Item -->
                        <?php
                        }
                    }
                    ?>
                </div>


            </div>
            <!-- End Content -->

            <!-- Sidebar -->
            <div class="col-sm-4 col-md-3 col-md-offset-1 sidebar">


                <!-- Widget -->
                <div class="widget">

                    <h5 class="widget-title font-alt">Cari Produk :</h5>

                    <div class="widget-body">
                        <div class="widget-body">
                            <form action="<?= base_url() ?>toko/cari_produk" method="post">
                                <input autofocus type="text" class="form-control" name="keyword">
                            </form>

                            <div class="clearfix mt-20">
                                <small>Tekan Enter untuk melakukan pencarian</small>
                            </div>

                            <div>

                            </div>

                        </div>

                    </div>

                </div>
                <!-- End Widget -->

                <!-- Widget -->
                <div class="widget">

                    <h5 class="widget-title font-alt">Cart</h5>

                    <div class="widget-body">
                        <div class="widget-body">
                            <?php
                            $total = 0;
                            $jmlcart = $this->cart->total_items();
                            if ($jmlcart > 0) {
                                ?>
                                <ul class="clearlist widget-posts">

                                    <!-- Preview item -->
                                    <?php
                                    $total = 0;
                                    foreach ($this->cart->contents() as $items) {
                                        ?>  
                                        <li class="clearfix">
                                            <a href=""><img src="<?= base_url() ?>assets/product_image/<?= $items['foto'] ?>" alt="" class="widget-posts-img" width="20%"/></a>
                                            <div class="widget-posts-descr">
                                                <a href="#" title=""><?= $items['name'] ?></a>
                                                <div>
                                                    <?= $items['qty'] ?> x Rp. <?= number_format($items['total']) ?>
                                                </div>
                                                <div>
                                                    <a href="<?= base_url() ?>toko/deleteProduct/<?= $items['rowid'] ?>"><i class="fa fa-times"></i> Remove</a>
                                                </div>
                                            </div>
                                        </li>
                                        <!-- End Preview item -->

                                        <?php
                                        $total += $items['total'];
                                    }
                                    ?>

                                </ul>
                                <?php
                            }
                            ?>
                            <div class="clearfix mt-20">

                                <div class="left mt-10">
                                    Subtotal: <strong>Rp. <?= number_format($total) ?></strong>
                                </div>

                                <div class="right">
                                    <a href="<?= base_url() ?>toko/cart" class="btn btn-mod btn-border btn-small btn-round">View Cart</a>
                                </div>

                            </div>

                            <div>

                            </div>

                        </div>

                    </div>

                </div>
                <!-- End Widget -->

                <!-- Widget -->
                <div class="widget">

                    <h5 class="widget-title font-alt">Shop Categories</h5>

                    <div class="widget-body">
                        <ul class="clearlist widget-menu">
                            <li>
                                <a href="<?= base_url() ?>toko/kategori/Tinta.html?id=1" title="">Tinta</a>
                            </li>
                           <!-- <li>
                                <a href="<?= base_url() ?>toko/kategori/Toner.html?id=2" title="">Toner</a>

                            </li> 
                            -->
                            <li>
                                <a href="<?= base_url() ?>toko/kategori/Compatible.html?id=3" title="">Cartridge Toner</a>

                            </li>
                            <li>
                                <a href="<?= base_url() ?>toko/kategori/Ciss.html?id=4" title="">Ciss</a>

                            </li>
                            <li>
                                <a href="<?= base_url() ?>toko/kategori/Photo-paper.html?id=5" title="">Photo Paper</a>
                            </li>
                        </ul>
                    </div>

                </div>
                <!-- End Widget -->

                <!-- Widget -->
                <div class="widget">

                    <h5 class="widget-title font-alt">Bestsellers</h5>

                    <div class="widget-body">
                        <ul class="clearlist widget-posts">
                            <ul class="clearlist widget-posts">

                                <!-- Preview item -->
                                <?php
                                foreach ($feature as $fre) {
                                    ?>
                                    <li class="clearfix">
                                        <a href=""><img src="<?= base_url() ?>assets/product_image/<?= $fre->product_image ?>" width="20%" alt="" class="widget-posts-img" /></a>
                                        <div class="widget-posts-descr">
                                            <a href="#" title=""><?= $fre->product_name ?></a>
                                            <div>

                                            </div>
                                            <div>
                                                <a href="#" class="btn btn-mod btn-gray btn-round"><i class="fa fa-shopping-cart"></i> Add to cart</a> 
                                            </div>
                                        </div>
                                    </li>
                                    <!-- End Preview item -->
                                    <?php
                                }
                                ?>

                            </ul>

                        </ul>
                    </div>

                </div>
                <!-- End Widget -->

                <div class="widget">

                    <h5 class="widget-title font-alt">
                        <a href="<?= base_url() ?>cara_belanja.html">
                            <i class="fa fa-chevron-circle-right"></i> cara belanja
                        </a>
                    </h5>

                </div>
                <div class="widget">
                    <h5 class="widget-title font-alt">
                        <i class="fa fa-chevron-circle-right"></i> Dapatkan Juga di :
                    </h5>
                    <a href="https://www.bukalapak.com/amazinkstore">
                        <img class="img-responsive" src="<?= base_url() ?>assets/images/logo-bukalapak.png">
                    </a>
                    <hr style="margin-top: 10px; margin-bottom: 10px;"/>
                    
                    <a href="https://www.tokopedia.com/amazink">
                        <img class="img-responsive" src="<?= base_url() ?>assets/images/LOGO-TOKOPEDIA.png">
                    </a>

                </div>


            </div>
            <!-- End Sidebar -->
        </div>

    </div>
</section>
<!-- End Section -->
