<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx2<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE3 {color: #000000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 订单管理 &gt;&gt; 非会员统计报表</font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="STYLE1">* 为必添项目</span></td>
      </tr>
      <tr>
        <td height="20" colspan="2" style="font-size:12px;color:#ffffff"><span class="STYLE3">&nbsp;操作说明：请选择相应状态进行查询！</span><br />
              </span></td>
      </tr>
    </table></td>
  </tr>
</table>
<br>
<br>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <form name="form1" method="post" action="tjbb_fhy_result.asp" onSubmit="return Judge();">
    <tr bgcolor="#F3F3F3">
      <td width="310"><div align="center">报表类型：</div></td>
      <td>
        <select name="reporttype" class="wenbenkuang">
          <option value="销售报表" selected>销售报表</option>
          <option value="库存报表" >库存报表</option>
        </select>
      </td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td><div align="center">统计类型：</div></td>
      <td>
        <select name="totaltype" class="wenbenkuang" onChange="ChangeRepotyType();">
          <option value="1" selected>普通统计</option>
          <option value="2" >日报</option>
          <option value="3" >月报</option>
          <option value="4" >年报</option>
        </select>
      </td>
    </tr>
    <tr bgcolor="#F3F3F3" id="starttime">
      <td><div align="center"><span id="starttitle">开始日期</span>：</div></td>
      <td>
        <select name="year1" class="wenbenkuang">
          <%for i=2008 to 2100%>
          <option value="<%=i%>"  <%if year(now())=i then%>selected<%end if%>><%=i%></option>
          <%next%>
        </select>
        年 <span id="startmonth">
        <select name="month1" class="wenbenkuang">
          <%for i=1 to 12%>
          <option value="<%=i%>"  <%if year(date())=i then %>selected<% end if %>><%=i%></option>
          <%next%>
        </select>
        月 </span> <span id="startday">
        <select name="day1" class="wenbenkuang">
          <%for i=1 to 31%>
          <option value="<%=i%>"  ><%=i%></option>
          <%next%>
        </select>
        日 </span> </td>
    </tr>
    <tr bgcolor="#F3F3F3" id="endtime">
      <td><div align="center"><span id="endtitle">结束日期</span>：</div></td>
      <td width="554">
        <select name="year2" class="wenbenkuang">
          <%for i=2008 to 2100%>
          <option value="<%=i%>" ><%=i%> </option>
          <%next%>
        </select>
        年 <span id="endmonth">
        <select name="month2" class="wenbenkuang">
          <%
										for i=1 to 12%>
          <option value="<%=i%>"  <%if month(date())=i then %>selected<% end if %>><%=i%> </option>
          <%next%>
        </select>
        月 </span> <span id="endday">
        <select name="day2" class="wenbenkuang">
          <%for i=1 to 31%>
          <option value="<%=i%>"  <%if day(date())=i then%>selected<%end if%>><%=i%> </option>
          <%next%>
        </select>
        日 </span></td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td><div align="center">统计分类：</div></td>
      <td>
        <%
set rs=server.createobject("adodb.recordset")
sql="select anclassid,anclass from shop_anclass "
rs.open sql,conn,1,1
%>
        <select name="totalanclass" class="wenbenkuang" onChange="ChangeNclass();">
          <option value="0" selected>------全部------</option>
          <%
while not rs.eof
%>
          <option value="<%=rs(0)%>" ><%=rs(1)%></option>
          <%
    rs.movenext
wend
sql="select nclassid,nclass,anclassid from shop_nclass order by anclassid"
if rs.state=1 then rs.close
rs.open sql,conn,1,1
nclassgroup=""
while not rs.eof
    nclassgroup=nclassgroup&"$"&rs(0)&"$|"&rs(1)&"|*"&rs(2)&"*"
    rs.movenext
wend
%>
        </select>
        <select name="totalnclass" class="wenbenkuang" onChange="GetText();">
          <option value="0" selected>------全部------</option>
        </select>
      </td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td><div align="center">显示记录数：</div></td>
      <td width="554">
        <input name="recordcount" size=10 type="input" value="1000"></td>
    </tr>
    <input type="hidden" name="anclass" value="">
    <input type="hidden" name="nclass" value="">
    <tr bgcolor="#F3F3F3">
      <td height="22" colspan="2">
        <div align="center">
          <input type="submit" class="go-wenbenkuang" name="Submit" value="统 计">
      </div></td>
    </tr>
  </form>
</table>
<br>
<!--#include file="copyright.asp"-->
</body>
</html>
<script>
function Judge(){
    var tmpValue=form1.recordcount.value;
	if (tmpValue=="")
	{
	    alert("请输入记录数！");
		return false;
	}
	if (isNaN(tmpValue))
	{
	    alert("请输入整数！");
		return false;
	}
}

function ChangeRepotyType(){
    var tmpValue=form1.totaltype.value;
	if (tmpValue=="1")
	{
	    document.all.starttitle.innerHTML="开始日期";
		document.all.endtitle.innerHTML="结束日期";
	    document.all.starttime.style.display='';
		document.all.startmonth.style.display='';
		document.all.startday.style.display='';
	    document.all.endtime.style.display='';
		document.all.endmonth.style.display='';
		document.all.endday.style.display='';

	}else if (tmpValue=="2")
	{
	    document.all.starttime.style.display='none';
		document.all.startmonth.style.display='none';
		document.all.startday.style.display='none';
		document.all.endtitle.innerHTML="统计日期";
	    document.all.endtime.style.display='';
		document.all.endmonth.style.display='';
		document.all.endday.style.display='';
	}else if (tmpValue=="3")
	{
	    document.all.starttime.style.display='none';
		document.all.startmonth.style.display='none';
		document.all.startday.style.display='none';
		document.all.endtitle.innerHTML="统计月份";
	    document.all.endtime.style.display='';
		document.all.endmonth.style.display='';
		document.all.endday.style.display='none';
	}else if (tmpValue=="4")
	{
	    document.all.starttime.style.display='none';
		document.all.startmonth.style.display='none';
		document.all.startday.style.display='none';
		document.all.endtitle.innerHTML="统计年份";
	    document.all.endtime.style.display='';
		document.all.endmonth.style.display='none';
		document.all.endday.style.display='none';
	}
}

function ChangeNclass(){
    var tmpValue=form1.totalanclass.value;  
	form1.anclass.value=form1.totalanclass.options[form1.totalanclass.selectedIndex].text;
	if (tmpValue=="0")
	{
	    form1.totalnclass.length=0;   
		form1.totalnclass[0]=new Option("------全部------","0");
	}else{
	    form1.totalnclass.length=0;   
		form1.totalnclass[0]=new Option("------全部------","0");
	    var tmpgroup="<%=nclassgroup%>";
		var i=1;
		while (tmpgroup.indexOf("*"+tmpValue+"*")>=0)
		{
		    tmpStr =tmpgroup.substring(0,tmpgroup.indexOf("*"+tmpValue+"*") );    
			while (tmpStr.indexOf("*")>=0)
			{
			    tmpStr=tmpStr.substring(tmpStr.indexOf("*")+1,tmpStr.length );
			}
			tmpStr =tmpStr.substring(1,tmpStr.length);
			curvalue=tmpStr.substring(0,tmpStr.indexOf("$") );   
			tmpStr=tmpStr.substring(tmpStr.indexOf("$")+1,tmpStr.length );
			tmpStr =tmpStr.substring(1,tmpStr.length);
			curname=tmpStr.substring(0,tmpStr.indexOf("|") );   
			form1.totalnclass[i]=new Option(curname,curvalue);
            i++;
            tmpgroup=tmpgroup.substring(tmpgroup.indexOf("*"+tmpValue+"*")+("*"+tmpValue+"*").length,tmpgroup.length );
		}
	}
}

function GetText(){
    form1.nclass.value=form1.totalnclass.options[form1.totalnclass.selectedIndex].text;
}
</script>