<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<link rel="stylesheet" type="text/css" href="<?php echo $vd['sc']; ?>css/main.css"/>
<style type="text/css">
  #ctable1 td{text-align:center}
</style>
</head>
<body>
<div id="titleDiv">
<div style="float:left"><a href="index.php?a=Home"><img src="<?php echo $vd['sc']; ?>images/home.png" style="vertical-align:middle" border="0"/></a></div><div style="float:left;padding-top:8px;padding-left:3px;"><a href="index.php?a=Home" title="回到后台首页"><font color="#000">桌面</font></a> <span style="font-size:7px;">>></span> 客户常购商品统计</div>
<div style="float:right;"><a href="index.php?m=mod_home&a=Help&t=admin_b2b_ps_index" onFocus="this.blur()" title="常够商品帮助"><img src="<?php echo $vd['sc']; ?>images/help.gif" style="vertical-align:middle" border="0"/></a></div>
</div>
<div id="content" class="cwarpper">
<div class="cbodyHead"></div>
<div class="cwarpper1">
<div class="ctitle">
  常够商品统计
</div>
<div>
	<form action="index.php?m=mod_b2b&c=Order&a=Often" method="post" style="margin:0px 0px 0px 0px;" onsubmit="return searchSubmit()">
  <table border="1" id="ctable1" class="ctable" bordercolor="#86B9D6">
  <tr>
    <td class="tablelt">商品名称</td>
    <td class="tablert" style="text-align:left">
    	<input type="text" name="pname" size="25" value="<?php echo request('pname'); ?>" style="vertical-align:middle;"  /> <font color="#cccccc">空表示统计所有商品</font>
    </td>
  </tr>
  <tr>
    <td class="tablelt">客户名称</td>
    <td class="tablert" style="text-align:left">
    	<input type="text" name="aname" size="25" value="<?php echo request('aname'); ?>" style="vertical-align:middle;"  /> <font color="#cccccc">空表示统计所有商品</font>
    </td>
  </tr>
  <tr>
    <td class="tablelt">关键词</td>
    <td class="tablert" style="text-align:left">
    	<input type="text" name="keywords" size="25" value="<?php echo $vd['keywords']; ?>" style="vertical-align:middle;" class="custsearch"  />
      <select name="stype" style="vertical-align:middle;font-size:14px;">
        <?php (Option($vd['sarray'], $vd['stype'])); ?>
      </select>
    </td>
  </tr>
  <tr>
    <td class="tablelt">订单状态</td>
    <td class="tablert" style="text-align:left">
    <select name="state" style="vertical-align:middle;font-size:14px;">
      <?php (Option($vd['oarray'], $vd['otype'])); ?>
    </select>
    </td>
  </tr>
  <tr>
    <td class="tablelt">时间段</td>
    <td class="tablert" style="text-align:left">
    <input type="text" name="startdate" size="18" value="<?php echo $vd['startdate']; ?>" style="vertical-align:middle;" id="startdate" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" />
    <img src="<?php echo $vd['sc']; ?>images/calender.gif" onclick="dateDialog('startdate')" style="vertical-align:middle;cursor:pointer;margin-left:0px;"/>
    到 <input type="text" name="enddate" size="18" value="<?php echo $vd['enddate']; ?>" style="vertical-align:middle;"  id="enddate" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" />
    <img src="<?php echo $vd['sc']; ?>images/calender.gif" onclick="dateDialog('enddate')" style="vertical-align:middle;cursor:pointer;margin-left:0px;"/>
    </td>
  </tr>
  <tr>
    <td class="tablelt"></td>
    <td class="tablert" style="text-align:left;height:50px">
    <input type="submit" value="搜索 &gt;&gt;" style="vertical-align:middle;" class="button"/>
    </td>
  </tr>
  </table>  
  
  </form>
</div>
<div>
<table border="1" id="ctable1" class="ctable" bordercolor="#86B9D6">
  <tr class="listhead">
    <td width="32%" height="35" style="padding-left:3px;text-align:left">商品名称</td>
    <td width="8%">购买次数</td>
    <td width="8%">总数量</td>
    <td width="8%">总金额</td>
    <td width="8%">面值</td>
    <td width="8%">进货价</td>
    <td width="8%">库存状态</td>
    <td width="5%"><img src="<?php echo $vd['sc']; ?>images/icon_edit.gif"/></td>
    <td width="8%">进货</td>
  </tr>
  <?php $t_count=0;$t_qty=0;$t_dollars=0;foreach($vd['items'] as $item) { ?>
  <tr>
    <td height="35" style="padding-left:3px;text-align:left"><?php echo $item['pname']; ?></td>
    <td><?php echo $item['count']; ?> 次</td>
    <td><?php echo $item['sumqty']; ?></td>
    <td><?php echo $item['sumdollar']; ?></td>
    <td><?php echo $item['listprice']; ?></td>
    <td><?php echo $item['price']; ?></td>
    <td><?php echo $item['stocks']; ?></td>
    <td>
      <a href="index.php?m=mod_b2b&c=PS&a=detail&ubzpid=<?php echo $item['pid']; ?>" title="编辑商品" onclick="loadDisp(1)"><img src="<?php echo $vd['sc']; ?>images/icon_edit.gif"/></a>
    </td>
    <td>
      <a href="?m=mod_b2b&c=sup&a=sup&ubzpid=<?php echo $item['pid']; ?>">
      <font color="#00875A">管理</font>
      </a> 
    </td>
  </tr>
  <?php $t_count+=$item['count'];$t_qty+=$item['sumqty'];$t_dollars+=$item['sumdollar'];} ?>
  <tr>
  	<td height="35">查询统计</td>
    <td><b><?php echo $t_count; ?></b> 次</td>
    <td><b><?php echo $t_qty; ?></b></td>
    <td><b><?php echo $t_dollars; ?></b></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
</table>
</div>
</div>
<div class="cbodyFoot"></div>
</div>
<div id="opcontent" style="display:none">
  <div class="optxt">
  </div>
</div>
<script type="text/javascript">
  sc = "<?php echo $vd['sc']; ?>";
  var ctablenum = 2;
</script>
<script src="<?php echo $vd['sc']; ?>js/content.js" type="text/javascript"></script>
</body>
</html>
