<script type="text/javascript" src="catalog/javascript/jquery.fancybox-1.3.1.js"></script>
<script type="text/javascript">	
	$(document).ready(function() {
			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
		});
</script>
<style>
.crt-review .selected li .jslct em{cursor:default;}
</style>
<div class="my-account">
    <div class="heading">
        <dl class="acctip">
            <dt>Completed Review</dt>
        </dl>
    </div> 
    
	<div id="customer-review">
    <?php foreach($reviews as $k=>$review){?>
    
    <form action="<?php echo $review['delete_href']; ?>" 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 $review['product_href']; ?>" target="_blank"><img class="crt-product_img" width="270" src="<?php echo $review['thumb']; ?>"></a></div>
                 <div class="item_price"><span class="special-price"><?php echo $review['price']; ?></span></div>
                    
                    <!--<div class="order-reference">PO#<?php  echo $review['reference']; ?></div>-->
                    <div class="date">Bought at <?php echo date('M',strtotime($review['date_added']));?> <?php echo date('d',strtotime($review['date_added']))?>, <?php echo date('Y',strtotime($review['date_added'])); ?></span></div>
                    
                    <div class="item_review">
                        <div class="rating">
                            <span class="nostar">
                                <span class="nstar" style="width:<?php echo intval($review['review_info']['avg']*20); ?>%;"></span>
                            </span>
                        </div>
                        (<?php echo $review['review_info']['count']?>)<span class="line">|</span>Orders (<?php echo $review['sold'];?>) 
                     </div>
                    
                      </div>
                    
                       <div class="col-sm-16">
                    	  <div class="crt-review">
                          <h2><?php  echo $review['product_title']?></h2>
                    
                          <div class="selectStar clearfix">
                    
                              <input type="hidden" id="rating" name="product[<?php echo $k; ?>][rating]" value="<?php echo $review['rating']; ?>" size="2" />
                    
                              <ul class="clearfix">
                                  <li class="title" style="float:left">
                                      <span class="zi">Product Rating: </span>
                    
                                      <span id="dpCont1" class="dpCont hidden-xs">5 Stars</span>
                    
                                      <em id="dpStar1" class="selectS5">
                    
                                          <a id="1" onclick="get_rating(1);">1</a>
                    
                                          <a id="2" onclick="get_rating(2);">2</a>
                    
                                          <a id="3" onclick="get_rating(3);">3</a>
                    
                                          <a id="4" onclick="get_rating(4);">4</a>
                    
                                          <a id="5" onclick="get_rating(5);">5</a>
                    
                                      </em>
                    
                                  </li>
                    
                                  <li class="posted-date"> Posted by <?php echo date('Y-m-d',strtotime($review['date_added'])); ?></li>
                    
                              </ul>              
                    
                          </div>
                    
                         <ul class="selected">
                    
                           <li class="clelarfix">
                                    <span class="select_list">
                                        <span class="title">Size:</span>
                                        <input type="hidden" name="product[<?php echo $k;?>][size_tag]" value="<?php echo $review['size']; ?>">
                    
                                        <select class="selectMian" name="product[<?php echo $k;?>][size]">
                    
                                           <option value="1" <?php if($review['size']==1) echo 'selected'; ?>>Smaller</option>
                    
                                           <option value="2" <?php if($review['size']==2) echo 'selected'; ?>>Just Right</option>
                    
                                           <option value="3" <?php if($review['size']==3) echo 'selected'; ?>>Larger</option>
                    
                                        </select>
                    
                                    </span>                    
                    
                                    <span class="select_list">
                    
                                    <span class="title">Color:</span>
                    
                                       <input type="hidden" name="product[<?php echo $k; ?>][color_tag]" value="<?php echo $review['color']; ?>">
                    
                                        <select class="selectMian" name="product[<?php echo $k; ?>][color]">
                    
                                           <option value="1" <?php if($review['color']==1) echo 'selected'; ?>>Lighter</option>
                    
                                           <option value="2" <?php if($review['color']==2) echo 'selected'; ?>>Just Right</option>
                    
                                           <option value="3" <?php if($review['color']==3) echo 'selected'; ?>>Darker</option>
                    
                                        </select>
                                    </span>                   
                    
                                    <span>
                                        <span class="title title_2">Material:</span>
                    
                                        <input type="hidden" name="product[<?php echo $k; ?>][material_tag]" value="<?php echo $review['material']; ?>">
                    
                                        <select class="selectMian"  name="product[<?php echo $k; ?>][material]">
                    
                                           <option value="1" <?php if($review['material']==1) echo 'selected';?>>Poor</option>
                    
                                           <option value="2" <?php if($review['material']==2) echo 'selected';?>>Just Right</option>
                    
                                           <option value="3" <?php if($review['material']==3) echo 'selected';?>>Great</option>
                    
                                        </select>
                    
                                    </span>
                    
                              </li>
                    
                             <li class="u-review"><span class="title">Your Review:</span><textarea name="product[<?php echo $k;?>][review]" rows="4" readonly="readonly"><?php  echo $review['review_content']?></textarea></li>     
                       <li class="attached-img"><?php foreach($review['review_images'] as $review_image){ ?>  <a rel="example_group" class="upload-img" href="<?php echo $review_image; ?>"><img src="<?php echo $review_image;?>" width="100" height="100"/></a><?php } ?> </li>  		
                         </ul>  
                    
                         <input type="hidden" name="product[<?php echo $k;?>][review_id]" value="<?php  echo $review['review_id'];?>">       
                    
                         <div class="clearfix" style="text-align:right; margin-top:15px;">
                    
                           <input class="btn_button btn_orange" type="submit" value="Delete">
                    
                         </div>
                    		</div>
                           
                    
                       </div>
</li>    
    </ul>
    
    </form><?php }?></div>   
    
    <!--page-->    
   
   <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>
  
    <!--page end-->
</div>
<script type="text/javascript" src="catalog/javascript/select.js"></script>