📄 add2.asp
字号:
<!--#include file="../0.asp"-->
<!--#include file="../../../conn/conn.asp"-->
<!--#include file="../../../conn/nosql.asp"-->
<%if Request("id")="" then
response.write "系统拒绝了您的操作请求"
response.end
end if
session("id")=clng(Request("id"))
t_id1=session("id")
%>
<html>
<head>
<title>添加新商品</title>
<script language=javascript >
function check_input()
{
if (ffm.gname.value=="")
{ alert("请输入商品名");
ffm.gname.focus();
return false;
}
if (ffm.mprice.value=="")
{ alert("请输入市场价");
ffm.mprice.focus();
return false;
}
if (ffm.leprice.value=="")
{ alert("请输入价");
ffm.leprice.focus();
return false;
}
if (ffm.num.value=="")
{ alert("请输入数量");
ffm.num.focus();
return false;
}
return true;
}
</script>
<link href="../../../css/css.css" rel="stylesheet" type="text/css">
<STYLE>
BODY {
SCROLLBAR-FACE-COLOR: #799ae1;
SCROLLBAR-HIGHLIGHT-COLOR: #799ae1;
SCROLLBAR-SHADOW-COLOR: #799ae1;
SCROLLBAR-3DLIGHT-COLOR: #799ae1;
SCROLLBAR-ARROW-COLOR: #fcfcfc;
SCROLLBAR-TRACK-COLOR: #aabfec;
SCROLLBAR-DARKSHADOW-COLOR: #799ae1;
SCROLLBAR-BASE-COLOR: #799ae1;
background-color: #CAD7F7;
}
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<div align="center">
<p><br>
<a href="index.asp">>>返回电话订单主页面</a>
<a href="add.asp?add=x&id=<%=Request("id")%>">>>修改客户信息</a>
<br>
</p>
</div>
<table width="99%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="207" valign="top" width="10%"> <form name="ffm" method="POST" action=? onSubmit="return check_input()">
<table bgcolor=#FFFFFF border=0 cellpadding=3 cellspacing=1
width="99%" align="center" class="9bang">
<tr bgcolor="#FFFFFF">
<td colspan="5" bgcolor="#E8F1FF" class="008c5e"> <div align="center">新增商品 (带<font color="#FF0000"><b>*</b></font>为必填项)
</div></td>
</tr>
<tbody>
<tr bgcolor="#f1f1f1">
<td width=37% bgcolor="#E8F1FF" class="008c5e">
<div align="center">商品名称</div></td>
<td width=22% bgcolor="#E8F1FF" class="008c5e">
<div align="center">市场价格</div></td>
<td width=20% bgcolor="#E8F1FF" class="008c5e">
<div align="center">会员价格</div></td>
<td width=12% bgcolor="#E8F1FF" class="008c5e">
<div align="center">数量</div></td>
<td width=9% bgcolor="#E8F1FF" class="008c5e"> </td>
</tr>
<tr>
<td width=37% height="18" bgcolor=#E8F1FF class="008c5e"> <div align="center">
<font color="#FF0000"><b>
<input name="id" type="hidden" id="id" value="<%=Request("id")%>">
*</b></font>
<input name="gname" type="text" size="15">
</div></td>
<td width=22% height="18" bgcolor=#E8F1FF class="008c5e"> <div align="center">
<font color="#FF0000"><b>*</b></font>
<input name="mprice" type="text" size="15">
</div></td>
<td width=20% height="18" bgcolor=#E8F1FF class="008c5e"> <div align="center">
<font color="#FF0000"><b>*</b></font>
<input name="leprice" type="text" size="15">
</div></td>
<td width=12% height="18" bgcolor=#E8F1FF class="008c5e"> <div align="center">
<font color="#FF0000"><b>*</b></font>
<input name="num" type="text" size="6">
</div></td>
<td width=9% height="18" bgcolor=#E8F1FF class="008c5e"> <div align="center">
<input name="Submit" type="submit" value="提交">
</div></td>
</tr>
</tbody>
</table>
<br>
<% gname1=nosql(replace(request("gname"),"'",""))
mprice=clng(request("mprice"))
leprice=clng(request("leprice"))
num=clng(request("num"))
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from telorder_goods where t_id='"&t_id1&"' and gname='"&gname1&"'"
rs.open sql,conn,1,3
if rs.eof and gname1<>"" then
rs.addnew
rs("t_id")=t_id1
rs("gname")=gname1
rs("mprice")=mprice
rs("leprice")=leprice
rs("num")=num
rs.update
else
rs.close
set rs=nothing
end if
%>
<table bgcolor=#FFFFFF border=0 cellpadding=3 cellspacing=1
width="99%" align="center" class="9bang">
<%set rs = conn.execute("select * from telorder_goods where t_id="&t_id1&"")
if not rs.eof then %>
<tr bgcolor="#FFFFFF">
<td colspan="5" bgcolor="#E8F1FF" class="008c5e"> <div align="center">购物车内商品列表</div></td>
</tr>
<tbody>
<tr bgcolor="#f1f1f1">
<td width=37% height="17" bgcolor="#E8F1FF" class="008c5e">
<div align="center">商品名称</div></td>
<td width=23% height="17" bgcolor="#E8F1FF" class="008c5e">
<div align="center">市场价格</div></td>
<td width=19% height="17" bgcolor="#E8F1FF" class="008c5e">
<div align="center">会员价格</div></td>
<td width=12% height="17" bgcolor="#E8F1FF" class="008c5e">
<div align="center">数量</div></td>
<td width=9% height="17" bgcolor="#E8F1FF" class="008c5e">
<div align="center">删除</div></td>
</tr>
<%
While NOT rs.EOF
%>
<tr>
<td bgcolor=#E8F1FF width=37% class="008c5e" height="18"> <div align="center"><%=rs("gname")%></div></td>
<td bgcolor=#E8F1FF width=23% class="008c5e" height="18"> <div align="center"><%=rs("mprice")%></div></td>
<td bgcolor=#E8F1FF width=19% class="008c5e" height="18"> <div align="center"><%=rs("leprice")%></div></td>
<td bgcolor=#E8F1FF class="008c5e" width="12%" height="18"> <div align="center"><%=rs("num")%></div></td>
<td bgcolor=#E8F1FF class="008c5e" width="9%" height="18"><div align="center"><a href=del.asp?x=a&id=<%=rs("t_t_id")%>>删除</a></div></td>
</tr>
<%
rs.MoveNext()
Wend
end if %>
</tbody>
</table>
<input type="hidden" name="MM_insert" value="true">
</form></td>
</tr>
</table>
</body>
</html>
<%
rs.Close
set rs=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -