<div class="page-content" >
    <div class="row">

        <div class="col-xs-12" style="height:390px">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                <tr>
                    <th data-i18n="invite.nickname"></th>
                    <th data-i18n="invite.registerDate"></th>
                    <th data-i18n="invite.registerIp"></th>
                    <th data-i18n="invite.completeTimes"></th>
                </tr>
                </thead>
                <tbody id="table">
                </tbody>
            </table>
        </div>

        <div class="col-xs-6">
            <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">

                <span data-i18n="invite.complete500Times"></span><span id="compete500Times" class="blue">loading...</span>
                <!--<button data-i18n="[title]operation.search" class="btn btn-white btn-yellow btn-bold" onclick="buttonSearch();">
                  <span><i class="ace-icon fa fa-search bigger-120 yellow"></i></span>
                </button>-->

            </div>
        </div>


        <div class="col-xs-6">
            <div class="dataTables_paginate paging_simple_numbers" id="tablePage">
            </div>
        </div>


    </div>
</div>

<textarea id="templateTable" style="display:none">

  {{#empty}}
  <tr>
      <td align="center" colspan="4" data-i18n="message.emptyRecord"></td>
  </tr>
  {{/empty}}

  {{#data}}
  <tr>
      <td>{{nickname}}</td>
      <td>{{register_date}}</td>
      <td>{{register_ip}}</td>
      <td>{{#complete_num}}
              {{complete_num}}
          {{/complete_num}}
          {{#get_credit}}
              <a href="javascript:getCredit({{uid}});"><i class="menu-icon fa fa-credit-card"></i></a>
          {{/get_credit}}</td>
  </tr>
  {{/data}}

</textarea>

<script type="text/javascript">

    loadTable();

    one(function(){
        jsonp("user/invite_500.php",function (data) {
            $("#compete500Times").html(data.total);
        })
    });

    function loadTable(page)
    {
        mPage = page ? page : mPage;
        jsonm("user/invite_list.php" + mPage,"#templateTable","#table");
    }

    function getCredit(uid)
    {
        jsonp("user/invite_use.php?id=" + uid,function (data) {
            mbox(data.msg);
            loadTable(0);
        });
    }

</script>

