{load(head)}
<div class="ubLeftSide">
{load(left)}
</div>
<div class="ubtwoRight" id="ubtwoRight">
	<div id="TopSearch">
  	<div id="search">
  		<ul class="search_left"></ul>
  		<form id="searchform" name="searchform" method="post" action="index.php?m=mod_agent&c=order&a=staffprofit&{$vd['op']}">
    	<ul class="search_mid">
    	    <li class="search_slong">
    		  <p class="search_s1long">
    		    <select name="tradetype" id="tradetype" class="search_selectlong">
    			  {#Option($vd['tradetypes'], $vd['tradetype'])}
    		    </select>
    		  </p>
    		  </li>
    		  <li class="search_i1">
    		  <div style="float:left"><input type="text" name="startdate" value="{$vd['startdate']}" class="search_inputdate" id="startdate"/></div>
    		  <div style="float:left"><img src="{$vd['content']}images/calender.gif" onclick="dateDialog('startdate')" height="22" style="margin-top:2px;cursor:pointer;margin-left:0px;"/></div>
          </li>
          <li class="search_t">
    		  <b>到 </b>
    		  </li>
          <li class="search_i1">
    		  <div style="float:left"><input type="text" name="enddate" value="{$vd['enddate']}" class="search_inputdate" id="enddate"/></div>
    		  <div style="float:left"><img src="{$vd['content']}images/calender.gif" onclick="dateDialog('enddate')" height="22" style="margin-top:2px;cursor:pointer;margin-left:0px;"/></div>
          </li>
    		  <li class="search_b">
    		  <input type="image" value="" src="{$vd['content']}images/search.gif"/>
    		  </li>
    	</ul>
    	</form>
  		<ul class="search_right"></ul>
  	</div>
  </div>
  <br/>
  <table id="orderTable" border="1" width="100%" style="border-collapse: collapse;line-height:25px;" bordercolor="#CFDCF2">
    <tr class="tabletitle">
      <td width="10%" align="center" height="35">
        操作员</td>
      <td width="20%" align="center" height="35">
        购买商品</td>
      <td width="10%" align="center" height="35">
        商品类型</td>
      <td width="10%" align="center" height="35">
        单价</td>
      <td width="5%" align="center" height="35">
        数量</td>
      <td width="10%" align="center" height="35">
        总金额</td> 
      <td width="10%" align="center" height="35">
        订单状态</td>
      <td width="12%" align="center" height="35">
        日期</td>
      <td width="10%" align="center" height="35">
        详细</td>
    </tr>
    <!--foreach($vd['items'] as $item) {-->
    <tr class="stline" onmouseover="this.className='nd'" onmouseout="this.className='stline'">
      <td width="10%" align="center" height="35">{#Operator($vd['agent'][7], $item['operator'], $vd['agent'][9], $item['otherside'])}</td>
      <td width="20%" align="center" height="35">{$item['content']}</td>
      <td width="10%" align="center" height="35">{$item['tradetype']}</td>
      <td width="10%" align="center" height="35">{$item['income']}</td>
      <td width="8%" align="center" height="35">{$item['income']}</td>
      <td width="10%" align="center" height="35">{$item['income']}</td> 
      <td width="10%" align="center" height="35">{$item['income']}</td>
      <td width="15%" align="center" height="35">{$item['createdate']}</td>
      <td width="10%" align="center" height="35">
      	<!--if($item['tradetype'] == 1 || $item['tradetype'] == 12){-->
        <a href="javascript:openScript('{#UrlByTradeType($item['tradetype'], $item['ordno'])}','',690,500)">
        <font color="#0000ff">查看</font>
        </a>
        <!--}else{-->
        无
        <!--}-->
      </td>
    </tr>
    <!--}-->
    <tr>
      <td align="right" height="35" colspan="12">
      <form method="post" action="index.php?m=mod_agent&c=order&{$vd['op']}">
        <strong>本记录总计 <font color="#ff0000">{$vd['totlerow']}</font> 条  第 {$vd['thispage']} 页</strong>/ 共 {$vd['totlepage']} 页</strong>
        <input type="button" class="button" value="上一页 &gt;&gt;" {$vd['prestate']} onclick="window.location='?m=mod_agent&c=order&a=index&{$vd['op']}&page={$vd['prepage']}'"/>
        <input type="button" class="button" value="下一页 &gt;&gt;" {$vd['nextstate']} onclick="window.location='?m=mod_agent&c=order&a=index&{$vd['op']}&page={$vd['nextpage']}'"/>
        每页显示<input type="text" id="nrows" name="nrows" size="2" value="{$vd['nrows']}" class="txt"/>个  到第<input type="text" id="page" name="page" size="2" value="" class="txt"/>页<input value="确定" type="submit" class="button"/>
      </form>
      </td>
    </tr>
  </table>
</div>
{load(foot)}
<script type="text/javascript">
function dateDialog(idx)
{
	obj = document.getElementById(idx)
	dv=window.showModalDialog("{$vd['sc']}tools/datedialog.html?date="+obj.value,"44","center:1;help:no;status:no;dialogHeight:240px;dialogWidth:185px;scroll:no")
  if (dv) {if (dv=="null") obj.value='';else obj.value=dv;}
}
function openScript(url,name,width,height)
{
    var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no');
}
</script>
