<?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>



<?php @session_start();

 //$this->session->flashdata('message'); ?>

  <section class="my_account_page">

<div class="container">

<ul class="account_breadcrumb">

<li><a href="<?=SITE_URL();?>" title="Home">Home</a></li>

<li><a href="<?=SITE_URL();?>my-account" title="My Account">My Account</a></li>

<li><a href="<?=SITE_URL();?>my-orders" title="My Orders">My Orders</a></li>

<li class="active">Ratings &amp; Reviews</li>

</ul>

<div class="row">

<div class="col-xxl-9 col-xl-9 col-lg-9 col-md-9 col-sm-9">

<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="<?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']; ?>">

</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><?php echo $prod_result['products_description'];?></p>-->
    <br/>

<strong style="color: brown;"><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"'); ?> 
    <?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="rating-css">
    <div class="star-icon">
                            <?php

     $rating_opts = $this->config->item('rating_opts');

     $max_star = 5;

     $ads_rating = $proRes[0]['ads_rating'];

      $starArray =$this->config->item('starArray');
      //  trace($starArray);

     // krsort($starArray);
        //trace($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>
  </div>
 <?php echo form_error('ads_rating');?>
     

<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-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 order-xxl-first order-xl-first order-lg-first order-md-first order-sm-first order-last">
<?php $this->load->view("left"); ?>
</div>



</div>

</div>

</section>



<div style="clear:both;"></div>

                        

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