?? 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 + -