<script language="javascript"> 
function check_func()
	{
		return confirm("Your order is waiting for payment. If you have paid it, Please don't delete, We will process it asap. Do you confirm to delete?");
	}
</script>
<div class="my-account">
    <div class="heading clearfix">
            <dl class="acctip">
                <dt><?php echo $heading_title; ?></dt>
                <dd>(The final order status will be updated in 24 hrs, if it is still unpaid after you paid)</dd>
            </dl>
        </div> 
    <div>
            <table class="hisorder" width="100%">
                <tbody>
                    <tr>
                        <th>Order Reference</th>
                        <th>Date Added</th>                        
                        <th>Order Status</th>
                        <th>Grand Total</th>
                        <th>Operation</th>
                    </tr>
                    <?php foreach($potential_orders as $order){ ?>	
                    <tr>
                        <td><a class="blue" href="<?php echo $order['href']; ?>"><?php echo $order['reference'];?></a></td>
                        <td><?php echo$order['date_added'];?></td>
                         <td>Awaiting Payment</td>
                         <td style="color:red;"><?php echo $order['grand_total'];?></td>                  
                        <td><a class="blue" style="text-decoration:underline;" href="<?php echo $order['href']; ?>">View Detail</a></td>
                    </tr>
                    <?php } ?> 
                </tbody>
            </table>
       
    </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>
        <p style="text-align:right; margin-top:15px;">
        <a class="btn_button btn_gray" href="/index.php?controller=account" style="margin-right:0;"><i class="icon-back"></i>Back to Account</a></p>
</div>