📄 purchase.asp
字号:
<!--#include file="../Session.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品管理</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link href="../../css/site.css" rel="stylesheet" type="text/css">
</head>
<%
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages,KeyWord,cpid
KeyWord=request("KeyWord")
cpid=request("cpid")
if request("page")="" or IsNumeric(request("page"))=False then
currentPage = 1
elseif request("page")<=0 then
currentPage = 1
else
currentPage=int(request("page"))
end if
%>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" colspan="4" align="center" class="tdstyle"><strong><font color="#000000" size="3">客户求购商品列表</font></strong></td>
</tr>
<%
if KeyWord<>"" then
sql="select * from [Purchase] where TradeName like '%"&trim(KeyWord)&"%' order by id desc"
elseif cpid<>"" then
sql="select * from [Purchase] where id="&cpid&""
else
sql="select * from [Purchase] order by id desc"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td height=30 colspan=4 align=center class=text>暂无求购商品</td></tr>"
else%>
</table>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="2" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<form name="searchsoft" method="POST" action="Purchase.asp">
<td height="20" colspan="2" align="center" class="tdstyle"> 请输入求购商品名称:
<input class="input1" type="text" name="KeyWord" size="20"> <input class="button" type="submit" value="模糊查询" name="title">
</td>
</form>
<form name="searchsoft" method="POST" action="Purchase.asp">
<td height="20" colspan="2" align="center" class="tdstyle"> 请输入求购商品编号:
<input class="input1" type="text" name="cpid" size="20"> <input class="button" type="submit" value="精确查询" name="title">
</td>
</form>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<!--
<%totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"Purchase.asp"
showContent
showpage totalput,MaxPerPage,"Purchase.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"Purchase.asp"
showContent
showpage totalput,MaxPerPage,"Purchase.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Purchase.asp"
showContent
showpage totalput,MaxPerPage,"Purchase.asp"
end if
end if
rs.close
set rs=nothing
sub showContent
dim i
i=0
%> -->
<form method=Post action="Del2.asp">
<tr>
<td width="10%" height="25" align="center" class="tdstyle"><strong>编号(ID)</strong></td>
<td width="60%" height="20" align="center" class="tdstyle"><strong>商品名称</strong></td>
<td width="10%" height="20" align="center" class="tdstyle"><strong>发布会员</strong></td>
<td width="8%" height="20" align="center" class="tdstyle"><strong>删 除</strong></td>
</tr>
<%do while not rs.eof%>
<tr>
<td align="center" class="tdstyle"><%=rs("id")%></td>
<td class="tdstyle"><a href="../../PurchaseView.asp?Id=<%=rs("Id")%>" target="_blank"><%=rs("TradeName")%></a>
<%If rs("State")="0" Then
Response.Write("<font color=#FF9966>[竞价中...]</font>")
elseif rs("State")="1" then
Response.Write("<font color=#FF0000>[竞价结束]</font>")
elseif rs("State")="2" then
Response.Write("<font color=#0000FF>[客户已购入]</font>")
else
Response.Write("<font color=#FF00FF>[隐@发布者]</font>")
end if
%>
</td>
<td align="center" class="tdstyle"><a href="Member.asp?Member=<%=rs("Member")%>"><%=rs("Member")%></a> </td>
<td class="tdstyle"> <p align="center"><input name='selAnnounce' type='checkbox' value='<%=cstr(rs("Id"))%>'></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr align="right">
<td height="30" colspan="3" class="tdstyle">
<%end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align='center'> "
if CurrentPage<2 then
response.write "首页 上一页 "
else
response.write "<a href="&filename&"?page=1&KeyWord="&KeyWord&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&KeyWord="&KeyWord&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&KeyWord="&KeyWord&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&KeyWord="&KeyWord&">尾页</a>"
end if
response.write " 页次:"&CurrentPage&"/"&n&"页 "
response.write " 共"&totalnumber&"个产品 "&maxperpage&"个产品/页"
end function
%>
</td>
<td align="center" class="tdstyle">
<input name="submit" type='submit' class="button" value='删 除'></td>
<input name="page" type="hidden" id="page" value=<%=CurrentPage%>>
</tr>
</form>
<%end if%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -