📄 addsubs.asp
字号:
<!--#include file="adminconn.inc" -->
<html>
<head>
<title>腾科B2C购物系统-商品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../inc/guhongying.css" type="text/css">
</head>
<body bgcolor="#6699CC" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#000000" vspace="0" hspace="0">
<tr>
<td bgcolor="#316395" height="27"><font color="#FFFFFF">.:: 您可以在此添加商品</font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50"> </td>
</tr>
</table>
<script language="JavaScript">
function CheckForm()
{
if (document.addsubs.subs.value.length == 0) {
alert("请输入商品名[课程号].");
document.addsubs.subs.focus();
return false;
}
if (document.addsubs.subsname.value.length == 0) {
alert("请输入商品全称[课程名].");
document.addsubs.subsname.focus();
return false;
}
if (document.addsubs.price.value.length == 0) {
alert("请输入商品的价格.");
document.addsubs.price.focus();
return false;
}
return true;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td align="center">
<form name="addsubs" method="post" action="addsubs.asp" onSubmit="return CheckForm();">
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#000000" width="60%">
<tr>
<td bgcolor="#336699" colspan="2" height="30"><b><font color="#FFFFFF">添加一种商品</font></b></td>
</tr>
<tr bgcolor="eeeeee">
<td colspan="2" align="center" height="35">
<div align="left">此商品是否为套装商品
<input type="checkbox" name="ispacket" value="1">
[ 如果为套装商品,请不要选择分类别]</div>
</td>
</tr>
<tr>
<td bgcolor="#7C96B8" align="center" width="35%" height="35">
<div align="left"><font color="#FFFFFF">要添加到的主分类</font></div>
</td>
<td bgcolor="#7C96B8" align="center" width="65%">
<div align="left">
<select name="bigarea" class="bk">
<option value="" selected>要添加到的主分类</option>
<%
sql="select * from bigarea"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof
%>
<option value="<%=rs("bigarea")%>"><%=rs("bigarea")%></option>
<%
rs.movenext
wend
rs.Close()
%>
</select>
</div>
</td>
</tr>
<tr>
<td bgcolor="#336699" align="center" height="35">
<div align="left"><font color="#FFFFFF">要添加到的分类别</font></div>
</td>
<td bgcolor="#336699" align="center">
<div align="left">
<select name="area" class="bk">
<option value="" selected>要添加到的分类别</option>
<%
sql="select * from area"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof
%>
<option value="<%=rs("area")%>"><%=rs("area")%></option>
<%
rs.movenext
wend
rs.Close()
%>
</select>
</div>
</td>
</tr>
<tr bgcolor="#7C96B8">
<td align="center" height="35">
<div align="left"><font color="#FFFFFF">商品名 [课程号]</font></div>
</td>
<td align="center">
<div align="left">
<input type="text" name="subs" size="17">
</div>
</td>
</tr>
<tr>
<td bgcolor="#336699" align="center" height="35">
<div align="left"><font color="#FFFFFF">商品全称 [课程名]</font></div>
</td>
<td bgcolor="#336699" align="center">
<div align="left">
<input type="text" name="subsname" size="30">
</div>
</td>
</tr>
<tr bgcolor="#7C96B8">
<td align="center" height="35">
<div align="left"><font color="#FFFFFF">题目总数量</font></div>
</td>
<td align="center">
<div align="left">
<input type="text" name="subsnumber" size="17">
</div>
</td>
</tr>
<tr>
<td bgcolor="#336699" align="center" height="35">
<div align="left"><font color="#FFFFFF">商品价格</font></div>
</td>
<td bgcolor="#336699" align="center">
<div align="left">
<input type="text" name="price" size="17">
</div>
</td>
</tr>
<tr bgcolor="#7C96B8">
<td align="center" height="35">
<div align="left"><font color="#FFFFFF"><br>
其<br>
他<br>
说<br>
明<br>
</font></div>
</td>
<td align="center">
<div align="left">
<p>
<textarea name="other" rows="6" cols="30"></textarea>
</p>
</div>
</td>
</tr>
<tr bgcolor="#7C96B8">
<td height="55" width="31%"><font color=ffffff>此商品图片图片资料:</font></td>
<td height="55" width="69%">
<input type="text" name="photo" value="" size="25" class="bk">
<font color="#FFFFFF"><br>
[所有图样均在PHOTO目录,填写图片全名即可]</font></td>
</tr>
<tr bgcolor="#336699">
<td align="center" height="60" colspan="2">
<div align="center">
<input type="submit" name="Submit" value="添加">
<input type="reset" name="Submit" value="重填">
<input type="hidden" name="action" value="addsubs">
</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
<%
if request("action")<>"addsubs" then
response.end
else
if request("action")="addsubs" then
bigarea=request("bigarea")
area=request("area")
subs=request("subs")
subsname=request("subsname")
subsnumber=request("subsnumber")
price=request("price")
photo=request("photo")
other=replace(request("other"),">",">")
other=replace(other,"<","<")
ispacket=request("ispacket")
if ispacket<>"1" then ispacket="0"
if bigarea="" then
response.write"<SCRIPT language=JavaScript>alert('请选择商品所在主分类!');"
response.write "</SCRIPT>"
response.end
end if
if ispacket="0" then
if area="" then
response.write"<SCRIPT language=JavaScript>alert('请选择商品所在分类别!');"
response.write "</SCRIPT>"
response.end
end if
end if
if subsnumber="" then subsnumber="未知"
if other="" then other="此商品无详细说明"
if ispacket="0" then
conn.execute "insert into subs (bigarea,area,subs,subsname,subsnumber,price,ispacket,other,photo) values ('"&bigarea&"','"&area&"','"&subs&"','"&subsname&"','"&subsnumber&"','"&price&"','"&ispacket&"','"&other&"','"&photo&"')"
else
conn.execute "insert into subs (bigarea,subs,subsname,subsnumber,price,ispacket,other,photo) values ('"&bigarea&"','"&subs&"','"&subsname&"','"&subsnumber&"','"&price&"','"&ispacket&"','"&other&"','"&photo&"')"
end if
sql="select * from subs where subs='"&subs&"'"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
bookbm=rs("id")
conn.execute "update subs set bookbm='"&bookbm&"' where subs='"&subs&"'"
response.write"<SCRIPT language=JavaScript>alert('商品添加成功!');"
response.write "</SCRIPT>"
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -