⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addhw.asp

📁 一套完整的毕业论文。物资管理信息系统。 请大家指点
💻 ASP
字号:
<%
if session("admin_name")="" then response.end
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=../style.css rel=STYLESHEET type=text/css>
</head>

<%
if request("action")="save" then
    hw_name=request("hw_name")
    hw_content=request("hw_content")
    hw_cash=request("hw_cash")
    hw_pic=request("hw_pic")
    sort_id=request("sort_id")
    hw_oldcash=request("hw_oldcash")
    if not(isnumeric(hw_cash)) then
        errmsg="<br>"+"<li>货物的价格应该为数字"
        founderr=true
    end if
    if hw_name="" then
        errmsg=errmsg+"<br>"+"<li>货物名称不能为空"
        founderr=true
    end if
    if hw_content="" then
        errmsg=errmsg+"<Br>"+"<li>货物介绍不能为空"
        founderr=true
    end if
    if sort_id="" then
        errmsg=errmsg+"<br>"+"<li>货物类别不能为空"
        founderr=true
    end if
    if hw_oldcash="" then
        errmsg=errmsg+"<br>"+"<li>货物原价不能为空"
        founderr=true
    end if
    
    
    if hw_pic="" then hw_pic="images/noimage.gif"
    
    if founderr=true then
        response.write errmsg
        response.write "<br>"
        response.write "<a href=addhw.asp>返回</a>"
        response.end
    else
        hw_name=server.htmlencode(hw_name)
        hw_name=replace(hw_name," ","&nbsp;")
        hw_name=replace(hw_name,chr(13)&chr(10),"<Br>")
        
        
        hw_content=server.htmlencode(hw_content)
        hw_content=replace(hw_content," ","&nbsp;")
        hw_content=replace(hw_content,chr(13)&chr(10),"<Br>")        
        
        hw_pic=server.htmlencode(hw_pic)    
        
        sql="select * from hw"
        rs.open sql,conn,3,3
        rs.addnew
        rs("hw_name")=hw_name
        rs("hw_content")=hw_content
        rs("hw_cash")=hw_cash
        rs("sort_id")=sort_id
        rs("hw_oldcash")=hw_oldcash
        rs("hw_pic")=hw_pic
        rs.update
    end if
    response.write "货物添加成功"
    response.write "<br>"
    response.write "<a href=addhw.asp>返回</a>"
    rs.close
    

else
%>


<table border="0" width="100%" cellspacing="1">
  <tr>
    <td width="100%">
      <form method="POST" action="addhw.asp?action=save">
        <table border="0" width="100%" cellspacing="1">
          <tr>
            <td width="100%">商品类别<select size="1" name="sort_id">
                <%
                sql="select * from sort"
                rs.open sql,conn,3,3
                if rs.eof then
                    %><option value=""></option>
                <%else
                    do while not rs.eof%>
                    <option value="<%=rs("sort_id")%>"><%=rs("sort_name")%></option><%rs.movenext
                    loop
                end if
                rs.close%>
              </select></td>
          </tr>
          <tr>
            <td width="100%">商品名称<input type="text" name="hw_name" size="20" class=input></td>
          </tr>
          <tr>
            <td width="100%">商品原价<input type="text" name="hw_oldcash" size="20" class=input></td>
          </tr>
          <tr>
            <td width="100%">商品价格<input type="text" name="hw_cash" size="20" class=input><font color="#FF0000">不支持小数,小数点后四舍五入</font></td>
          </tr>
          <tr>
            <td width="100%">商品介绍</td>
          </tr>
          <tr>
            <td width="100%"><textarea rows="9" name="hw_content" cols="77" class=input></textarea></td>
          </tr>
          <tr>
            <td width="100%">商品图片<input type="text" name="hw_pic" size="46" class=input></td>
          </tr>
        </table>
        <p><input type="submit" value="提交" name="B1" class=input><input type="reset" value="全部重写" name="B2" class=input></p>
      </form>
       <iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src=upload.asp></iframe> </td>
  </tr>
</table>
<%
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -