<div class="my-account">
    <div class="heading">
        <dl class="acctip">
            <dt>Waiting for your Review</dt>
        </dl>
    </div>
    <div id="customer-review">
      <div class="review_desc">
    We would like to know what you thought about your purchase! If you have already received items below listed. Please post your Reviews to us, you will get 3 points for the Review of each item.You can also get 5 points through posting photos of each item you received. But the final points will be given after we verify your Review.
      </div> 
    
    <?php foreach($waiting_review_products as $k=>$waiting_review_product){?>
    
      <form action="index.php?controller=waiting_review" method="POST" enctype="multipart/form-data">
    <ul class="customer-review">
      <li class="review_list cont clearfix">
      		<div class="col-sm-8">
            	<div class="crt-product">
    <a href="<?php echo $waiting_review_product['product_href']; ?>" target="_blank" class="crt-product_img"><img width="270" height="270" src="<?php echo $waiting_review_product['thumb']; ?>"></a>
    			</div>
                <div class="item_price">
                	<span class="special-price"> <?php echo $waiting_review_product['product_price'];?></span>
                </div>
                <!-- <label><?php echo $waiting_review_product['sold']; ?></label><div class="order-reference">PO# <?php  echo $f['reference']?></div>-->
                <div class="date">
                	<span class="date">Bought at <?php echo date('M',strtotime($waiting_review_product['date_added']))?> <?php echo date('d',strtotime($waiting_review_product['date_added']))?>, <?php echo date('Y',strtotime($waiting_review_product['date_added']))?></span>
                 </div>
                 <div class="item_review">
                 	<div class="rating">
                        <span class="nostar">
                            <span class="nstar" style="width:<?php echo intval($waiting_review_product['review_info']['avg']*20)?>%;"></span>
                        </span>
                    </div>
                    (<?php echo $waiting_review_product['review_info']['count']?>)<span class="line">|</span>Orders (<?php echo $waiting_review_product['sold'];?>) 
                 </div>
             	</div>            
            <div class="col-sm-16">
            	<div class="crt-review">
                <h2><?php echo $waiting_review_product['product_title']?></h2>
                <div class="selectStar clearfix">
                    <input type="hidden" id="rating" name="rating" value="5" size="2" />
                    <ul class="clearfix">
                        <li class="title">
                            <span class="zi">Product Rating: </span>
                            <span id="dpCont1" class="dpCont">5 Stars</span>
                            <em id="dpStar1" class="selectS5">
                                <a href="#" id="1" onclick="get_rating(1);">1</a>
                                <a href="#" id="2" onclick="get_rating(2);">2</a>
                                <a href="#" id="3" onclick="get_rating(3);">3</a>
                                <a href="#" id="4" onclick="get_rating(4);">4</a>
                                <a href="#" id="5" onclick="get_rating(5);" class="last">5</a></em>
                        </li>
                    </ul>
                </div>
               <ul>
    
               <li>
                      <span class="select_list">
    
                            <span class="title">Size:</span>
    
                            <select class="selectMian" name="product_size">
    
                               <option value="1">Smaller</option>
    
                               <option value="2" selected="selected">Just Right</option>
    
                               <option value="3">Larger</option>
    
                            </select>
    
                        </span>                    
    
                        <span class="select_list">
    
                        <span class="title">Color:</span>
    
                            <select class="selectMian" name="product_color">
    
                               <option value="1">Lighter</option>
    
                               <option value="2" selected="selected">Just Right</option>
    
                               <option value="3">Darker</option>
    
                            </select>
    
                        </span>                    
    
                        <span>
                            <span class="title title_2">Material:</span>
                            <select class="selectMian"  name="product_material">
    
                               <option value="1">Poor</option>
    
                               <option value="2" selected="selected">Just Right</option>
    
                               <option value="3">Great</option>
    
                            </select>
    
                        </span>
    
                </li> 	         
    
                 <li style="margin-top:15px;"><!--span class="title">Your Review:</span--><textarea name="product_review" rows="4"  onfocus="if (this.value=='No Review left for this order. Default Review rating given. ')this.value=''" onblur="if (this.value=='')this.value='No Review left for this order. Default Review rating given. '">No Review left for this order. Default Review rating given. </textarea></li>
                 <span style="display:block; margin-bottom:10px; color:#ff0000;">You may post at most 2 product real photos to get extra reward points.</span>
                 <li class="fillbox">
                    <table>
                        <tbody>
                        <tr>
                          <td width="80" class="title">Image 1:</td>
                          <td><input type="file" name="image_1"/>
                           <?php if(isset($error_option1)){?>
                               <span class="error"><?php echo $error_option1?></span>
                           <?php }?>
                           </td>                     
                        </tr>				  
                        <tr>
                          <td width="80" class="title">Image 2:</td>
                          <td><input type="file" name="image_2"/>
                          <?php if(isset($error_option2)){?>
                               <span class="error"><?php echo $error_option2?></span>
                           <?php }?>
                           </td>
                        </tr>
                    <!--tr>
                          <td width="80" class="title">Image 3:</td>
                          <td><input type="file" name="image_3"/>
                          <?php if(isset($error_option2)){?>
                               <span class="error"><?php echo $error_option2?></span>
                           <?php }?>
                           </td>
                        </tr>
                        <tr>
                          <td width="80" class="title">Image 4:</td>
                          <td><input type="file" name="image_4"/>
                          <?php if(isset($error_option2)){?>
                               <span class="error"><?php echo $error_option2?></span>
                           <?php }?>
                           </td>
                        </tr>
                        <tr>
                          <td width="80" class="title">Image 5:</td>
                          <td><input type="file" name="image_5"/>
                          <?php if(isset($error_option2)){?>
                               <span class="error"><?php echo $error_option2?></span>
                           <?php }?>
                           </td>
                        </tr-->
                      </tbody>
                    </table>
                 </li>
               </ul>
    
               <input type="hidden" name="product_id" value="<?php echo $waiting_review_product['product_id']?>">
    
               <div style="text-align:right; margin-top:15px;">
    
                <input class="btn_button btn_orange" type="submit" onclick="submit();" value="Submit">
    
               </div>
    
             </div>
            
            </div>
      </li>
    </ul>
      </form>
    
     <?php }?>
    
     <!--page-->
       <div style=" margin-bottom:20px">
        <form action="https://www.beststoreitems.com/index.php?controller=completed_review&action=page&path=1" method="post" name="pageform" enctype="multipart/form-data">
         <input type="hidden" name="page" value="1" />
        <script language="javascript" type="text/javascript">
             function SelectPage(page)
             {
                document.pageform.page.value = page;
                document.pageform.submit();
                return false;
             };
        </script>
        <div class="toolbar clearfix">
          <div class="sorter_bottom">
               <div class="col-sm-8 left"><?php echo $text_results;?></div>
               <div class="col-sm-16 right">                   
                    <a href="<?php echo $action . '&page=' . (($page>1)?($page-1):$page); ?>"><?php echo 'Previous'?></a>                     
                    <?php foreach ($pages as $f_page) { ?>        
                    <?php if ( $f_page['value'] < ($page - 2) ) {continue; } ?>
                    <?php if ( $f_page['value'] > ($page + 4) ) {continue; } ?>                                               
                    <?php if ($f_page['value'] == $page) { ?>
                    <b class="selected"><?php $x = explode(" ",$f_page['text']);echo $x[0]; ?></b>
                    <?php } else { ?>
                      <a class="page_btn" href="<?php echo $action . '&page=' . $f_page['value']; ?>"><?php $x = explode(" ",$f_page['text']);echo $x[0]; ?></a></td>
                    <?php } ?>   
                    <?php } ?>                       
                    <a class="page_btn" href="<?php echo $action . '&page=' . (($page<count($pages))?($page+1):$page); ?>"><?php echo 'Next'?></a>                     
                    <label>Go to Page</label>
                    <select onchange="return SelectPage(this.value)" style="width:50px;">
                        <?php foreach ($pages as $f_page){?>
                        <option value="<?php echo $f_page['value']?>" <?php if ($f_page['value'] == $page){echo 'selected';}?>><?php echo $f_page['value']?></option>
                        <?php };?>
                    </select>
                    <script type="text/javascript">
						function SelectPage(page) {
							window.location.href="<?php echo $action; ?>&page=" + page;
						}
					</script>
             </div>
          </div>
     </div>
        </form>
       </div>
       <!--page end-->
    </div>
</div>
<script type="text/javascript">
function get_rating(id)
{     
	document.getElementById('rating').value=id;
}

$(function(){

	var className;

	var classID;

	var dpText="";

	var dpTextC="";	

	$(".selectStar em a").bind("click",function(){

		className = "selectS" + $(this).attr("id");

		classID = $(this).parent().attr("id");

		$(this).parent().removeClass().addClass(className);		

		if($(this).attr("id") == 1 || $(this).attr("id") == 1) {dpTextC = "1 Stars";}

		if($(this).attr("id") == 2 || $(this).attr("id") == 2) {dpTextC = "2 Stars";}

		if($(this).attr("id") == 3 || $(this).attr("id") == 3) {dpTextC = "3 Stars";}

		if($(this).attr("id") == 4 || $(this).attr("id") == 4) {dpTextC = "4 Stars";}

		if($(this).attr("id") == 5) {dpTextC = "5 Stars";}

		$(this).parent().prev(".dpCont").text(dpTextC);	

		return false;

	})		

	.bind("mouseover",function(){

		if($(this).attr("id") == 1 || $(this).attr("id") == 1) {dpText = "1 Stars";}

		if($(this).attr("id") == 2|| $(this).attr("id") == 2) {dpText = "2 Stars";}

		if($(this).attr("id") == 3 || $(this).attr("id") == 3) {dpText = "3 Stars";}

		if($(this).attr("id") == 4|| $(this).attr("id") == 4) {dpText = "4 Stars";}

		if($(this).attr("id") == 5) {dpText = "5 Stars";}

		$(this).parent().removeClass().addClass("selectS" + $(this).attr("id"));

		$(this).parent().prev(".dpCont").text(dpText);

	    $("#rating").value=dpTextC;

	})	

	.bind("mouseout",function(){

		$(this).parent().removeClass("selectS" + $(this).attr("id"));

		if($(this).parent().attr("id") == classID){

			$(this).parent().addClass(className);
		}
		$(this).parent().prev(".dpCont").text(dpTextC);		

	});	

});

</script>

<script type="text/javascript" src="catalog/javascript/select.js"></script>