⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 count_back.asp

📁 不错的进销存管理系统。功能比较全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
if session("yida_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%  
  response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->

<html>
<head>
<title><%=dianming%> - 顾客退货统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
	background-color:#FFFFFF;
}
</style>
<script language="javascript">
function collapse(img, objName)
{
	var obj;
	obj = document.getElementById(objName);
	if (img.src.indexOf('open') != -1)
	{
		img.src = img.src.replace('open', 'close');
		obj.style.display = 'none';
	}
	else
	{
		img.src = img.src.replace('close', 'open');
		obj.style.display = '';
	}
}

function collapseall(img)
{
	var obj;
	if (img.src.indexOf('open') != -1)
	{
		img.src = img.src.replace('open', 'close');
		for (x=1;x<=<%=maxrecord%>;x++)
		{
			obj = document.getElementById("buy"+x);
			if (obj)
			{
				obj.style.display = 'none';
			}
		}
	}
	else
	{
		img.src = img.src.replace('close', 'open');
		for (x=1;x<=<%=maxrecord%>;x++)
		{
			obj = document.getElementById("buy"+x);
			if (obj)
			{
				obj.style.display = '';
			}
		}		
	}
}
</script>

<script language=javascript>
function preview() { 
bdhtml=window.document.body.innerHTML; 
sprnstr="<!--startprint-->"; 
eprnstr="<!--endprint-->"; 
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
window.document.body.innerHTML=prnhtml; 
window.print(); 
window.document.body.innerHTML=bdhtml; 
         }
</script>
</HEAD>

<BODY>
<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
<%
if fla32="0" and session("shiwei_id")<>"1" then
%>
<br><center><img src="../images/note.gif" align="absmiddle">&nbsp;<font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%  
  response.end
end if

'取得当前页码
currentpage=request("page")
'response.write currentpage
'response.end
if currentpage<1 or currentpage="" then
  currentpage="1"
end if

'取得搜索关键字  
nowstartdate=request("startdate") 
if nowstartdate="" then
  nowstartdate=date()-day(date()-1)
end if
nowenddate=request("enddate") 
if nowenddate="" then
  nowenddate=date()
end if
nowku=request("ku")
nowkeyword=request("keyword")

	if session("shiwei_id")="1" or fla88="1" then
	  sql="select * from ku order by id"
	  set rs_ku=conn.execute(sql)
	else
	  sql="select * from ku where instr(login,'"&session("shiwei_id")&",')>0 order by id"
	  set rs_ku=conn.execute(sql)
	  if rs_ku.eof then
	    nowku="0"
	  elseif request("ku")="" then
	    nowku=rs_ku("id")
	  end if	  
	end if

  sql="select * from buy where type=1 and zu and isok"
  if session("shiwei_id")<>1 and lookbuysell="yes" and fla89="0" then
    sql=sql&" and id_login="&session("shiwei_id")
  end if
  if nowstartdate<>"" then
    sql=sql&" and selldate-#"&nowstartdate&"#>=0"
  end if  
  if nowenddate<>"" then
    sql=sql&" and selldate-#"&nowenddate&"#<=0"
  end if
  if nowku<>"" then
	sql=sql&" and bianhao in (select bianhao from buy where type=1 and id_ku="&nowku&" and zu=false)"
  end if  
  if nowkeyword<>"" then
    sql=sql&" and (bianhao = '"&nowkeyword&"' or id_huiyuan in (select id from huiyuan where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or bianhao in (select bianhao from buy where type=1 and (title like '%"&nowkeyword&"%' or huohao like '%"&nowkeyword&"%')))"
  end if

  if request("order1")<>"" then
    sql=sql&" order by bianhao "&request("order1")
  elseif request("order2")<>"" then
    sql=sql&" order by huohao "&request("order2")
  elseif request("order3")<>"" then
    sql=sql&" order by title "&request("order3") 
  elseif request("order4")<>"" then
    sql=sql&" order by selldate "&request("order4") 
  elseif request("order5")<>"" then
    sql=sql&" order by id_login "&request("order5") 
  elseif request("order6")<>"" then
    sql=sql&" order by id_ku "&request("order6")
  elseif request("order7")<>"" then
    sql=sql&" order by shulian "&request("order7")
  elseif request("order8")<>"" then
    sql=sql&" order by price "&request("order8")
  elseif request("order9")<>"" then
    sql=sql&" order by price "&request("order9")
  elseif request("order10")<>"" then
    sql=sql&" order by id_huiyuan "&request("order10")		        
  else
    sql=sql&" order by selldate desc"  
  end if 
  
set count_buy = server.createobject("ADODB.RecordSet")	
count_buy.open sql,conn,1,3
nowprice=0
zongshulian=0
do while count_buy.eof=false
	  sql3="select sum(price*shulian),sum(shulian) from buy where bianhao='"&count_buy("bianhao")&"' and zu=false"
	  if nowku<>"" then
	    sql3=sql3&" and id_ku="&nowku
	  end if
	  if nowkeyword<>"" then
		sql3=sql3&" and (bianhao = '"&nowkeyword&"' or id_huiyuan in (select id from huiyuan where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or huohao like '%"&nowkeyword&"%')"
  	  end if
	  set rs_sum=conn.execute(sql3)  
  nowprice=nowprice+rs_sum(0)
  zongshulian=zongshulian+rs_sum(1)	
  count_buy.movenext
loop  
%>
<table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">
<form name="form2">
  <tr> 
    <td width="5%" height="21">&nbsp;<img src="../images/print.jpg" align="absmiddle" style="cursor:hand;" onClick="preview();window.close()"></td>
	<td width="95%" align="right">
	  开始日期:
      <input name="startdate" value="<%=nowstartdate%>" readonly style="width:100px">
	  <img src="../images/date.gif" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:window.open('day.asp?form=form2&field=startdate&oldDate='+startdate.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=150,left=590');">
	  结束日期:
      <input name="enddate" value="<%=nowenddate%>" readonly style="width:100px">
	  <img src="../images/date.gif" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:window.open('day.asp?form=form2&field=enddate&oldDate='+enddate.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=150,left=740');">
	  <select name="ku" onChange="form2.submit()">
	<%if session("shiwei_id")="1" or fla88="1" then%> 
        <option value="">所有仓库</option>
	<%elseif rs_ku.eof then%>
	    <option value="0">没有你管理的仓库</option>	
	<%end if%>
    <%
	do while rs_ku.eof=false
	%>
        <option value="<%=rs_ku("id")%>"<%if trim(cstr(rs_ku("id")))=nowku then%> selected="selected"<%end if%>><%=rs_ku("ku")%></option>
        <%
	  rs_ku.movenext
	loop
	%>
      </select>	  
	  <input type="text" name="keyword" size="20" value="<%=nowkeyword%>">
	  <input type="hidden" name="hid" value="ok">
	  <input type="submit" value=" 查询 " class="button">&nbsp;
	</td>
  </tr>
</form>  
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -