<script type="text/javascript" > 
	$(function(){
	    var $div_li =$("div.tab_menu ul li");
	    $div_li.click(function(){
			$(this).addClass("selected")           
				   .siblings().removeClass("selected"); 
            var index =  $div_li.index(this);  
			$("div.tab_box > div")   	
					.eq(index).show()   
					.siblings().hide();
		})
	})
</script>
<div class="my-account">
	<div class="heading" style="margin-bottom:0;">
        <dl class="acctip">
            <dt>My Points</dt>
        </dl>
    </div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="hisorder">
    <tbody>
        <tr>
            <th width="33%">Points</th>
            <th width="33%">Vip</th>
            <th width="34%">Enjoy Discount</th>
        </tr>
        <tr>
            <td><?php echo $customer_info['current_points'];?></td>
            <td><?php echo $customer_info['vip_rank'];?></td>
            <td><?php echo $customer_discount['discount'];?> off</td>
        </tr>
    </tbody>
</table>
<div class="clear10"></div>
<div style="margin:10px 0; color:#F66907;font-size:14px; font-weight:bold; border-bottom:1px solid #ccc; padding-bottom:5px;">Points Records</div>
    <div id="tabbar">
    
        <div class="tab_menu">
            <ul>
                <li class="<?php if($type==1){ echo selected; }?>"><a href="<?php echo $action . '&type=1'; ?>"><span>Order Rewards</span></a></li>
                <li class="<?php if($type==2){ echo selected; }?>"><a href="<?php echo $action . '&type=2'; ?>"><span>Question Rewards</span></a></li>
                <li class="<?php if($type==3){ echo selected; }?>"><a href="<?php echo $action . '&type=3'; ?>"><span>Review Rewards</span></a></li>
            </ul>
        </div>                    
        <div class="tab_box" id="review">
            <div>
                <table width="100%" cellpadding="0" cellspacing="0" border="0" class="hisorder">
                    <tbody>
                        <tr>
                            <th>No.</th>
                            <th>ID</th>
                            <th>Create Time</th>
                            <th>Type</th>
                            <th>Amount</th>
                        </tr>
                      
                       <?php foreach($show_array as $k=>$v){?>
                        <tr>
                            <td><?php echo $k+1;?></td>
                            <td><a target="_blank" href="<?php echo $v['href'];?>"><?php echo $v['id'];?></a></td>
                            <td><?php echo $v['date_added'];?></td>
                            <td><?php echo $v['type'];?></td>
                            <td><b class="acct1">+<?php echo ceil($v['points']);?></b> Points</td>
                        </tr>
                       <?php }?>
                      
                    </tbody>
                </table>
            </div>      
            
        </div>
    </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>
   <!--分页结束-->
<br />
<p style="text-align:right;"><a href="/index.php?controller=account"><img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/backtoaccount.gif" style="cursor:pointer;"/></a></p>
</div>