📄 newshop.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="shopconn.asp" -->
<%
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Response.Write("对不起,您不是社区用户,请先注册!")
Response.End
else
%>
<script language="javascript">
<!--
var postmaxchars1 = 500;
function xxx(theform) {
if (theform.shopname.value=="") {
alert("请输入商店名称!");
return false; }
if (theform.shoppic.value=="") {
alert("请输商店招牌图片地址!");
return false; }
if (theform.shoptext.value=="") {
alert("请输入商店招牌广告词!");
return false; }
if (postmaxchars1 != 0) {
if (theform.shopname.value.length >100) {
alert("店名太长了>100个字符!\n\n请限制在100 E文字符,50 中文字符!\n当前为"+theform.shopname.value.length+" 字符。");
return false; }
if (theform.shoppic.value.length >60) {
alert("图标>60个字符!\n\n请限制在60字符,\n当前为 "+theform.shoppic.value.length+" 字符。");
return false; }
if (theform.shoptext.value.length > 250) {
alert("简介太长啦!\n\n请限制在250 E文字符,125 中文字符,\n当前为 "+theform.shoptext.value.length+" 字符。");
return false; }
else { return true; }
} else { return true; }
}
function checklength(theform) {
if (postmaxchars1 != 0) { message = "\n所允许的最大长度为 500 字符!"; }
else { message = ""; }
alert("您输入的信息为 "+theform.message.value.length+" 字符。"+message);
}
//-->
</script>
<%
dim act,username
dim shopid
%><HTML><HEAD><title>超级市场 → 我的物品</title><%call shophead()%><table width=100% bgcolor="#B7D3FF" cellpadding=0 cellspacing=0><tr><td align=center><%
username=membername
act=request("act")
select case act
case "new"
call newsp()
case "del"
call delsp()
case "mod"
call modsp()
case "moddate"
call moddate()
case "modstat"
call modstat()
case else
call main()
end select%></td></tr></table></center></body></html>
<%
end if
sub main()%>
<table width="80%"><form method="POST" action="newshop.asp?act=new" 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"></td>
</tr>
<tr>
<td>商店招牌:</td>
<td><input class="TextBorder"type="text" name="shoppic" size="20"> <font color=red>(请输入图片地址,该图片作为商店的招牌)</font></td>
</tr>
<tr>
<td>广告词:</td>
<td><TEXTAREA name="shoptext" class="TextBorder"rows=5 cols="75"></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><%end sub
sub newsp()
set rs=server.createobject("adodb.recordset")
sql="select * from shop where boss='"&membername&"'"
rs.open sql,connshop,1,1
if not rs.eof then
rs.close
set rs=nothing
connshop.close
set connshop=nothing
response.write "<script>alert('对不起!您的商店已经入驻本超市!');history.go(-1);</script>"
response.end
end if
rs.close
sql="select * from shoptmp where boss='"&membername&"'"
rs.open sql,connshop
if not rs.eof then
rs.close
set rs=nothing
connshop.close
set connshop=nothing
response.write "<script>alert('对不起!您已经提交入驻申请,正在审批中!');history.go(-1);</script>"
response.end
end if
dim brs
set brs=server.createobject("adodb.recordset")
sql="select ML from [HY] where NC='"&membername&"'"
brs.open sql,conn,1,1
if cdbl(brs(0))<0 then
rs.close
set brs=nothing
response.write "<script>alert('对不起!您不能申请入驻!');history.go(-1);</script>"
response.end
end if
set brs=server.createobject("adodb.recordset")
sql="select * from shoptmp where (id is null)"
brs.open sql,connshop,1,3
brs.addnew
brs("boss")=membername
brs("shopname")=request("shopname")
brs("shoppic")=request("shoppic")
brs("shopface")=request("shoptext")
brs("datetime")=date()
brs.Update
brs.close
set brs=nothing
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=myshop.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 delsp()
dim brs
shopid=trim(request("shopid"))
if shopid="" then
response.write "<script>alert('你从哪里钻出来的?');history.go(-1);</script>"
response.end
else
set brs=server.createobject("adodb.recordset")
sql="select boss from [shop] where id="&shopid
brs.open sql,connshop,1,1
if brs.eof then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
elseif brs(0)<>membername then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
end if
end if
brs.close
set brs=nothing
set brs=server.createobject("adodb.recordset")
sql="delete from shop where id=" & shopid
brs.open sql,connshop,1,3
sql="delete from food2 where shopid=" & shopid
brs.open sql,connshop,1,3
'brs.close
'set brs=nothing
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=shop.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 moddate()
dim brs
dim tstart,tend
shopid=trim(request("shopid"))
tstart=cint(request("shopstart"))
tend=cint(request("shopend"))
if shopid="" then
response.write "<script>alert('你从哪里钻出来的?');history.go(-1);</script>"
response.end
else
set brs=server.createobject("adodb.recordset")
sql="select * from [shop] where id="&shopid
brs.open sql,connshop,1,3
if brs.eof then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
elseif brs("boss")<>membername then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
else
brs("shopstart")=tstart
brs("shopclose")=tend
brs.update
brs.close
set brs=nothing
end if
end if
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=myshop.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 modstat()
dim brs
dim shopstat,ifopen
shopid=trim(request("shopid"))
shopstat=trim(request("shopstat"))
ifopen=request("shopopen")
if shopid="" then
response.write "<script>alert('你从哪里钻出来的?');history.go(-1);</script>"
response.end
else
set brs=server.createobject("adodb.recordset")
sql="select * from [shop] where id="&shopid
brs.open sql,connshop,1,3
if brs.eof then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
elseif brs("boss")<>membername then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
else
if shopstat="" and brs("ifopen")=false then
brs("ifopen")=true
brs("shopstat")=""
brs.update
elseif shopstat<>"" and brs("ifopen")=true then
brs("ifopen")=false
brs("shopstat")=shopstat
brs.update
end if
brs.close
set brs=nothing
end if
end if
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=myshop.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 modsp()
dim brs
shopid=trim(request("shopid"))
if shopid="" then
response.write "<script>alert('你从哪里钻出来的?');history.go(-1);</script>"
response.end
else
set brs=server.createobject("adodb.recordset")
sql="select boss from [shop] where id="&shopid
brs.open sql,connshop,1,1
if brs.eof then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
elseif brs(0)<>membername then
response.write "<script>alert('别人的店都敢乱动,110可是免费的!');history.go(-1);</script>"
response.end
end if
end if
brs.close
set brs=server.createobject("adodb.recordset")
sql="select * from shop where id="&shopid
brs.open sql,connshop,1,3
brs("shopname")=request("shopname")
brs("shoppic")=request("shoppic")
brs("shopface")=request("shoptext")
brs.Update
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=myshop.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
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -