<?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">
            <?php     
            echo error_message();
          echo validation_message();
          ?>
                    <div class="right_side">
                        <h1 class="bg-title">Edit Ratings & Reviews</h1>
                        <div class="review_right">
                            <div class="order_item">
                                <div class="wishlist_body">
                                    <div class="row">
                                        <div class="col-lg-12 col-md-12 col-sm-12">
                                            <div class="row">
                                                <?php 
                                                $query = $this->db->query("SELECT * FROM wps_products_media WHERE products_id =".$proRes[0]['entity_id']."");
                                                $row_founds = $query->num_rows();
                                                if($row_founds > 0) {
                                                $result[] = $query->row_array();
                                                }
                                                $prod_result = get_db_single_row("wps_products", "*", "products_id = '" . $result[0]['products_id'] . "'");
                                                ?>
                                                
                                                <div class="col-lg-2 col-md-2 col-6">
<a href="<?php echo site_url($prod_result['friendly_url']);?>" title="<?php echo $prod_result['product_name']; ?>" target="_blank">
  <img src="<?php echo get_image('products', $result[0]['media'], '110', '67', 'R'); ?>" alt="<?php echo $prod_result['product_name']; ?>" title="<?php echo $prod_result['product_name']; ?>"  class="product-thumb-icon">
                                                    </a>
                                                </div>
                                                <div class="col-lg-10 col-md-10 col-sm-9">
                                                    <div class="wishlist_info">
                                                   <a href="<?php echo site_url($prod_result['friendly_url']);?>"><?php echo $prod_result['product_name'];?></a>
<!--                                                       <p>STYLE # SMR03192060</p>-->
                                                       <div class="pro-price-cart details_price">
                                                            <div class="pro-home-price">
                                                                <span class="product_price"> <?php echo display_price($prod_result['product_price']);?></span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                            </div>
                <?php echo form_open(current_url_query_string(), 'class="form-horizontal"'); ?> 
    <?php if ($this->session->flashdata('success')) echo '
          <div class="alert alert-success success" style="padding: 8px 8px 8px 40px;">' . $this->session->flashdata('success') . '</div>
          <br/>'; ?>
                               <label class="rate_block">Rate This Product</label>
                               <div class="stars">
                    <?php          $rating_opts = $this->config->item('rating_opts');   
                                   $max_star = 5;   
                                   $ads_rating = $proRes[0]['ads_rating'];

                                   $starArray =$this->config->item('starArray');
                                    foreach ($starArray as $key => $value) { ?>
  
                            <input type="radio" name="ads_rating" id="rating<?php echo $key;?>" value="<?php echo $key;?>" <?php if($key == $ads_rating){ echo 'checked="checked"';} ?>>
                            <label for="rating<?php echo $key;?>" class="fa fa-star" title="<?php echo $value;?>"></label>
        
   
   
                                <?php  }  ?>
                              </div>
                            <?php echo form_error('ads_rating');?>

                              <div class="clearfix"></div>

                              <div class="form-group">
                                <label class="input_label">
                                <textarea name="comment" type="text" class="form_input" placeholder="Review This Product" required=""> <?php echo set_value('comment');?><?php echo $proRes[0]['text'];?></textarea>
                            </label>
                                   <?php echo form_error('comment');?>
                            </div>
                            <input class="star star-4" id="star-4" type="hidden" name="products_id" value="<?php echo $prod_result['products_id'];?>">
                            <button class="modal_btn" type="submit" name="submit">Submit</button>
                            <button type="button" name="cancel" id="add_cancel" class="modal_btn cancel">Cancel</button>
                      <?php echo form_close();?>
                    </div>
                </div>
        </div>
    </div>
</div>
<?php $this->load->view("bottom"); ?>