<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase.php');?>
<div style="margin-top: 5px;margin-right: 10px;width:780px;">
	<div class="searchParam" id="shop-index-ser-pa">
		<form method="get">
			<b>用户名</b><input type="text"  class="form-control" name="username" value="<?php echo $Params['username'];?>" placeholder="用户名">&nbsp;&nbsp;&nbsp;
			<b>维修厂</b><input type="text"  class="form-control" name="shopname" value="<?php echo $Params['shopname'];?>" placeholder="维修厂名称">&nbsp;&nbsp;&nbsp;
			<button type="submit" class="btn btn-primary">查询</button>
            <a style="color: red;margin-left: 10px;" target="_blank" href="<?php echo mvc::$cfg['ADMIN_URI'];?>pjlWxc/orderList">工单历史</a>
		</form>
	</div>
	<table id="shop-list-all" class="table table-bordered table-hover YpTable" style="margin-bottom: 5px;">
		<thead class="Filter Sortable">
			<tr>
				<th class="center Sort"  width="90px"><span>用户名</span></th>
				<th class="center Sort"  width="180px"><span>维修厂</span></th>
                <th class="center Sort"  width="60px;"><span>工单数</span></th>
				<th class="center Sort"  width="80px"><span>工单总额</span></th>
				<th class="center Sort"  width="90px"><span>工单项目数 </span></th>
                <th class="center Sort"  width="60px"><span>车辆数</span></th>
                <th class="center Sort"  width="120px"><span>首单日期</span></th>
				<th class="center Sort"  width="120px"><span>尾单日期</span></th>
			</tr>
		</thead>
		<tbody>
			<?php if(!empty($data)){ ?>
			<?php foreach($data as $k => $v){ ?>
                <tr>
                    <td><?php echo $userArr[$v['ord_shopr_id']]['u_name'];?></td>
                    <td><?php echo $v['shopr_name'];?></td>
                    <td><?php echo $v['orderCnt'] ?: ''; ?></td>
                    <td><?php echo $v['moneyCnt'] ?: ''; ?></td>
                    <td><?php echo $xmArr[$v['ord_shopr_id']]['total']?></td>
                    <td><?php echo $v['carCnt']?: '';?></td>
                    <td>
                        <?=$v['firstOrder']?date('Y-m-d H:i',$v['firstOrder']):''?>
                    </td>
                    <td>
                        <?=$v['lastOrder']?date('Y-m-d H:i',$v['lastOrder']):''?>
                    </td>
                </tr>
			<?php } ?>
			<?php }else{ ?>
                <tr>
                    <td colspan="8"><div class="shoplist-error-msg">无相关信息！</div></td>
                </tr>
			<?php } ?>
		</tbody>
	</table>
	<?php echo $page;?>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
