{load(fhead)}
<body class="mainbg">
	<bgsound id="snd" loop="2" src="">
	<div id="mainhearder"><span>您的位置：<a href="{$vd['root']}index.php?m=mod_b2b&c=Dealer&a=home">经销商管理系统</a> >> 自有商品管理 >> 手工商品代充</span></div>
	<!--$ptype=request('ptype');$ordstate=request('ordstate');-->
	<div id="tabs5">
		<ul class="menu5" id="menu5">
    <li onclick="window.location.href='index.php?m=mod_agent&c=AOrder&a=CzOrder&ptype=sd&ordstate=1&by=1'"<!--if($ordstate==1){--> class="hover"<!--}-->><span class="yuan">未代充</span></li>
    <li onclick="window.location.href='index.php?m=mod_agent&c=AOrder&a=CzOrder&ptype=sd&ordstate=3&by=1'"<!--if($ordstate==3){--> class="hover"<!--}-->><span class="yuan">未充值</span></li>
    <li onclick="window.location.href='index.php?m=mod_agent&c=AOrder&a=CzOrderList&ptype=sd'"><span class="yuan">所有记录</span></li>
    </ul>
	</div>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
	<form name="query" method="get" action="index.php" id="advsearch">
  <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">
        <select name="ptype" >
          <option value="sd" >充值商品</option>
        </select>
      </td>
    </tr>
    <tr id="stypetr" style="<!--if($ptype !='km' && $ptype !='sd'){-->display:none<!--}-->">
      <td width="22%" height="30" class="tableleft1"><span id="stypelabel"><!--if($ptype=='sd'){-->充值帐号：<!--}else if($ptype=='km'){-->卡号密码<!--}--></span></td>
      <td width="78%" class="tableright1"><input type="hidden" id="stype" name="stype" value="<!--if($ptype=='sd'){-->czaccount<!--}else if($ptype=='km'){-->cardnumber<!--}else{-->pname<!--}-->"><input type="text" size="22" name="keywords"   class="input" id="tkeywords" value="{$vd['kw']}"><span id="stypetip"><!--if($ptype=='km'){-->&nbsp;格式：卡号|密码<!--}--></span></td>
    </tr>
    <tr>
      <td width="22%" height="30" class="tableleft1">
        订单类型：
      </td>
      <td width="78%" class="tableright1">
        <select name="ordstate">
          <option value="{$ordstate}"><!--if($ordstate==1){-->未代充订单<!--}else{-->未充值订单<!--}--></option>
        </select>
      </td>
    </tr>
    <tr>
      <td width="22%" height="30" class="tableleft1">
        时间段：
      </td>
      <td width="78%" class="tableright1">
      <input type="text" name="startdate" size="18" value="{$vd['startdate']}" style="vertical-align:middle;" id="startdate" class="input"/>
      <b>到 -></b>
      <input type="text" name="enddate" size="18" value="{$vd['enddate']}" style="vertical-align:middle;" id="enddate" class="input"/>
      </td>
    </tr>
    <tr>
      <td width="22%" height="30" class="tableleft1">&nbsp;
      </td>
      <td width="78%" class="tableright1">
        <input type="hidden" name="m" value="mod_agent" />
        <input type="hidden" name="c" value="AOrder" />
        <input type="hidden" name="a" value="CzOrder" />
        <input type="hidden" id="export" name="export" value="0"/>
        <input type="submit" value="马上查询 &gt;&gt;" class="button" onclick="setAct(0)"/>
        <input type="submit" value="导出Excel &gt;&gt;" class="button" onclick="setAct(1)"/>
        <input type="submit" value="导出Csv &gt;&gt;" class="button" onclick="setAct(2)"/>
      </td>
    </tr>
  </table>
  </form>
  </td>
	</tr>
	</table>
	<br>
	<div style="float:left;padding-left:10px"><input type="checkbox" name="hasorderalert" id="hasorderalert" onclick="OAlert(this)" /> <b>新订单提醒</b></div>
  <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="10%" class="heardertop1">销售时间</td>
    <td width="22%"  class="heardertop1" style="text-align:left;padding-left:3px">商品名称</td>
    <td width="6%" 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="10%" class="heardertop1">购买客户</td>
    <td width="6%" class="heardertop1">代充</td>
    </tr>
    <!--$dollars_sum = 0;$moneyfee_sum = 0;$qty_sum = 0;$agentprofit_sum = 0;$ownermoney_sum = 0;foreach($vd['items'] as $item) {-->
    <tr class="stline" onmouseover="this.className='nd'" onmouseout="this.className='stline'">
    <td>{$item['orddate']}</td>
    <td style="text-align:left;padding-left:3px">{$item['pname']}</td>
    <td>{$item['qty']}个</td>
    <td>{$item['czaccount']}</td>
    <td>&nbsp;<!--if($item['namehide']=='czarea1'){-->密码：<!--}-->{#CzText($item['czarea1'])}</td>
    <td>{#CzText($item['czarea2'])}&nbsp;</td>
    <td>{#CzText($item['cztype'])}&nbsp;</td>
    <td>{#CzText($item['czother'])}&nbsp;</td>
    <td >{$item['company']}({#DisplayCode($item['cid'])})</td>
    <td>
    	<!--if($item['ordstate'] == 1){-->
    	<input type="button" name="detail" class="buttonadd" value="代充" onclick="javascript:location.href='index.php?m=mod_agent&c=AOrder&a=cetail&ordno={$item['ordno']}&isc=1';">
    	<!--}else{-->
    	<input type="button" name="detail" class="buttonnor" value="充值" onclick="javascript:location.href='index.php?m=mod_agent&c=AOrder&a=detail&ordno={$item['ordno']}&isc=3';">
      <!--}-->
    </td>
    </tr>
    <!--$dollars_sum=$dollars_sum+$item['dollars'];$moneyfee_sum=$moneyfee_sum+$item['moneyfee'];$qty_sum=$qty_sum+$item['qty'];$agentprofit_sum=$agentprofit_sum+$item['agentprofit'];$ownermoney_sum=$ownermoney_sum+$item['ownermoney']; }-->
    <tr class=thr><td align=center>本页合计：</td><td colspan=1>&nbsp;</td><td align=center>{$qty_sum}</td><td colspan=8>&nbsp;</td></tr><tr class=thr><td align=center>查询总计：</td><td colspan=1>&nbsp;</td><td align=center>{$vd['tradedata']['qty_sum']}</td><td colspan=8>&nbsp;</td></tr>
  </table>
  </td>
	</tr>
	</table>
  <div id="page">
		{load(fpage)}
	</div>
</body>
</html>

<script type="text/javascript">
function openScript(url,name,width,height)
{
    var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no');
}

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 setk(obj)
{
  v = obj.options[obj.selectedIndex].value;
  $("tkeywords").value = "";
  if(v == "")
  {
    $("stypetr").style.display = "none";
    $("stype").value = "pname";
  }
  else if(v == "km")
  {
    $("stypetr").style.display = "";
    $("stype").value = "cardnumber";
    $("stypelabel").innerHTML = "卡号密码：";
    $("stypetip").innerHTML = "&nbsp;格式：卡号|密码";
  }
  else if(v == "cz")
  {
    $("stypetr").style.display = "";
    $("stype").value = "czaccount";
    $("stypelabel").innerHTML = "充值帐号：";
    $("stypetip").innerHTML = "";
  }
}
var alertorder;
function OAlert(obj)
{
	if(obj.checked)
	{
		setCookie('ordersalert', 1, 1);
    alertorder = setInterval(ReloadHtml, 30000);
	}
  else
	{
		setCookie('ordersalert', 0, 0);
		clearInterval(alertorder);
	}
}

function ReloadHtml()
{
	window.location.reload();
}

if(getCookie("ordersalert")=="1")
{
	$("hasorderalert").checked = true;
	OAlert($("hasorderalert"));
	<!--if(count($vd['items']) > 0){-->
		playSound("{$vd['sc']}upload/ring.wav");
	<!--}-->	
}

function playSound(src) { 
    var _s = $("snd"); 
    if(src!='' && typeof src!=undefined) { 
      _s.src = src; 
    } 
  } 
  
function setAct(v)
{
	$("export").value = v;
	if(v > 0)
	{
	  $("advsearch").submit();
	}
}


</script>