<div class="my-account">
    <div class="heading">
        <dl class="acctip">
            <dt>My Affiliate</dt>
        </dl>
    </div>
  <script type="text/javascript">
    function jsCopy(){ 
        var e=document.getElementById("tbid");
        e.select();
        document.execCommand("Copy");
        alert("Copy your affiliate url sucessfully, Please paste it at where you may send it to other people."); 
    	} 
    </script>
    <div class="share-list cf">
          <div class="im">
              <div class="info clearfix">
                  <h3>This is the special link for invitation code. Please send it to your friends by MSN, Yahoo, or Email.</h3>
                <textarea class="clearfix input-text" name="tbid" id="tbid" style="font-size:14px; width:690px; display:inline-block; vertical-align:middle; margin-right:10px;">https://www.beststoreitems.com/index.php?controller=affiliate&invite_code=<?php echo $token;?></textarea> 
                <input type="button" class="btn_button btn_orange" value="Copy" onclick="jsCopy()">
                      <p style="color:red">Please click on the TextBox to select content, then copy it at the popup menu by right click on TextBox.</p>	           
              </div>
          </div>
  </div>
      
    <table width="99%" cellspacing="0" cellpadding="0" border="1" class="coupons-table">
        <tbody>
                <tr>
                    <th>Invite friends</th>
                    <th>Invite Time</th>
                    <th>Has purchased</th>
                    <th>Rewards</th>
                </tr>
            <?php foreach ($customer_invites as $key=>$invite){?>
                <tr <?php if($key/2 == 0){?>class="alt"<?php }?>>
                    <td><?php echo $invite['name']?></td>
                    <td><?php echo $invite['date_added'];?></td>                  
                    <td style="color:black;"><?php echo $invite['status'] ==0 ?'No':'Yes'?></td>
   <td><?php if($invite['status']==0){?>$ 0 USD Coupon<?php }else{?>$ 10 USD Coupon&nbsp;<a target="_blank" href="index.php?controller=coupon" style="font-size:11px;color:blue;">View</a><?php }?></td>
                </tr>
                <?php }?>
        </tbody>
    </table>
     <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="affiliate-tips">
			  <h3>Affiliate Program Explication</h3>
              <p>In order to thanks for many regular customers highly recommend beststoreitems.com to your friends, we have the pleasure to present our new policy: Affiliate Program. If you send the invitation code to your friend, he/she&nbsp;opens the link and creates an account on beststoreitems.com, he/she will&nbsp;gain $10USD coupon&nbsp;at onces.&nbsp;And you also will obtain $10USD coupon after we shipped your friend's order out sucessfully.</p>
              <br>
              <h3>Procedures</h3>
              <p>
                  1. Please login your account click the "My Affiliate", then you will get the link as following picture shows, click "Copy", and send the link to your friend.</p>
              <br>
              <p align="left">
                  <img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/affilate/affilate_1.gif"></p>
              <p>
                  <br>
                  2. If your friend opens the link and creates an account on beststoreitems.com, he/she will get $10USD coupon at once. Meanwhile the system will automatically update the information for your account, like below shows:</p>
<img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/affilate/affilate_2.gif">
              <p>
                  <br>
                  3.You will obtain $10USD coupon after we shipped your friend's order out successfully, please update “My Affiliate”, click“view” to get the coupon number.</p>
              <p>
                  <img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/affilate/affilate_3.gif"></p>
              <p align="left">&nbsp;
                </p>
          </div>
</div>