{include file="public/header" /}
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>店铺统计</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>

  <div class="fixed-empty"></div>
  <div style="width:100%; text-align:right;padding-top:10px;">
  	<input type="hidden" id="export_type" name="export_type" data-param='{"url":"<?php echo $actionurl; ?>&exporttype=excel"}' value="excel"/>
  	<a class="btns" href="javascript:void(0);" id="export_btn"><span>导出Excel</span></a>
  </div>
  <form method="post" id="form_member">
    <table class="ds-default-table nobdb">
      <thead>
        <tr class="thead">
          <th class="align-center">店铺名称</th>
          <th class="align-center">店主账号</th>
          <th class="align-center">店主卖家账号</th>
          <th class="align-center">所属等级</th>
          <th class="align-center">有效期至</th>
          <th class="align-center">开店时间</th>
        </tr>
      <tbody id="datatable">
        <?php if(!empty($store_list) && is_array($store_list)){ ?>
        <?php foreach($store_list as $k => $v){ ?>
        <tr class="hover member">
          <td class="align-center"><?php echo $v['store_name']; ?></td>
          <td class="align-center"><?php echo $v['member_name']; ?></td>
          <td class="align-center"><?php echo $v['seller_name']; ?></td>
          <td class="align-center"><?php echo ($t = $search_grade_list[$v['grade_id']])?$t:'平台店铺'; ?></td>
          <td class="align-center"><?php echo $v['store_end_time']?date('Y-m-d', $v['store_end_time']):'无限制'; ?></td>
          <td class="align-center"><?php echo date('Y-m-d', $v['store_time']); ?></td>
        </tr>
        <?php } ?>
        <?php }else { ?>
        <tr class="no_data">
          <td colspan="11"><?php echo lang('ds_no_record')?></td>
        </tr>
        <?php } ?>
      </tbody>
      <?php if(!empty($store_list) && is_array($store_list)){ ?>
      <tfoot class="tfoot">
        <tr>
          <td colspan="16">
            <div class="pagination"> <?php echo $show_page;?> </div></td>
        </tr>
      </tfoot>
      <?php } ?>
    </table>
  </form>

</div>
<script src="{:config('url_domain_root')}static/common/js/statistics.js"></script>
<script>
$(function(){
    //导出图表
    $("#export_btn").click(function(){
        var item = $("#export_type");
        var type = $(item).val();
        if(type == 'excel'){
            download_excel(item);
        }
    });
});
</script>