📄 admin_goods_modify.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"-->
<!--#include file="../config/function.inc.asp"-->
<%dim rst,sql,myErrors,rid
set rst=server.CreateObject("adodb.recordset")
rid=request.querystring("id")
%>
<!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_name1.value.length < 1)
{
alert("您必须输入商品名称!");
document.form1.frm_gds_name1.focus();
return false;
}
if(document.form1.frm_gds_price1.value.length < 1)
{
alert("您必须输入商品价格!");
document.form1.frm_gds_price1.focus();
return false;
}
if(document.form1.frm_gds_discount1.value.length < 1)
{
alert("您必须输入商品折扣率!");
document.form1.frm_gds_discount1.focus();
return false;
}
if(document.form1.frm_gds_viprate1.value.length < 1)
{
alert("您必须输入Vip折扣率!");
document.form1.frm_gds_viprate1.focus();
return false;
}
if(document.form1.frm_gds_intro1.value.length < 1)
{
alert("您必须输入商品简介!");
document.form1.frm_gds_intro1.focus();
return false;
}
if(document.form1.frm_gds_info1.value.length < 1)
{
alert("您必须输入商品详细介绍!");
document.form1.frm_gds_info1.focus();
return false;
}
if ((fucCheckNUM(document.form1.frm_gds_price1.value)==0) )
{ alert ("商品价格有非法字符,请填写正确商品价格。");
document.form1.frm_gds_price1.focus();
return false;
}
if ((fucCheckNUM(document.form1.frm_gds_discount1.value)==0) )
{ alert ("商品折扣率有非法字符,请填写正确商品折扣率。");
document.form1.frm_gds_discount1.focus();
return false;
}
if ((fucCheckNUM(document.form1.frm_gds_viprate1.value)==0) )
{ alert ("VIP折扣率有非法字符,请填写正确VIP折扣率。");
document.form1.frm_gds_viprate1.focus();
return false;
}
}
//-->
</script>
<body>
<div align="center">后台商品管理
</div>
<p>修改商品:</p>
<%
if request.querystring("act")="modify" then
if not isnumeric(rid) or isempty(rid) then
moxboxU "非法参数!"
else
sql="select * from shop_goods where gds_id="&rid
rst.open sql,conn,1,3
%>
<form onsubmit="javascript:return form1_chk_data();" action="admin_goods_act.asp?act=update&id=<%=rid%>" method="post" enctype="multipart/form-data" name="form1" id="form1">
<p><br />
商品 名称:
<input name="frm_gds_name1" type="text" id="frm_gds_name1" value="<%=rst("gds_name")%>" />
限制50字符内<br />
商品 价格:
<input name="frm_gds_price1" type="text" id="frm_gds_price1" value="<%=rst("gds_price")%>" />
元 如:700<br />
商品折扣率:
<input name="frm_gds_discount1" type="text" id="frm_gds_discount1" value="<%=rst("gds_discount")%>" />
% 说明:要写<span class="STYLE1">50%</span> 只需填写 <span class="STYLE1">0.5</span> 即可<br />
VIP 折扣率:
<input name="frm_gds_viprate1" type="text" id="frm_gds_viprate1" value="<%=rst("gds_viprate")%>" />
% 说明:要写<span class="STYLE1">50%</span> 只需填写 <span class="STYLE1">0.5</span> 即可<br />
商品 图片:
<input name="frm_gds_image1" type="file" id="frm_gds_image1" />
当前图片<ImG src="../upfile/<% =rst("gds_image") %>" height="50" width="109" align="center" />:<span class="STYLE1">如果需要修改图片请上传,否则请留空</span><br />
商品 简介:
<input name="frm_gds_intro1" type="text" id="frm_gds_intro1" value="<%=rst("gds_intro")%>" size="50" />
最多50个字符<br />
商品详细介绍:
<textarea name="frm_gds_info1" cols="60" rows="5" id="frm_gds_info1"><%=rst("gds_info")%></textarea>
<p>
<div align="left">
<input type="submit" name="Submit" value="提交" />
</div>
</p>
</form>
<%
end if
end if
%>
<%
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -