📄 myshop.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.slname.value.length+" 字符。");
return false; }
if (theform.shoppic.value.length >60) {
alert("图标>60个字符!\n\n请限制在60字符,\n当前为 "+theform.face.value.length+" 字符。");
return false; }
if (theform.shoptext.value.length > 250) {
alert("简介太长啦!\n\n请限制在250 E文字符,125 中文字符,\n当前为 "+theform.sb.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>
<script language="vbscript">
<!--
function yyy(theform)
if theform.shopstart.value="" then
alert("请输入商店开始营业时间!")
elseif theform.shopend.value="" then
alert("请输商店打烊时间!")
elseif not isnumeric(theform.shopstart.value) then
alert("请输入整点时间!")
elseif not isnumeric(theform.shopend.value) then
alert("请输入整点时间!")
elseif cint(theform.shopend.value)<=cint(theform.shopstart.value) then
alert("开始营业时间不能大于打烊时间!")
elseif cint(theform.shopend.value)>24 or cint(theform.shopend.value)<0 then
alert("时间数值只能在0到24之间!")
elseif cint(theform.shopstart.value)>24 or cint(theform.shopstart.value)<0 then
alert("时间数值只能在0到24之间!")
else
theform.submit
end if
end function
function zzz(theform)
if theform.shopopen.checked then
if theform.shopstat.value="" then
alert("请输入商店关闭的原因!")
else
theform.submit
end if
else
theform.shopstat.value=""
theform.submit
end if
end function
//-->
</script>
<%
dim shopid,rs,sql
%><HTML><HEAD><title>超级市场 → 我的商店</title><%call shophead()
set rs=server.createobject("adodb.recordset")
sql="select * from shop where boss='"&membername&"'"
rs.open sql,connshop,1,1
if rs.eof and rs.bof then%><table width=100% bgcolor=#B7D3FF cellpadding=0 cellspacing=0><tr><td align=center><br><br>您还未在本超市申请入驻您的商店,您可以马上<a href=newshop.asp><font color=red>申请入驻</font></a>。<br>或者您已经提交入驻申请,我们正在审批中。<br><br><br></td></tr></table><%else
shopid=rs("id")
call main()
end if%></center></body></html>
<%
end if
sub main()
dim foodnum
dim brs
%>
<TABLE cellpadding="0" cellspacing="0" width=100% bgcolor="#B7D3FF">
<TBODY>
<TR>
<TD width=38% align=center height="25"><b>商 店 管 理 设 置</b></TD>
<TD width=62% align=center height="25"><b>物 品 管 理 设 置</b></TD>
</TR>
<TR>
<TD align=center valign="top"><TABLE cellpadding="2" cellspacing="1" width=92% bgcolor="#F2F8FF">
<TBODY bgcolor="#B7D3FF">
<TR>
<TD colspan="2" align=center height="25"><b>商店资料修改</b></TD>
</TR><form method=POST action=newshop.asp?act=mod&shopid=<%=shopid%> onSubmit="return xxx(this)">
<TR>
<TD align=center height="25">商店名称:</TD>
<TD><input class="TextBorder"type="text" value="<%=rs("shopname")%>" name="shopname" size="24"></TD>
</TR>
<TR>
<TD align=center height="25">商店标志:</TD>
<TD><input class="TextBorder" type="text" value="<%=rs("shoppic")%>" name="shoppic" size="24"></TD>
</TR>
<TR>
<TD align=center height="25">简 介:</TD>
<TD><TEXTAREA name="shoptext" class="TextBorder"rows=5 cols="22"><%=rs("shopface")%></TEXTAREA></TD>
</TR>
<TR>
<TD colspan="2" align=center height="35"><input class="TextBorder"type="submit" value=" 修 改 " name="cmdok"> <input class="TextBorder"type="reset" value=" 重 置 " name="cmdcancel"></TD>
</TR></form>
<TR>
<TD colspan="2" height="25"></TD>
</TR>
<TR><form name=chck method=post action=newshop.asp?shopid=<%=shopid%>&act=moddate onSubmit="yyy(this);return false;">
<TD align=center height="25"><b>营业时间:</b></TD>
<TD align=center><input type=text size=3 value=<%=rs("shopstart")%> name=shopstart> 至 <input type=text size=3 value=<%=rs("shopclose")%> name=shopend> <input type=submit value=设置></TD></form>
</TR>
<TR><form name=chcks method=post action=newshop.asp?shopid=<%=shopid%>&act=modstat onSubmit="zzz(this);return false;">
<TD align=center><b>营业状态:</b></TD>
<TD><input type=checkbox name=shopopen <%if not rs("ifopen") then%>checked<%end if%>>关闭 <font color=red>原因 </font><input type=text size=6 name=shopstat <%if not rs("ifopen") then%>value=<%=rs("shopstat")%><%end if%>> <input type=submit value=设置></TD></form>
</TR>
<TR>
<TD colspan="2" height="25"></TD>
</TR>
<TR>
<TD colspan="2" align=center height="25"><b><a href=newshop.asp?act=del&shopid=<%=shopid%>><font color=red>删除我的商店</font></a></b></TD>
</TR>
</TBODY>
</TABLE><br>
</TD>
<TD align=center valign="top"><TABLE cellpadding="2" cellspacing="1" width=94% bgcolor="#F2F8FF">
<TBODY bgcolor="#B7D3FF">
<%set brs=server.createobject("adodb.recordset")
sql="select * from food2 where shopid="&shopid
brs.open sql,connshop,1,1
if brs.eof and brs.bof then%><TR><TD align="center" height="25">商店现在还没有任何商品 <a href=foodact.asp?shopid=<%=shopid%>&act=input><font color=red>进货</font></a></TD></TR><%else
foodnum=brs.recordcount%>
<TR>
<TD colspan="5" align="center" height="25">商店现有商品种类 <%=brs.recordcount%> 种 <a href=foodact.asp?shopid=<%=shopid%>&act=input><font color=red>进货</font></a> <a href=foodact.asp?shopid=<%=shopid%>&act=clear><font color=red>清仓</font></a></TD>
</TR>
<TR>
<TD align="center" height="25"><b>图 例</b></TD>
<TD align="center"><b>名称</b></TD>
<TD align="center"><b>数量</b></TD>
<TD align="center"><b>进货时间</b></TD>
<TD align="center"><b>操 作</b></TD>
</TR>
<% brs.movefirst
do while not brs.eof%>
<TR>
<TD align=center height="55"><img border=0 src=<%=brs("foodpic")%> alt=<%=brs("foodtext")%>></TD>
<TD align=center><%=brs("foodname")%></TD>
<TD align=center><%=brs("foodnum")%></TD>
<TD align=center><%=brs("fooddate")%><%if datediff("d",brs("fooddate"),now)>brs("foodlast") then%><FONT color="#ff0000"> 过期</FONT><%end if%></TD>
<TD align=center><a href=foodact.asp?shopid=<%=shopid%>&foodid=<%=brs("id")%>&act=drop><font color=red>丢弃</font></a> <a href=foodact.asp?shopid=<%=shopid%>&foodid=<%=brs("id")%>&act=foodout><font color=red>退货</font></a> <a href=foodact.asp?shopid=<%=shopid%>&foodid=<%=brs("id")%>&act=foodedit><font color=red>修改</font></a></TD>
</TR>
<%
brs.movenext
loop
end if
brs.close
set brs=nothing%>
</TBODY>
</TABLE><br>
</TD>
</TR>
</TBODY>
</TABLE>
<%
end sub
connshop.close
set connshop=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -