<div class="osahan-breadcrumb">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>"><i class="icofont icofont-ui-home"></i> Home</a></li>
<li class="breadcrumb-item active">Result Category</li>
</ol>
</div>
</div>
</div>
</div> 
<section class="products_page">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="row products_page_list">
<div class="clearfix"></div>
 <?php 
                            if(isset($result_product)){
                                if(count($result_product) > 0){
                                    foreach ($result_product as $cats) {
                                     

                     ?>
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="item">

<div class="h-100">

<div class="product-item">
<span class="badge badge-success offer-badge">Sale</span>
<div class="product-item-image">
<a href="<?php echo base_url('product/').$cats->slug; ?>"><img class="card-img-top img-fluid" src="<?php echo base_url('uploads/resized/').$cats->img; ?>" alt="<?php echo $cats->name; ?>"></a>
</div>
<div class="product-item-body">
<div class="product-item-action">
<a data-toggle="tooltip" data-placement="top" title="" class="btn btn-theme-round btn-sm" href="<?php echo base_url('online_order/').$cats->slug; ?>" data-original-title="Add To Cart"><i class="icofont icofont-shopping-cart"></i></a>
<a data-toggle="tooltip" data-placement="top" title="" class="btn btn-theme-round btn-sm" href="<?php echo base_url('product/').$cats->slug; ?>" data-original-title="View Detail"><i class="icofont icofont-search-alt-2"></i></a>
</div>
<p class="card-title"><a href="<?php echo base_url('product/').$cats->slug; ?>"><?php echo $cats->name; ?></a></p>
<p>
<span class="product-desc-price">Rs : <?php echo $cats->price; ?></span>
<span class="product-price">Rs : <?php echo $cats->sail_price; ?></span>
<span class="product-discount"><?php
                                $actual_price = $cats->price;
                                if($actual_price != 0) {
                                    $sail_price = $cats->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 = $cats->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 activeo' "; }?> ></i>
                                               <?php $i++; }?>

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

</div>

</div>
 <?php } }else{ ?>
                                        <div class="col-md-6">
                                            <h1>No Data Found</h1>
                                            <h2>For More Info VIsit <b><a href="<?php echo base_url(); ?>">shop</a></b></h2>
                                        </div>
                                    <?php } }else{ ?>
                                        <div class="col-md-6">
                                            <h1>No Data Found</h1>
                                            <h2>For More Info VIsit <b><a href="<?php echo base_url(); ?>">shop</a></b></h2>
                                        </div>
                                    <?php } ?>
</div>

</div>
</div>
</div>
</section>