📄 shopmana.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="shopconn.asp" -->
<%
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Response.Write("对不起,您不是社区用户,请先注册!")
Response.End
else
dim act
dim maxlist,currentpage,pcount,page_count,endpage
dim shopnumber,shopid
maxlist=10
%><HTML><HEAD><title>超级市场 → 超市管理</title><%call shophead()
if master then
act=request("act")
if act="del" then
call shopdel()
elseif act="edit" then
call shopedit()
elseif act="edited" then
call edited()
else
call main()
end if
else
response.write "<script>alert('您没有管理权限!');history.go(-1);</script>"
response.end
end if
sub main()
dim brs
%>
<TABLE cellpadding="2" cellspacing="1" width=100% bgcolor="#F2F8FF">
<TBODY bgcolor="#B7D3FF">
<TR>
<TD colspan="8" align="center" height="25"><%
set rs=server.createobject("adodb.recordset")
sql="delete from foodbuy where foodnum=0"
sql="delete from food2 where foodnum=0"
rs.open sql,connshop,1,3
set rs=server.createobject("adodb.recordset")
sql="select * from shop order by id desc"
rs.open sql,connshop,1,1
if rs.eof and rs.bof then%><br>超市目前还没有商店入驻! <a href=shopacc.asp>[审批商店]</a> <a href=foodmana.asp>[货仓管理]</a><br><br><%
else
shopnumber=rs.recordcount
currentpage=trim(request("page"))
if currentpage="" or not isinteger(currentpage) then
currentpage=1
else
currentpage=clng(currentpage)
if err then
currentpage=1
err.clear
end if
end if
if shopnumber mod maxlist=0 then
Pcount= shopnumber \ maxlist
else
Pcount= shopnumber \ maxlist+1
end if%>超市目前共有 <font color=red><%=cstr(shopnumber)%></font> 个商店 <a href=shopacc.asp>[审批商店]</a> <a href=foodmana.asp>[货仓管理]</a></TD>
</TR>
<TR>
<TD align="center" height="25">店名</TD>
<TD align="center">店主</TD>
<TD align="center">人气值</TD>
<TD align="center">商店状态</TD>
<TD align="center">信誉度</TD>
<TD align="center">营业时间</TD>
<TD align="center">开业日期</TD>
<TD align="center">操作</TD>
</TR>
<%
RS.MoveFirst
if currentpage > Pcount then currentpage = Pcount
if currentpage<1 then currentpage=1
RS.Move (currentpage-1) * maxlist
page_count=0
do while not rs.eof and page_count < maxlist
%>
<tr>
<td align="center" height="25"><a href=shop.asp?shopid=<%=rs("id")%>><%=rs("shopname")%></a></td>
<td align="center"><a href=dispuser.asp?name=<%=rs("boss")%> target=_blank><%=rs("boss")%></a></td>
<td align="center"><%=rs("shoprq")%></td>
<%
if rs("ifopen") then
%>
<td align="center">正常营业</td>
<%else%>
<td align="center"><%=rs("shopstat")%></td>
<%end if%>
<td align="center"><%=rs("shopvalue")%></td>
<td align="center"><%=rs("shopstart")%>点—<%=rs("shopclose")%>点</td>
<td align="center"><%=rs("datetime")%></td>
<td align="center"><a href=?shopid=<%=rs("id")%>&act=del><font color=red>删除</font></a> <a href=?shopid=<%=rs("id")%>&act=edit><font color=red>编辑</font></a></td>
</tr>
<%
page_count=page_count+1
rs.movenext
loop
%>
<TR>
<TD colspan="8" align="center" height="25">页次:<b><%=currentpage%></b>/<b><%=Pcount%></b>页 每页:<b><%=maxlist%></b> 总数:<b><%=shopnumber%></b> 分页:<%if currentpage > 4 then%>
<a href="?page=1">[1]</a>...
<%
end if
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then%><font color=red>[<%=i%>]</font><%else%>
<a href="?page=<%=i%>"><%=i%></a>
<% end if
end if
next
if currentpage+3 < Pcount then%>... <a href=?page=<%=Pcount%>>[<%=Pcount%>]</a><%end if
end if%></TD>
</TR>
</TBODY>
</TABLE><%
rs.close
set rs=nothing
end sub
sub shopedit()
shopid=request("shopid")
set rs=server.createobject("adodb.recordset")
sql="select * from shop where id="&shopid
rs.open sql,connshop,1,3
%>
<table width=100% bgcolor="#B7D3FF" cellpadding=0 cellspacing=0><tr><td align=center><table width="80%"><form method="POST" action="?shopid=<%=shopid%>&act=edited" onSubmit="return xxx(this)">
<tr>
<td height="25" colspan=2 align=center><b>编 辑 商 店</b></td>
</tr>
<tr>
<td width="15%">商店名称:</td>
<td width="85%"><input class="TextBorder"type="text" name="shopname" size="20" value=<%=rs("shopname")%>></td>
</tr>
<tr>
<td>商店招牌:</td>
<td><input class="TextBorder"type="text" name="shoppic" size="20" value=<%=rs("shoppic")%>> <font color=red>(请输入图片地址,该图片作为商店的招牌)</font></td>
</tr>
<tr>
<td>广告词:</td>
<td><TEXTAREA name="shoptext" class="TextBorder"rows=5 cols="75"><%=rs("shopface")%></TEXTAREA></td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="submit" class="TextBorder" value=" 编 辑 " name="cmdok">
<input type="reset" class="TextBorder" value=" 取 消 " name="cmdcancel">
</td>
</tr>
</form>
</table></td>
</tr>
</table>
<%end sub
sub edited()
if request("shopname")="" then
response.write "<script>alert('请输入商店名称!');history.go(-1);</script>"
elseif request("shoppic")="" then
response.write "<script>alert('请输入商店招牌的图片地址!');history.go(-1);</script>"
elseif request("shoptext")="" then
response.write "<script>alert('请输入商店的广告词!');history.go(-1);</script>"
end if
shopid=request("shopid")
set rs=server.createobject("adodb.recordset")
sql="select * from shop where id="&shopid
rs.open sql,connshop,1,3
rs("shopname")=request("shopname")
rs("shoppic")=request("shoppic")
rs("shopface")=request("shoptext")
rs.update
rs.close
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=shopmana.asp"">"%>
<tr><td>系统将自动在3秒后返回超市管理,您现在可以选择下面操作:
<UL><li><a href=/><font color=#000000>返回中央广场</font></a></li>
<li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%
end sub
sub shopdel()
shopid=request("shopid")
set rs=server.createobject("adodb.recordset")
sql="delete from shop where id="&shopid
rs.open sql,connshop,1,3
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=shopmana.asp"">"%>
<tr><td>系统将自动在3秒后返回超市管理,您现在可以选择下面操作:
<UL><li><a href=/><font color=#000000>返回中央广场</font></a></li>
<li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%
end sub
connshop.close
set connshop=nothing
%></center></body></html>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -