<?php $this->load->view("top"); ?>
<div class="page-title">
    <h2><span><?php //echo $heading_title; ?></span></h2>
    <div class="buttons">
        <!-- <a href="javascript:void(0);" onclick="history.back();" class="btn btn-primary pull-right">Cancel</a>  --> 
     </div>
</div>


<div style="clear:both;"></div>
<!-- <div style="background-Color:#F8EA4A;margin:5px;padding:5px;">
    <h3><span>Product Name: </span><?php //echo $pres['product_name'];?></h3>
  </div> -->
<?php @session_start();
 //$this->session->flashdata('message'); ?>
  <section class="my_account_page">
<div class="container">
<ul class="account_breadcrumb">
<li><a href="index.php" title="Home">Home</a></li>
<li><a href="my-account.php" title="My Account">My Account</a></li>
<li><a href="my-order.php" title="My Orders">My Orders</a></li>
<li class="active">Ratings &amp; Reviews</li>
</ul>
<div class="row">
<div class="col-md-9 col-md-push-3">
<div class="right_side">
<h1>Edit Ratings &amp; Reviews</h1>
<?php     echo error_message();
          echo validation_message();
         /// $this->session->flashdata('success');
        //   if(isset($proRes['success_message'])){
           //echo "heloo";print_r($proRes);
        // }
          ?>
<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">
<div class="col-lg-2 col-md-2 col-sm-3">
   <?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'] . "'");
    //echo "<pre>";print_r($prod_result);die;
  ?>
<a href="" 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']; ?>">
</a>
</div>

<div class="col-lg-10 col-md-10 col-sm-9">
<div class="wishlist_info"> 
<a href="javascript:void()"><?php echo $prod_result['product_name'];?></a>
<p><?php echo $prod_result['products_description'];?></p>
<strong><i class="fa fa-inr"></i> <?php echo $prod_result['product_price'];?></strong>
</div>
</div>

</div>
</div>

</div>
</div>

</div>

<!-- <form> -->
<?php echo form_open(current_url_query_string(), 'class="form-horizontal"'); ?> 
 <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');
      krsort($starArray);
     foreach ($starArray as $key => $value) {
      ?>
        <input class="star star-<?php echo $key;?>" id="star-<?php echo $key;?>" type="radio" name="ads_rating" value="<?php echo $key;?>" <?php if($key == $ads_rating){ echo 'checked="checked"';} ?>>
        <label class="star star-<?php echo $key;?>" for="star-<?php echo $key;?>" title="<?php echo $value;?>"></label>
      <?php
       # code...
     }
     ?>
     <?php echo form_error('ads_rating');?>

  </div>

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

<div class="form-group">
<label class="review_title">Review This Product</label>
<!-- <textarea tabindex="5" class="form-control" rows="5" placeholder="Description" required="" name="description"></textarea> -->
<textarea name="comment" class="form-control" rows="5" cols="50" id="comment" > <?php echo set_value('comment');?><?php echo $proRes[0]['text'];?></textarea>
     <?php echo form_error('comment');?>

</div>
<?php //echo "<pre>";print_r($proRes);?>
<input class="star star-4" id="star-4" type="hidden" name="products_id" value="<?php echo $prod_result['products_id'];?>">
<button tabindex="9" class="modal_btn save_btn" type="submit" name="submit">Submit</button>
<a href="javascript:void()" id="add_cancel" class="modal_btn cancel">Cancel</a>
<!-- </form> -->
<?php echo form_close();?>
</div>
</div>
</div>

<div class="col-md-3 col-md-pull-9">

<?php $this->load->view("left"); ?>
</div>

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

<div style="clear:both;"></div>
                        
<?php $this->load->view("bottom"); ?>