?? checkcgindex.asp
字號:
<!--#include file="../conn/conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
if request.QueryString("type")="all" then
sql="select * from tab_cgdan"
else
flag=request.Form("flag")
i=0
if flag<>"" then
if instr(flag,"1")>0 then
sel=request.Form("sel")
tj=request.Form("tj")
qname=request.Form("qname")
i=1
flag_deal="inIF"
end if
if instr(flag,"2")>0 then
sdate=request.Form("sdate")
edate=request.Form("edate")
i=i+1
flag_deal="inDate"
end if
if i>1 then
flag_deal="double"
end if
session("flag")=flag_deal
session("sel")=sel
session("tj")=tj
session("qname")=qname
session("sdate")=sdate
session("edate")=edate
end if
'查詢條件判斷
select case session("flag")
case "inIF"
if session("tj")="=" then
sql="select * from tab_cgdan where "&session("sel")&" = '"&session("qname")&"' "
else
sql="select * from tab_cgdan where "&session("sel")&" like '%"&session("qname")&"%'"
end if
case "inDate"
sql="select * from tab_cgdan where cgdate between '"&session("sdate")&"' and '"&session("edate")&" 23:59:59'"
case "double"
if session("tj")="=" then
sql="select * from tab_cgdan where "&session("sel")&" = '"&session("qname")&"' and cgdate between '"&session("sdate")&"' and '"&session("edate")&" 23:59:59'"
else
sql="select * from tab_cgdan where "&session("sel")&" like '%"&session("qname")&"%' and cgdate between '"&session("sdate")&"' and '"&session("edate")&" 23:59:59'"
end if
case else
response.Redirect("cgindex.asp")
end select
end if
rs.open sql,conn,1,1
if rs.eof then%>
<script language="JavaScript">
alert("沒有找到您要查詢的記錄!")
history.back(1)
</script>
<%response.End()
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>無標題文檔</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
'分頁
rs.pagesize=3
page=clng(request("page"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
show rs,page
'分頁子程序
sub show(rs,page)
rs.absolutepage=page
for i=1 to rs.pagesize%>
<table width="97%" height="82" border=1 align="center" cellpadding=-1 cellspacing=0 bordercolor="#ffffff"
bordercolorlight="#9CA6C6" bordercolordark="#ffffff">
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF"><font color="#336699">采購單號:<%=rs("id")%></font></td>
<td width="186" bgcolor="#D9ECFF"><font color="#336699">商品名稱: <%=rs("spname")%> </font></td>
<td bgcolor="#D9ECFF" width="231"><font color="#336699">廠商: <%=rs("cs")%> </font></td>
</tr>
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF" height="19"><font color="#336699">規格: <%=rs("gg")%> </font></td>
<td width="186" bgcolor="#D9ECFF" height="19"><font color="#336699">包裝: <%=rs("bz")%> </font></td>
<td bgcolor="#D9ECFF" width="231" height="19"><font color="#336699">單位: <%=rs("dw")%> </font></td>
</tr>
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF"><font color="#336699">單價: <%=rs("dj")%> </font></td>
<td width="186" bgcolor="#D9ECFF"><font color="#336699">數量: <%=rs("sl")%> </font></td>
<td bgcolor="#D9ECFF" width="231"><font color="#336699">金額: <%=rs("je")%> </font></td>
</tr>
<tr bgcolor="#dddddd">
<td width="165" bgcolor="#D9ECFF"><font color="#336699">采購日期: <%=rs("cgdate")%> </font></td>
<td colspan="2" bgcolor="#D9ECFF"><font color="#336699">備注: <%=rs("memo")%> </font></td>
</tr>
</table>
<p>
<%rs.movenext
if rs.eof then exit for
next
end sub%>
<form action="checkcgindex.asp?type=<%=request.QueryString("type")%>" method="post">
<div align="center">
<% if page<>1 then%>
<font size="2"> <a href=<%=path%>?page=1&type=<%=request.QueryString("type")%>>第一頁</a> </font><a href=<%=path%>?page=<%=(page-1)%>&type=<%=request.QueryString("type")%> >上一頁</a>
<%end if
if page<>rs.pagecount then%>
<a href=<%=path%>?page=<%=(page+1)%>&type=<%=request.QueryString("type")%>>下一頁</a> <a href=<%=path%>?page=<%=rs.pagecount%>&type=<%=request.QueryString("type")%>>最后一頁</a>
<%end if%>
<font color="#336699">輸入頁次
<input type="text" name="page" size="3">
頁次 </font><font color=red><%=page%>/<%=rs.pagecount%></font> [ <a href="cgindex.asp">返回</a> ] <br>
</form>
<p> </p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -