📄 cgquest.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/sell.asp" -->
<%
MMColParam = ""
if (Request.Form("qvalue") <> "") then MMColParam = Request.Form("qvalue")
varcif = ""
if (Request.Form("cif") <> "") then varcif = Request.Form("cif")
varccif = "ALL"
if (Request.Form("ccif") <> "") then varccif = Request.Form("ccif")
varandor = "and"
if (Request.Form("andor") <> "") then varandor = Request.Form("andor")
varsdate = "2000-01-01"
if (Request.Form("sdate") <> "") then varsdate = Request.Form("sdate")
varedate = date()
if (Request.Form("edate") <> "") then varedate = Request.Form("edate")
set rscginfo = Server.CreateObject("ADODB.Recordset")
if varccif = "LIKE" then
sql = "SELECT * FROM dbo.tab_procure WHERE " + Replace(varcif, "'", "''") +_
" " + Replace(varccif, "'", "''") + " '%" + Replace(MMColParam, "'", "''") + _
"%' " + Replace(varandor, "'", "''") + " cgdate BETWEEN '" +_
Replace(varsdate, "'", "''") + "' AND '" + Replace(varedate, "'", "''") + "'"
else
if varccif = "ALL" then
sql = "SELECT * FROM dbo.tab_procure"
else
sql = "SELECT * FROM dbo.tab_procure WHERE " + Replace(varcif, "'", "''") + _
" " + Replace(varccif, "'", "''") + " '" + Replace(MMColParam, "'", "''") +_
"' " + Replace(varandor, "'", "''") + " cgdate BETWEEN '" +_
Replace(varsdate, "'", "''") + "' AND '" + Replace(varedate, "'", "''") + "'"
end if
end if
rscginfo.open sql,conn,1,3
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
</SCRIPT>
<%
if (Request.Form("hbz")="1") then message
sub message()
if (rscginfo.eof and rscginfo.bof) then
Response.Write "<script language=""" & "javascript""" &_
"> alert(""" & "无符合条件的记录!""" & ") </script>"
end if
end sub
%>
<script language="JavaScript">
function cgcx()
{
form1.hbz.value="1";
form1.submit();
}
</script>
<html>
<head>
<title>网上商品交易系统--商品采购!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="../../images/bg.gif">
<script language="JavaScript">
function listall()
{form1.ccif.value = "ALL";
form1.submit();
}
</script>
<table width="590" border="0" cellspacing="-2" cellpadding="-2" height="311">
<tr>
<td height="40">
<h2 style="filter:glow(color=#ccccff,strength=5);height:1pt"align="center">
<font size="2" color=#000099>
采购信息查询</font></h2>
</td>
</tr>
<tr>
<td valign="top">
<table width="590" border="0" cellspacing="-2" cellpadding="-2" height="247">
<tr>
<td width="20" height="28"> </td>
<td width="570" height="28">
<form name="form1" method="post" action="">
<div align="left">请选择查询条件:
<select name="cif">
<option value="spname" selected>商品名称</option>
<option value="cs">厂商</option>
<option value="cgdate">采购日期</option>
</select>
<select name="ccif">
<option value="=" selected>等于</option>
<option value="LIKE">LIKE</option>
<option value="ALL">ALL</option>
</select>
<input type="text" name="qvalue" size="34">
<select name="andor">
<option value="AND" selected>AND</option>
<option value="OR">OR</option>
</select>
<br>
<br>
请输入查询日期:从
<input type="text" name="sdate" size="16" value="<%=DateAdd("M",-1,date())%>">
至
<input type="text" name="edate" size="16" value="<%=date()%>">
<input type="button" name="Submit" value="查询" onClick="cgcx()">
<input type="button" name="Submit2" value="显示全部数据" onClick="listall()">
<input type="hidden" name="hbz" value="0">
</div>
</form>
</td>
</tr>
<tr>
<td height="78" colspan="2">
<% total=0
While NOT rscginfo.EOF %>
<table width="590" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td> </td>
</tr>
</table>
<table width="590" border=1 bordercolor=#ffffff bordercolordark=#ffffff
bordercolorlight=#0099ff cellpadding=-1 cellspacing=0 height="54" align="center">
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF"><font color="#336699">采购单号:
<%=(rscginfo.Fields.Item("ID").Value)%></font></td>
<td width="186" bgcolor="#D9ECFF"><font color="#336699">商品名称:
<%=(rscginfo.Fields.Item("spname").Value)%></font></td>
<td bgcolor="#D9ECFF" width="231"><font color="#336699">厂商:
<%=(rscginfo.Fields.Item("cs").Value)%></font></td>
</tr>
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF" height="19"><font color="#336699">规格:
<%=(rscginfo.Fields.Item("gg").Value)%></font></td>
<td width="186" bgcolor="#D9ECFF" height="19"><font color="#336699">包装:
<%=(rscginfo.Fields.Item("bz").Value)%></font></td>
<td bgcolor="#D9ECFF" width="231" height="19"><font color="#336699">单位:
<%=(rscginfo.Fields.Item("dw").Value)%></font></td>
</tr>
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF"><font color="#336699">单价:
<%=(rscginfo.Fields.Item("dj").Value)%></font></td>
<td width="186" bgcolor="#D9ECFF"><font color="#336699">数量:
<%=(rscginfo.Fields.Item("sl").Value)%></font></td>
<td bgcolor="#D9ECFF" width="231"><font color="#336699">金额:
<%=(rscginfo.Fields.Item("je").Value)%></font></td>
</tr>
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF"><font color="#336699">采购日期:
<%= DoDateTime((rscginfo.Fields.Item("cgdate").Value), 1, -1) %></font></td>
<td colspan="2" bgcolor="#D9ECFF"><font color="#336699">备注:
<%=(rscginfo.Fields.Item("memo").Value)%></font></td>
</tr>
</table>
<%
total=total+1
rscginfo.MoveNext()
Wend %>
<table width="590" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td width="197"> </td>
<td width="393">
<div align="right">
<% If Not rscginfo.EOF Or Not rscginfo.BOF Then %>
<font color="#00CCFF">共 <%=(total)%> 条记录</font>
<% End If%>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -