<div class="owl-carousel owl-carousel-slider">
  <?php 
                                            if($slider != 0){
                                            foreach ($slider as $slide) {
                                  ?>
<div class="item">
<a href="<?php echo $slide->slider_slug; ?>"><img class="d-block img-fluid" src="<?php echo base_url('uploads/').$slide->img; ?>" alt="<?php echo $slide->alt; ?>"></a>
</div>
<?php } }else{ ?>
				<?php } ?>
</div>
<section class="categories-list">
<div class="container">
<div class="section-header">
<h1 class="heading-design-h5">
FEATURED ITEMS
</h1>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="single-categorie">
<div class="owl-carousel owl-carousel-featured">
           <?php 
if(isset($get_product)){
    if(!$get_product == 0){
    if(count($get_product) > 0){
        $zo = 0;
                           foreach ($get_product as $product_data) {
                               # code...
                            if($zo == 8){
                                break;
                            }
                      ?> 
<div class="item">
<div class="h-100">
<div class="product-item">
<span class="badge badge-danger offer-badge">HOT</span>
<div class="product-item-image">
<span class="like-icon"><a href="<?php echo base_url('product/').$product_data->slug; ?>"></a></span>
<a href="<?php echo base_url('product/').$product_data->slug; ?>"><img class="card-img-top img-fluid" src="<?php echo base_url('uploads/thumbs/').$product_data->img; ?>" alt="<?php echo $product_data->name; ?>"></a>
</div>
<div class="product-item-body">
<div class="product-item-action">
<a data-toggle="tooltip" data-placement="top" title="Add To Cart" class="btn btn-theme-round btn-sm" href="<?php echo base_url('online_order/').$product_data->slug; ?>"><i class="icofont icofont-shopping-cart"></i></a>
<a data-toggle="tooltip" data-placement="top" title="View Detail" class="btn btn-theme-round btn-sm" href="<?php echo base_url('product/').$product_data->slug; ?>"><i class="icofont icofont-search-alt-2"></i></a>
</div>
<p class="card-title"><a href="<?php echo base_url('product/').$product_data->slug; ?>"><?php echo $product_data->name; ?></a></p>
<p>
<span class="product-desc-price">Rs : <?php echo $product_data->price; ?></span>
<span class="product-price">Rs : <?php echo $product_data->sail_price; ?></span>
<span class="product-discount"><?php
                                $actual_price = $product_data->price;
                                if($actual_price != 0) {
                                    $sail_price = $product_data->sail_price;
                                    $remaing = $actual_price - $sail_price;
                                    $parent = ($remaing * 100) / $actual_price;
                                    $roundamount = round($parent);
                                    echo "- $roundamount%";
                                }
                            ?> Off</span>
</p>
</div>
<div class="product-item-footer">
<div class="stars-rating">
<?php

                                       $total_stars = 0;
                                       $i = 1;
                                       $product_sl = $product_data->slug;
                                       $dt = $this->db->where('product_slug',$product_sl);
                                       $dt = $this->db->where('status', 1);
                                       $dt = $this->db->get('reviews');
                                       if($dt->num_rows() > 0){
                                           $stt = $dt->result();
                                           foreach ($stt as $stars){
                                               $total_stars = $total_stars + $stars->stars;
                                           }
                                           $tnum = count($stt);
                                           $grand = $total_stars/$tnum;
                                           $fil = round($grand);
                                           echo "Review ($tnum)";
                                           while ($i <= 5){
                                               ?>
                                               <i <?php if($i <= $fil){ echo " class='icofont icofont-star active' "; } else{ echo " class='icofont icofont-star active-o' "; }?> ></i>
                                               <?php $i++; }?>

                                           <?php } ?>
</div>
</div>
</div>

</div>
</div>
 <?php  $zo++;  } } } } ?>
</div>

</div>

</div>
</div>
</div>
</section>
 <?php
            $ct = $this->db->where('status', 1);
            $ct = $this->db->get('category');
            if($ct->num_rows() > 0){
                $catdata = $ct->result();
                foreach ($catdata as $catz) {
                    $catslug = $catz->slug;

                    $pd = $this->db->where('cat_slug', $catslug);
                    $pd = $this->db->get('product');
                    if($pd->num_rows() > 0){
                        $prod = $pd->result();
         ?>
<section class="categories-list">
<div class="container">
<div class="section-header">
<h2 class="heading-design-h5">
<?php echo $catz->category_name; ?>
</h2>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="single-categorie">
<div class="owl-carousel owl-carousel-featured">
 <?php 
                          foreach ($prod as $pdata) {
                      ?>
<div class="item">
<div class="h-100">
<div class="product-item">
<span class="badge badge-danger offer-badge">HOT</span>
<div class="product-item-image">
<span class="like-icon"><a href="<?php echo base_url('product/').$pdata->slug; ?>"></a></span>
<a href="<?php echo base_url('product/').$pdata->slug; ?>"><img class="card-img-top img-fluid" src="<?php echo base_url('uploads/thumbs/').$pdata->img; ?>" alt="<?php echo $pdata->name; ?>"></a>
</div>
<div class="product-item-body">
<div class="product-item-action">
<a data-toggle="tooltip" data-placement="top" title="Add To Cart" class="btn btn-theme-round btn-sm" href="<?php echo base_url('online_order/').$pdata->slug; ?>"><i class="icofont icofont-shopping-cart"></i></a>
<a data-toggle="tooltip" data-placement="top" title="View Detail" class="btn btn-theme-round btn-sm" href="<?php echo base_url('product/').$pdata->slug; ?>"><i class="icofont icofont-search-alt-2"></i></a>
</div>
<p class="card-title"><a href="<?php echo base_url('product/').$pdata->slug; ?>"><?php echo $pdata->name; ?></a></p>
<p>
<span class="product-desc-price">Rs : <?php echo $pdata->price; ?></span>
<span class="product-price">Rs : <?php echo $pdata->sail_price; ?></span>
<span class="product-discount"><?php
                                $actual_price = $pdata->price;
                                if($actual_price != 0) {
                                    $sail_price = $pdata->sail_price;
                                    $remaing = $actual_price - $sail_price;
                                    $parent = ($remaing * 100) / $actual_price;
                                    $roundamount = round($parent);
                                    echo "- $roundamount%";
                                }
                            ?> Off</span>
</p>
</div>
<div class="product-item-footer">
<div class="stars-rating">
<?php

                                       $total_stars = 0;
                                       $i = 1;
                                       $product_sl = $pdata->slug;
                                       $dt = $this->db->where('product_slug',$product_sl);
                                       $dt = $this->db->where('status', 1);
                                       $dt = $this->db->get('reviews');
                                       if($dt->num_rows() > 0){
                                           $stt = $dt->result();
                                           foreach ($stt as $stars){
                                               $total_stars = $total_stars + $stars->stars;
                                           }
                                           $tnum = count($stt);
                                           $grand = $total_stars/$tnum;
                                           $fil = round($grand);
                                           echo "Review ($tnum)";
                                           while ($i <= 5){
                                               ?>
                                               <i <?php if($i <= $fil){ echo " class='icofont icofont-star active' "; } else{ echo " class='icofont icofont-star active-o' "; }?> ></i>
                                               <?php $i++; }?>

                                           <?php } ?>
</div>
</div>
</div>

</div>
</div>
 <?php  } ?>
</div>

</div>

</div>
</div>
</div>
</section>
   <?php } } } ?>