{load(fhead)}
<body class="mainbg">
	<div id="mainhearder"><span>您的位置：<a href="{$vd['root']}index.php?m=mod_b2b&a=Home">直销商管理系统</a> >> 销售记录 >> 进货记录查询</span></div>
	
	<div id="hearder"><span>下级客户消费记录</span></div>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<form name="history" method="get" action="index.php">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table1">
		<tr>
		<td width="22%" height="30" class="tableleft1">下属客户：</td>
		<td width="78%" class="tableright1">
			<input type="hidden" name="aid" value="{$vd['underling']['aid']}" />
			<input type="hidden" name="m" value="mod_agent" />
			<input type="hidden" name="c" value="order" />
			<input type="hidden" name="a" value="underling" />
			{$vd['underling']['company']}({#DisplayCode($vd['underling']['aid'])})
		</td>
		</tr>
		<tr>
		<td width="22%" height="30" class="tableleft1">商品类型：</td>
		<td width="78%" class="tableright1">
			<select name="ptype">
      	<option value="-1">全部类型</option>
        <option value="km">虚拟卡密</option>
        <option value="cz">自动充值</option>
        <option value="cz">手动充值</option>
      </select>
		</td>
		</tr>
		<tr>
		<td class="tableleft1">订单状态：</td>
		<td class="tableright1">
			<select name="ordstate">
      	<option value="2" >成功订单</option>
        <option value="-1">失败订单</option>
        <option value="1" >处理中订单</option>
        <option value="" selected>所有</option>
      </select>
		</td>
		</tr>
		<tr>
		<td height="35" class="tableleft1">查询时间段：</td>
		<td class="tableright1">
    <input type="text" name="startdate" size="18" value="{$vd['startdate']}" style="vertical-align:middle;" id="startdate"/>
    <strong>至</strong>&nbsp;<input type="text" name="enddate" size="18" value="{$vd['enddate']}" style="vertical-align:middle;" id="enddate"/>
    </td>
		</tr>
		<tr>
		<td height="30" class="tableleft1">&nbsp;</td>
		<td class="tableright1">
			<input type="submit" name="Submit" value="确认查询" class="button"> <input type="reset" name="reset" value="重置查询" class="button"></td>
		</tr>
		</table>
		</form>
	</td>
	</tr>
	</table>
	<br>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
		<tr>
		<td width="16%" class="heardertop1">购买时间</td>
		<td width="32%" class="heardertop1">购买商品</td>
		<td width="8%" class="heardertop1">商品类型</td>
		<td width="8%" class="heardertop1">数量</td>
		<td width="8%" class="heardertop1">购价</td>
		<td width="8%" class="heardertop1">金额</td>
		<td width="8%" class="heardertop1">状态</td>
		<td width="12%" class="heardertop1">订单号</td>
		</tr>
		
		<!--$cprice_sum = 0;$dollars_sum = 0;$qty_sum = 0;$profit_sum = 0;foreach($vd['items'] as $item) {-->
		<tr class="stline" onmouseover="this.className='nd'" onmouseout="this.className='stline'">
		<td>{$item['orddate']}</td>
		<td align=left>{$item['pname']}</td>
		<td><font color=#FF0000>{#ProductType($item['ptype'])}</font></td>
		<td><strong>{$item['qty']}</strong>个</td>
		<td><!--if($vd['canseeprice']){-->{$item['cprice']}<!--}else{-->--<!--}--></td>
		<td><!--if($vd['canseeprice']){-->{$item['dollars']}<!--}else{-->--<!--}--></td>
		<td><span class="eff">{#OrderState($item['ordstate'],$item['ptype'])}</span></td>
		<td>{$item['ordno']}</td>
		</tr>
		<!--$cprice_sum=$cprice_sum+$item['cprice']*$item['qty'];$dollars_sum=$dollars_sum+$item['dollars'];$qty_sum=$qty_sum+$item['qty'];$profit_sum=$profit_sum+$item['staffprofit'];}-->
		
		<tr class="thr"><td colspan=3>本页合计：</td><td>{$qty_sum}</td><td>&nbsp;</td><td><!--if($vd['canseeprice']){echo round($dollars_sum,3);}else{-->--<!--}--></td><td colspan=3>&nbsp;</td></tr>
		<tr class="thr"><td colspan=3>查询合计：</td><td>{$vd['tradedata']['qty_sum']}&nbsp;</td><td>&nbsp;</td><td><!--if($vd['canseeprice']){echo round($vd['tradedata']['dollars_sum'],3);}else{-->--<!--}-->&nbsp;</td><td colspan=3>&nbsp;</td></tr>
		
		</table>
	</td>
	</tr>
	</table>
	<div id="page" align="right">
		{load(fpage)}
	</div>
	
</body>
</html>
