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

📄 editgoods.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 rel="stylesheet" href="css.css" type="text/css">
</head>
<%
if request("action")="save" then
    hw_name=request("hw_name")
    leibie=request("leibie")
    hw_cash=request("hw_cash")
    hw_pic=request("hw_pic")
ISBN=request("ISBN")
xing=request("xing")
ping=request("ping")
lei=request("lei")
zuoze=request("zuoze")
hwsn=request("hwsn")
hw_oldcash=request("hw_oldcash")
tejia=request("tejia")
hw_content=request.form("hw_content")
    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 hw_cash="" then
        errmsg=errmsg+"<br>"+"<li>商品价格不能为空"
        founderr=true
    end if
   
    if hw_pic="" then hw_pic="img/no.jpg"
    
    if founderr=true then
        response.write errmsg
        response.write "<br>"
        response.write "<a href=addhw.asp>返回</a>"
        response.end
    else
       

        hw_pic=server.htmlencode(hw_pic)    
        
        sql="select * from hw where hw_id="&request("hw_id")
        rs.open sql,conn,3,3
        rs("hw_name")=hw_name
        rs("xing")=xing
        rs("ping")=ping
        rs("lei")=lei
        rs("leibie")=leibie
       if tejia="on" then   
       rs("tejia")=true
      else 
      rs("tejia")=false
      end if
        rs("hw_content")=hw_content
        rs("hw_cash")=hw_cash
rs("zuoze")=zuoze
rs("hw_oldcash")=hw_oldcash
       rs("hw_sn")=hwsn
       rs("ISBN")=ISBN
        rs("hw_pic")=hw_pic
        rs.update
    end if
    response.write "货物修改成功"
    response.write "<p>"%>
    <%response.write "<br>"
    response.write "<a href=delhw.asp>返回</a>"
    rs.close
    

else
%>
          <%   sql="select * from hw where hw_id="&request("hw_id")
    rs.open sql,conn,3,3
   tejia=rs("tejia")
hw_content=rs("hw_content")
%> 
<table border="0" width="100%" cellspacing="1">
  <tr>
    <td width="100%">
      <form method="POST" action="editgoods.asp?action=save"  name="myform">

          <table width="98%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
    <tr> 
      <td  bgcolor="#4296E7" colspan=2> 
        <div align="center"><font color="#FFFFFF">添加商品[如果不添则浏览时不显示]</font></div>
      </td>
    </tr>
    <input type="hidden" name="hw_id" size="20" class=input value="<%=rs("hw_id")%>">
                    <tr> 
            <td width="20%">规格属性</td><td width=80%>   
             <select name="leibie" size="1">
                <option value="作者">书籍</option>
                <option  value="演唱">磁带</option>
<option  value="演唱">CD</option><option  value="主演">影视</option> 
              </select>
            </td>
          </tr>
          <tr> 
            <td width="20%">商品名</td><td width=80%>  
<input type="text" name="hw_name" size="20" class=input maxlength=20 value="<%=rs("hw_name")%>"><font color=red>*必须(最长20个字)</font>
            </td>
          </tr>
          <tr> 
            <td width="20%">作者<font color=red>[主演、歌手]</font></td><td width=80%> 
              <input type="text" name="zuoze" size="20" class=input maxlength=20  value="<%=rs("zuoze")%>">(非必需,最长20个字)
            </td>
          </tr>
          <tr> 
            <td width="20%">出版社</td><td width=80%>  
              <input type="text" name="lei" size="20" class=input maxlength=20 value="<%=rs("lei")%>">(非必需,最长20个字)
            </td>
          </tr>
          <tr> 
            <td width="20%">出版日期</td><td width=80%>  
              <input type="text" name="xing" size="20" class=input maxlength=20 value="<%=rs("xing")%>">(非必需,最长20个字)
            </td>
          </tr>
          <tr> 
            <td width="20%">开本<font color=red>[配音/语种]</font></td><td width=80%>  
              <input type="text" name="ping" size="20" class=input maxlength=20 value="<%=rs("ping")%>">(非必需,最长20个字)
            </td>
          </tr>

                        <tr> 
            <td width="20%">页数</td><td width=80%>    
              <input type="text" name="hwsn" size="20" class=input maxlength=20 value="<%=rs("hw_sn")%>">(非必需,最长20个字)
            </td>
          </tr>
                        <tr> 
            <td width="20%">ISBN号码</td><td width=80%>     
              <input type="text" name="ISBN" size="20" class=input maxlength=20 value="<%=rs("ISBN")%>">(非必需,最长20个字)
            </td>
          </tr>
          <tr> 
            <td width="20%"> 商品原价</td><td width=80%>  
              <input type="text" name="hw_oldcash" size="20" class=input maxlength=10 value="<%=rs("hw_oldcash")%>">
              <font color="#FF0000">支持小数</font><font color=red>*必须</font> </td>
          </tr>

          <tr> 
            <td width="20%"> 商品现价</td><td width=80%>  
              <input type="text" name="hw_cash" size="20" class=input  maxlength=10 value="<%=rs("hw_cash")%>">
              <font color="#FF0000">支持小数</font><font color=red>*必须</font> </td>
          </tr>
          <tr> 
            <td width="20%">是否特价</td><td width=80%>  
              <input type="checkbox" name="tejia"> 特价商品
            </td>
          </tr>

          <tr> 
            <td width="100%" colspan=2>商品介绍</td>
          </tr>
          <tr> 
            <td width="100%" colspan=2> 
              <textarea rows="9" name="hw_content" cols="77" class=input><%=rs("hw_oldcash")%></textarea><font color=red>*必须</font>
            </td>
          </tr>
          <tr> 
            <td width="100%" colspan=2>商品图片 <input type="text" name="hw_pic" size="75" class=input  maxlength=100  value="<%=rs("hw_pic")%>"><iframe name=ad frameborder=0 width=480 height=150 scrolling=no src=../upload1.asp></iframe> 
            </td>
          </tr>


        </table>
        <p><input type="submit" value="提交" name="B1" class=input><input type="reset" value="全部重写" name="B2" class=input></p>
      </form>
        </td>
  </tr>
</table>

<%rs.close
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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