<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase.php');?>  
  <div class="layui-fluid">
    <div class="layui-card">
	  <form class="layui-form layui-card-header layuiadmin-card-header-auto search-param">
		<div class="layui-form-item">
		  <div class="layui-inline">
            <label class="layui-form-label">时间范围</label>
            <div class="layui-input-block">
				<input type="text" name="dml_atime" class="layui-input" id="dml_atime" placeholder=" ~ " autocomplete="off" value="<?php echo $Params['dml_atime'];?>">
			</div>
          </div>
		  <div class="layui-inline">
			<button class="layui-btn act-btn" lay-submit="" lay-filter="search-submit">
			  <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
			</button>
			<?php foreach($fastTime as $k=>$v){?>
			<a href="<?php echo mvc::$cfg['SELF_URI'];?>daili/tcTj?dml_atime=<?php echo $v;?>" style="margin-left:10px;" class="a_blue"><?php echo $k;?></a>
			<?php }?>
		  </div>
		</div>
	  </form>
      <div class="layui-card-body">
         <table class="layui-table">
            <thead>
				<tr>
					<th rowspan="2" class="center" width="80px">业务员</th>
					<?php foreach($allStyle as $styleName){?>
					<th colspan="<?php echo $rule ? 4: 3;?>" class="center"><?php echo $styleName;?></th>
					<?php }?>
					<th rowspan="2"></th>
				</tr>
				<tr>
					<?php foreach($allStyle as $styleName){?>
					<th width="70px">总额</th>
					<?php if($rule){?>
					<th width="70px">代理商</th>
					<?php }?>
					<th width="70px">业务员</th>
					<th width="40px">笔数</th>
					<?php }?>
				</tr>
            </thead>
            <tbody>
            <?php foreach($tjArr as $uid =>$v){ ?>
                <tr>
                    <td><?php echo $workerArr[$uid]['dwo_name'];?></td>
					<?php foreach($allStyle as $style=>$styleName){?>
                    <td><?php if(!empty($v[$style]['dml_money_pay']))  echo sprintf('%.2f', $v[$style]['dml_money_pay']);?></td>
					<?php if($rule){?>
                    <td><?php if(!empty($v[$style]['dml_money_selftc']))  echo sprintf('%.2f', $v[$style]['dml_money_selftc']);?></td>
					<?php }?>
                    <td><?php if(!empty($v[$style]['dml_money_ywytc']))  echo sprintf('%.2f', $v[$style]['dml_money_ywytc']);?></td>
                    <td><?php if(!empty($v[$style]['order_count']))  echo $v[$style]['order_count'];?></td>
					<?php }?>
					<td></td>
                </tr>
            <?php }?>
            </tbody>
			<tfoot>
				<tr>
                    <th>汇总</th>
					<?php foreach($allStyle as $style=>$styleName){?>
                    <th><?php if(!empty($total[$style]['dml_money_pay']))  echo sprintf('%.2f', $total[$style]['dml_money_pay']);?></th>
					<?php if($rule){?>
                    <th><?php if(!empty($total[$style]['dml_money_selftc']))  echo sprintf('%.2f', $total[$style]['dml_money_selftc']);?></th>
					<?php }?>
                    <th><?php if(!empty($total[$style]['dml_money_ywytc']))  echo sprintf('%.2f', $total[$style]['dml_money_ywytc']);?></th>
                    <th><?php if(!empty($total[$style]['order_count']))  echo $total[$style]['order_count'];?></th>
                    <?php }?>
					<th></th>
                </tr>
			</tfoot>
        </table>
      </div>
    </div>
  </div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script>
layui.use(['laydate'], function(){
  var $ = layui.$
  ,laydate = layui.laydate;

  laydate.render({
      elem: '#dml_atime'
      ,range: '~'
	  ,max: 0
   });
});
</script>