  <div class="my-account">
	<div class="heading clearfix">
    	<dl class="acctip">
        	<dt><?php echo $heading_title; ?></dt>
            <dd>(The orders below have been paid, please be patient to wait our processing.)</dd>
        </dl>
    </div>  
    <div id="history">    
      <table class="hisorder" width="100%">
        <tbody>
            <tr>
            	<th>Order Reference</th>
                <th>Date Added</th>
                <th>Grand Total</th>
                <th>Order Status</th>
                <?php if($order_status!='process'){?>                
                  <th>Points Reward</th>
                <?php }?>
                <th>Operation</th>
            </tr>
             <?php foreach ($orders as $order) { ?>
            <tr>
            	<td><a href="<?php echo $order['href']; ?>" target="_blank" class="blue"><?php echo $order['reference']; ?></a></td>
                <td><?php echo $order['date_added']; ?></td>
                <td style="color:red;"><?php echo $order['total']; ?></td>
                <td style="color:blue;"><?php echo $order['status']; ?></td>
                <?php if($order_status!='process'){?>     
                  <td style="color:red;"><?php echo intval($order['points']); ?> Points</td>
                <?php }?>
                <td><a href="<?php echo $order['href']; ?>" class="blue" style="text-decoration:underline;">View Detail</a></td>
            </tr>
            <?php } ?>
        </tbody>
      </table>      
    </div>    
    <div style="height:15px;">&nbsp;</div>
     <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>
    <div class="buttons" style="text-align:right; margin-top:20px;">
      <a style="margin-right:0;" href="/index.php?controller=account" class="btn_button btn_gray"><i class="icon-back"></i>Back to Account</a>
    </div>
</div>

