📄 input_product_sav.asp
字号:
<html>
<!-- #include file="../common/conn.asp" -->
<!-- #include file="../common/status.html" -->
<head>
<title>输入产品信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<% if session("admin_id")="" then %>
您还没有登录,五秒钟后自动返回登录,如果您的浏览器没有自动返回,请<a href="../admin/login.html">点击登录</a>。
<meta http-equiv="refresh" content="5;url=login.html">
<% else %>
</head>
<body background="../img/inputBG.gif">
<%
dim id,isdel,rs,sql,num,brand,serial,cpu,mainboard,memory,videocard,soundcard,monitor,harddisk,drives,battery,price,repairtime,picpath,remark
set rs=server.createobject("adodb.recordset")
if trim(request("Num"))="" then
errmsg=errmsg+"<br>"+"<li>产品型号不能为空"
founderr=true
else
num=trim(request("Num"))
end if
sql="select * from scott.product_info where product_num='"&num&"'"
rs.open sql,connstr
if not rs.eof then
errmsg=errmsg+"<br>"+"<li>已经有这个产品的信息了"
founderr=true
end if
rs.close
if trim(request("Brand"))="" then
errmsg=errmsg+"<br>"+"<li>产品品牌不能为空"
founderr=true
else
brand=trim(request("Brand"))
end if
if trim(request("Serial"))="" then
errmsg=errmsg+"<br>"+"<li>产品系列不能为空"
founderr=true
else
serial=trim(request("Serial"))
end if
if trim(request("CPU"))="" then
errmsg=errmsg+"<br>"+"<li>产品CPU不能为空"
founderr=true
else
cpu=trim(request("CPU"))
end if
if trim(request("Mainboard"))="" then
errmsg=errmsg+"<br>"+"<li>产品主板不能为空"
founderr=true
else
mainboard=trim(request("Mainboard"))
end if
if trim(request("Memory"))="" then
errmsg=errmsg+"<br>"+"<li>产品内存不能为空"
founderr=true
else
memory=trim(request("Memory"))
end if
if trim(request("VideoCard"))="" then
errmsg=errmsg+"<br>"+"<li>产品显卡不能为空"
founderr=true
else
videocard=trim(request("VideoCard"))
end if
if trim(request("SoundCard"))="" then
errmsg=errmsg+"<br>"+"<li>产品声卡不能为空"
founderr=true
else
soundcard=trim(request("SoundCard"))
end if
if trim(request("Monitor"))="" then
errmsg=errmsg+"<br>"+"<li>产品显示器不能为空"
founderr=true
else
monitor=trim(request("Monitor"))
end if
if trim(request("Harddisk"))="" then
errmsg=errmsg+"<br>"+"<li>产品硬盘不能为空"
founderr=true
else
harddisk=trim(request("Harddisk"))
end if
if trim(request("Drives"))="" then
errmsg=errmsg+"<br>"+"<li>产品驱动器不能为空"
founderr=true
else
drives=trim(request("Drives"))
end if
if trim(request("Battery"))="" then
errmsg=errmsg+"<br>"+"<li>产品电池使用时间不能为空"
founderr=true
else
battery=trim(request("Battery"))
end if
if trim(request("Price"))="" then
errmsg=errmsg+"<br>"+"<li>产品价格不能为空"
founderr=true
else
price=trim(request("Price"))
end if
if trim(request("RepairTime"))="" then
errmsg=errmsg+"<br>"+"<li>产品保修期不能为空"
founderr=true
else
repairtime=trim(request("RepairTime"))
end if
if trim(request("picpath"))="" then
picpath="propic/nopic.gif"
else
picpath=trim(request("PicPath"))
end if
remark=trim(request("Remark"))
%>
<div align="center">
<center>
<table border="0" width="750" cellspacing="0" cellpadding="0">
<%
if founderr=false then
sql="select * from scott.product_info order by product_id"
rs.open sql,connstr,3,3
if rs.eof then
id=1
else
rs.movelast
id=cint(rs("product_id"))+1
end if
rs.addnew
rs("product_id")=id
rs("product_num")=num
rs("product_brand")=brand
rs("product_serial")=serial
rs("product_cpu")=cpu
rs("product_mainboard")=mainboard
rs("product_memory")=memory
rs("product_videocard")=videocard
rs("product_soundcard")=soundcard
rs("product_monitor")=monitor
rs("product_harddisk")=harddisk
rs("product_drives")=drives
rs("product_battery")=battery
rs("product_price")=price
rs("product_repairtime")=repairtime
rs("product_picpath")=picpath
rs("product_remark")=remark
rs("product_isdel")="n"
rs("product_time")=now
rs("product_salenum")=0
rs("product_stocknum")=0
ptime=rs("product_time")
salenum=rs("product_salenum")
rs.update
rs.close
set rs=nothing
%>
<tr align="center">
<td height="30" colspan="4">产品信息输入成功</td>
</tr>
<tr>
<td height="150" colspan="2" rowspan="5" align="center" valign="middle"><img src="<%=picpath%>"></td>
<td height="30" align="right"> </td>
<td height="0"> </td>
</tr>
<tr>
<td height="30" align="right">产品型号:</td>
<td height="0"><%=num%></td>
</tr>
<tr>
<td height="30" align="right">产品品牌:</td>
<td height="0"><%=brand%></td>
</tr>
<tr>
<td height="30" align="right">产品系列:</td>
<td height="15"><%=serial%></td>
</tr>
<tr>
<td height="15" align="right">CPU:</td>
<td height="15"><%=cpu%></td>
</tr>
<tr>
<td width="30%" height="30" align="right">主板:</td>
<td width="20%" height="30"><%=mainboard%> </td>
<td width="20%" height="30" align="right">内存:</td>
<td width="30%" height="30"><%=memory%> </td>
</tr>
<tr>
<td height="30"><div align="right">显卡: </div></td>
<td height="30"><%=videocard%> </td>
<td height="30"><div align="right">声卡:</div></td>
<td height="30"><%=soundcard%> </td>
</tr>
<tr>
<td height="30"><div align="right">显示器: </div></td>
<td height="30"><%=monitor%> </td>
<td height="30"><div align="right">硬盘: </div></td>
<td height="30"><%=harddisk%> </td>
</tr>
<tr>
<td height="30"><div align="right">驱动器: </div></td>
<td height="30"><%=drives%> </td>
<td height="30"><div align="right">电池使用时间: </div></td>
<td height="30"><%=battery%> </td>
</tr>
<tr>
<td height="30"><div align="right">价格: </div></td>
<td height="30"><%=price%> </td>
<td height="30"><div align="right">保修期: </div></td>
<td height="30"><%=repairtime%> </td>
</tr>
<tr>
<td height="30" align="right">添加时间:</td>
<td height="30"><%=ptime%></td>
<td height="30" align="right">销售数量:</td>
<td height="30"><%=salenum%></td>
</tr>
<tr>
<td height="50"><div align="right">备注:</div></td>
<td height="30" colspan="3"><%=remark%></td>
</tr>
<tr align="center">
<td height="30" colspan="4">
<a href="update_pro.asp">修改信息</a>
<a href="input_product.asp">继续输入</a>
<a href="index.asp">返回首页</a>
</td>
</tr>
<%else%>
<meta http-equiv="refresh" content="3;url=javascript:history.go(-1)">
<tr>
<td width="25%" height="20" align="center">输入信息有错误</td>
</tr>
<tr>
<td><%=errmsg%></td>
</tr>
<tr><td align="center"><a href='javascript:history.go(-1)'><font size="-1">三秒钟后自动返回到上一页,如果您的浏览器没有返回,请单击此处</font></a></td></tr>
<%end if%>
</table>
</center>
</div>
</body>
<% end if %>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -