📄 admin_goods_add.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<%
if request.cookies("admin_OK")="" then
response.redirect("admin_login.html")
end if
%>
<%
dim db
db=0
%>
<!--#include file="../config/db.asp"-->
<%
dim sql,rst,rst1,sql1
set rst=server.CreateObject("adodb.recordset")
set rst1=server.CreateObject("adodb.recordset")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<link href="../css/mycss.css" rel="stylesheet" type="text/css" />
</head>
<script language="javascript">
<!--
//函数名:fucCheckNUM
//功能介绍:检查是否为数字
//参数说明:要检查的数字
//返回值:1为是数字,0为不是数字
function fucCheckNUM(NUM)
{
var i,j,strTemp;
strTemp="0123456789.";
if ( NUM.length== 0)
return 0;
for (i=0;i<NUM.length;i++)
{
j=strTemp.indexOf(NUM.charAt(i));
if (j==-1)
{
//说明有字符不是数字
return 0;
}
}
//说明是数字
return 1;
}
function form1_chk_data()
{
if (document.form1.frm_gds_xiaolei.value < 1)
{
alert("您必须选择商品分类!");
document.form1.frm_gds_xiaolei.focus();
return false;
}
if (document.form1.frm_gds_name.value.length < 1)
{
alert("您必须输入商品名称!");
document.form1.frm_gds_name.focus();
return false;
}
if(document.form1.frm_gds_price.value.length < 1)
{
alert("您必须输入商品价格!");
document.form1.frm_gds_price.focus();
return false;
}
if(document.form1.frm_gds_discount.value.length < 1)
{
alert("您必须输入商品折扣率!");
document.form1.frm_gds_discount.focus();
return false;
}
if(document.form1.frm_gds_viprate.value.length < 1)
{
alert("您必须输入Vip折扣率!");
document.form1.frm_gds_viprate.focus();
return false;
}
if(document.form1.frm_gds_image.value.length < 1)
{
alert("您必须输入商品图片!");
document.form1.frm_gds_image.focus();
return false;
}
if(document.form1.frm_gds_intro.value.length < 1)
{
alert("您必须输入商品简介!");
document.form1.frm_gds_intro.focus();
return false;
}
if(document.form1.frm_gds_info.value.length < 1)
{
alert("您必须输入商品详细介绍!");
document.form1.frm_gds_info.focus();
return false;
}
if ((fucCheckNUM(document.form1.frm_gds_price.value)==0) )
{ alert ("商品价格有非法字符,请填写正确商品价格。");
document.form1.frm_gds_price.focus();
return false;
}
if ((fucCheckNUM(document.form1.frm_gds_discount.value)==0) )
{ alert ("商品折扣率有非法字符,请填写正确商品折扣率。");
document.form1.frm_gds_discount.focus();
return false;
}
if ((fucCheckNUM(document.form1.frm_gds_viprate.value)==0) )
{ alert ("VIP折扣率有非法字符,请填写正确VIP折扣率。");
document.form1.frm_gds_viprate.focus();
return false;
}
}
//-->
</script>
<body>
<form name="form1" id="form1" onsubmit="javascript:return form1_chk_data();" action="admin_goods_act.asp?act=add" method="post" enctype="multipart/form-data" >
<p>选择商品分类:
<%
%>
<select name="frm_gds_xiaolei" size="1" id="frm_gds_xiaolei" >
<option value="0" selected="selected">选择商品分类</option>
<%
sql="select * from shop_goodsclass where gc_upid=0"
rst.open sql,conn,1,1
do while not rst.eof
sql1="select * from shop_goodsclass where gc_upid<>0 and gc_upid="&rst("gc_id")
rst1.open sql1,conn,1,1
do while not rst1.eof
%>
<option value="<%=rst1("gc_id")%>"><%=rst("gc_name")%>--><%=rst1("gc_name")%></option>
<%
rst1.movenext
loop
rst1.close
rst.movenext
loop
rst.close
%>
</select>
</p>
<p>商品 名称:
<input name="frm_gds_name" type="text" id="frm_gds_name" />
限制50字符内<br />
商品 价格:
<input name="frm_gds_price" type="text" id="frm_gds_price" />
元 如:700
<br />
商品折扣率:
<input name="frm_gds_discount" type="text" id="frm_gds_discount" />
% 说明:要写<span class="STYLE1">50%</span> 只需填写 <span class="STYLE1">0.5</span> 即可<br />
Vip 折扣率:
<input name="frm_gds_viprate" type="text" id="frm_gds_viprate" />
% 说明:要写<span class="STYLE1">50%</span> 只需填写 <span class="STYLE1">0.5</span> 即可<br />
商品 图片:
<input name="frm_gds_image" type="file" id="frm_gds_image" />
<br />
商品 简介:
<input name="frm_gds_intro" type="text" id="frm_gds_intro" size="50" maxlength="50" />
限制50字符内<br />
商品详细介绍:
<textarea name="frm_gds_info" cols="60" rows="5" id="frm_gds_info"></textarea>
<br />
<input type="submit" name="Submit" value="提交" />
</p>
</form>
<%
set rst1=nothing
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -