📄 admin_tjbook.asp
字号:
<!-- #include file="conn.asp"-->
<%
dim sql
dim rs
dim mboard
dim currentpage
if request("page")="" or request("page")<1 then
currentpage=1
else
currentpage=request("page")
end if
dim maxperpage
maxperpage=20
dim maxpage
dim count
dim counti
counti=0
dim countj
countj=1
mboard=104
%>
<%
set rs=server.CreateObject("ADODB.recordset")
rs.open "index",conn,3,3
name=rs("name")
rs.close
set rs=nothing
%>
<title><%=name%>购物--管理系统</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta NAME=GENERATOR Content=""Microsoft FrontPage 4.0"" CHARSET=GB2312>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<%
if request("action")="del" then
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<script language=JavaScript>{window.location='error.asp'}</script>"
response.end
end if
set rs=server.CreateObject("ADODB.recordset")
sql="DELETE id from pic where item='"&request("sel")&"'"
rs.open sql,conn,3,3
rs.update
rs.close
set rs=nothing
set rs=server.CreateObject("ADODB.recordset")
sql="DELETE id from products where item='"&request("sel")&"'"
rs.open sql,conn,3,3
rs.update
rs.close
set rs=nothing
response.write "<script language=JavaScript>{window.alert('商品删除成功!');window.location='admin_tjbook.asp?page="&request("page")&"'}</script>"
response.end
end if
%>
<br>
<%
set rs=server.CreateObject("ADODB.recordset")
sql="select * from products where tejia=True order by id desc"
rs.open sql,conn,3,3
if rs.eof and rs.bof then
response.write "<br><center>暂时还没有特价商品!</center>"
else
count=rs.recordcount
if count mod maxperpage = 0 then
maxpage=count \ maxperpage
else
maxpage=count \ maxperpage +1
end if
if cint(currentpage) > cint(maxpage) then
currentpage=1
end if
%>
<%
sub page
if count<>0 then
%>
<table width="100%" cellspacing=0 cellpadding=0 class=forumrow align=center>
<form method="post" name="gopage" action="admin_tjbook.asp">
<tr>
<td width=100% align=center>
<%
if CurrentPage<2 then
response.write "共有商品"&count&"个 首页 上一页 "
else
response.write "共有商品"&count&"个 <a href=admin_tjbook.asp?page=1>首页</a> "
response.write "<a href=admin_tjbook.asp?page="&CurrentPage-1&">上一页</a> "
end if
if maxpage-currentpage<1 then
response.write "下一页 尾页 "
else
response.write "<a href=admin_tjbook.asp?page="&(CurrentPage+1)&">"
response.write "下一页</a> <a href=admin_tjbook.asp?page="&maxpage&">尾页</a> "
end if
response.write "页次:<strong><font color=red>"&CurrentPage&"</font>/"&maxpage&"</strong>页"
response.write " <b>"&maxperpage&"</b>个商品/页 "
%>
转到
<select name=page onchange="submit()">
<%
for i=1 to maxpage
if cint(i)=cint(currentpage) then
flag="selected"
else
flag=""
end if
response.write "<option " & flag & " value=" & i & ">" & i & "</option>"
next
%>
</select>
页
</td>
</tr>
</form>
</table>
<%
end if
end sub%>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align="center" class="tableBorder">
<tr>
<th width="100%" colspan="6" height="25">商品管理</th>
</tr>
<tr>
<td width="18%" height=25 class=forumrow align=center>商品编号</td>
<td width="20%" class=forumrow align=center>商品名称</td>
<td width="20%" class=forumrow align=center>商品型号</td>
<td width="10%" class=forumrow align=center>浏览次数</td>
<td width="22%" class=forumrow align=center>入库时间</td>
<td width="10%" class=forumrow align=center>删 除</td>
</tr>
<%
if cint(currentpage)<=cint(maxpage) then
rs.move (currentpage-1)*maxperpage
showcontent
end if
sub showcontent
do while not rs.eof
%>
<tr>
<td height=25 class=forumrow align=center><a href="admin_xgbook.asp?id=<%=rs("id")%>"><%=rs("item")%></a></td>
<td class=forumrow align=center><%=rs("name")%></td>
<td class=forumrow align=center><%=rs("typed")%></td>
<td class=forumrow align=center><%=rs("hits")%></td>
<td class=forumrow align=center><%=rs("time")%></td>
<td class=forumrow align=center><a href="admin_tjbook.asp?action=del&page=<%=request("page")%>&sel=<%=rs("item")%>">删除</a></td>
</tr>
<%
counti=counti+1
rs.movenext
if counti>=maxperpage then
exit do
end if
loop
end sub
end if
rs.close
set rs=nothing
%>
<tr>
<td height="22" colspan="6" class="forumrow">
<%call page%>
</td>
</tr>
</table><br>
<%
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -