<?php
$this->load->view("top");
?>
<section class="my_account_page">
  <div class="container">
    <div class="row">
      <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 col-12">
        <?php $this->load->view('members/left'); ?>
      </div>
      <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-8 col-sm-8 col-12">
            <div class="right_side">
                        <h1 class="bg-title">My Reviews (<?php echo (!empty($reviews))?count($reviews):0; ?>)</h1>
                        <div class="wps_right my_reviews">
                            <!-- Start --->
                              <?php validation_message();
          error_message();
          if (is_array($reviews) && !empty($reviews)) {  
                             $starArray =$this->config->item('starArray');
                        krsort($starArray);
                    foreach ($reviews as $key => $val) {
              $prodets = $this->product_model->get_products('1', '0', array("productid" => $val['entity_id']));
                            ?>
                            <div class="reviews_item">
                                <div class="row">
                                    <div class="col-lg-12 col-md-12 col-sm-12">
                                        <div class="row">
                                            <div class="col-lg-2 col-md-2 col-sm-3">
                            <a href="<?php echo site_url(@$prodets[0]['friendly_url']); ?>" title="<?php echo @$prodets[0]['product_name']; ?>">
                            <img src="<?php echo get_image('products', @$prodets[0]['media'], '220', '220', 'R'); ?>" alt="<?php echo @$prodets[0]['product_name']; ?>" title="<?php echo @$prodets[0]['product_name']; ?>">
                                        </a>
                                            </div>
                                            <div class="col-lg-10 col-md-10 col-sm-9">
                                                <div class="reviews_info">
                                                        <a href="<?php echo site_url(@$prodets[0]['friendly_url']); ?>" title="<?php echo @$prodets[0]['product_name']; ?>"><?php echo @$prodets[0]['product_name']; ?></a>
                                                    <div class="rate_rating">
                                                        <?php
                          $ads_rating = $val['ads_rating'];
                         for ($i=1;$i<6;$i++) {
                          ?>
                                                        <svg class="<?php if($i<=$ads_rating){ echo 'checked';} ?>" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>
                             <?php } ?> 
   <?php echo form_error('ads_rating');?>
                                                    </div>
                                         <p><?php echo $val['text']; ?></p>
                                                    <div class="row">
                                                        <div class="col-lg-12 col-md-12">
                                                            <ul>
                                                                <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z"/></svg><?php echo $mres['first_name'];?></li>
                                                                <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/></svg> Certified Buyer <?php echo date('d M Y H:i A', strtotime($val['review_date'])); ?></li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php } } else {
              ?>
                 <div class="text-center mt10 thank-you">
                <h4 class="mb-70 thankyou-text">Sorry, No Reviews Found!</h4>
              </div>
       <?   } ?>
                        </div>
                    </div>
                </div>
    </div>
  </div>
</section>


<?php $this->load->view("bottom"); ?>