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

📄 addhw.asp

📁 ASP+ACCESS 产品报价系统 开发环境简单 主要是周杰伦FANs的交互活动
💻 ASP
字号:
<!--#include file="char.inc"-->
<%
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=../css.css rel=STYLESHEET type=text/css>
<link href="../img/style.css" rel="stylesheet" type="text/css">
</head>
<%
if request("action")="save" then
    hw_name=request("hw_name")
    hw_content=htmlencode2(request("hw_content"))
	hw_content2=htmlencode2(request("hw_content2"))
    hw_cash=request("hw_cash")
    hw_pic=request("hw_pic")
	chubsh=request("chubsh")
	zhuang=request("zhuang")
	yeshu=request("yeshu")
	isbn=request("isbn")
    sort_id=request("sort_id")
  Nsort_id=request("Nsort_id")
    company=request("company")
   pifa=request("pifa")
daili=request("daili")
hwsn=request("hwsn")
data=request("data")
kaiben=request("kaiben")
tuijian=request("tuijian")
jia=request("jia")
    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 nsort_id="" then
        errmsg=errmsg+"<br>"+"<li>类别不能为空"
        founderr=true
    end if
    if hw_pic="" then hw_pic="img/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>")        
        
       
        sql="select * from hw"
        rs.open sql,conn,3,3
        rs.addnew
        rs("hw_name")=hw_name
        rs("hw_content")=hw_content
		rs("hw_content2")=hw_content2
        rs("hw_cash")=hw_cash
        rs("sort_id")=sort_id
  rs("Nsort_id")=Nsort_id
  
       rs("company")=company
       rs("daili")=daili
       rs("pifa")=pifa
       rs("hw_sn")=hwsn
	   rs("chubsh")=chubsh
	   rs("kaiben")=kaiben
	   rs("yeshu")=yeshu
	   rs("data")=data
	   rs("isbn")=isbn
	   rs("zhuang")=zhuang
        rs("hw_pic")=hw_pic
        rs("tuijian")=tuijian
        rs("jia")=jia
        rs.update
    end if
    response.write "货物添加成功"
    response.write "<br>"
    response.write "<a href=addhw.asp>返回</a>"
    rs.close
    

else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<title>添 加 商 品</title>
<link rel="stylesheet" type="text/css" href="style.css">
<%
dim count

set rs=server.createobject("adodb.recordset")
sql = "select * from  Nsort  order by Nsort_id asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("Nsort_name"))%>","<%= trim(rs("sort_id"))%>","<%= trim(rs("Nsort_id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.Nsort_id.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.Nsort_id.options[document.myform.Nsort_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
</head>

<body>
<tr> 
  <td>&nbsp;</td>
</tr>
<form method="POST" name="myform" action="addhw.asp?action=save">
  <table border="0" cellspacing="1" width="67%">
    
      <td width="85%">      
        <%
        sql = "select * from sort"
        rs.open sql,conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else%>
<select name="sort_id" size="1" class="beizhu" onChange="changelocation(document.myform.sort_id.options[document.myform.sort_id.selectedIndex].value)">
          <option selected value="<%=trim(rs("sort_id"))%>"><%=trim(rs("sort_name"))%></option>
<%      dim selclass
         selclass=rs("sort_id")
        rs.movenext
        do while not rs.eof
%> <option value="<%=trim(rs("sort_id"))%>"><%=trim(rs("sort_name"))%></option>
<%rs.movenext
        loop
	end if
        rs.close
%></select> 
<select name="Nsort_id">                  
<%sql="select * from Nsort where sort_id="&selclass
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
        <option selected value="<%=rs("Nsort_ID")%>"><%=rs("Nsort_name")%></option>
<% rs.movenext
do while not rs.eof%>
        <option value="<%=rs("Nsort_ID")%>"><%=rs("Nsort_name")%></option>
<% rs.movenext
loop
end if
        rs.close
        set rs = nothing%>

  </tr>
</table>

      
  <table width="67%" border="0" align="left" cellpadding="5" cellspacing="1" bgcolor="378d02">
    <tr bgcolor="#eef7ee"> 
      <td colspan="2"><font color="#FF0000">型号名称</font> 
        <input type="text" name="hw_name" size="30" class=biaodan>
        <font color="#FF0000"> &nbsp;&nbsp;&nbsp;&nbsp; </font> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"><font color="#FF0000">市场价:</font> 
        <input type="text" name="pifa" size="5" class=biaodan>
        (元) <font color="#FF0000">会员价:</font> <input type="text" name="hw_cash" size="5" class=biaodan>
        (元) <font color="#FF0000">&nbsp;VIP价:</font> <input type="text" name="daili" size="5" class=biaodan>
        (元) </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" bgcolor="#eef7ee">&nbsp;</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="30%"><font color="#FF0000">录入:</font> 
        <input type="text" name="hwsn" size="7" class=biaodan value="不详"> 
      </td>
      <td width="70%"><font color="#FF0000">出品公司:</font> 
        <input type="text" name="chubsh" size="12" class=biaodan value="不详"> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td bgcolor="#eef7ee"><font color="#FF0000">尺码:</font> 
        <input type="text" name="kaiben" size="7" class=biaodan value="16"> 
      </td>
      <td width="70%" bgcolor="#eef7ee"><font color="#FF0000">出品日期:</font> 
        <input type="text" name="data" size="12" class=biaodan value="2002-10-10">
        格式:2002-10-10</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td><font color="#FF0000">颜色:</font> 
        <input type="text" name="yeshu" size="7" class=biaodan value="100"> 
      </td>
      <td width="70%"><font color="#FF0000">手机编号:</font> 
        <input type="text" name="isbn" size="12" class=biaodan value="不详"> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" bgcolor="#eef7ee">&nbsp;</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"> <font color="#FF0000">包装类型:</font> <input type="text" name="zhuang" size="30" class=biaodan value="普通"> 
      </td>
    </tr>
    <tr bgcolor="#eef7ee"> 
      <td> <font color="#FF0000">简单内容介绍:</font></td>
      <td bgcolor="#eef7ee">
<textarea rows="3" name="hw_content" cols="45" class=beizhu>暂时没有……</textarea></td>
    </tr>
    <tr> 
      <td colspan="2" valign="top" bgcolor="#FFFFFF">&nbsp; </td>
    </tr>
    <tr> 
      <td valign="top" bgcolor="#eef7ee"><font color="#FF0000">详细内容介绍:</font></td>
      <td valign="top" bgcolor="#eef7ee"><textarea rows="3" name="hw_content2" cols="45" class=beizhu>暂时没有……</textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" valign="top"><font color="#FF0000">添加图片:
        <input name="hw_pic" type="text" id="hw_pic" size="20">
        <font color="#999999">(格式为:pic/t28.gif)</font></font></td>
    </tr>
    <tr> 
      <td colspan="2" bgcolor="#eef7ee"><font color="#FF0000">推荐此商品</font> <input type="radio" name="tuijian" value="-1"> 
        <font color="#FF0000">不推荐</font> <input type="radio" name="tuijian" value="0" checked> 
        <font color="#FF0000">是特价</font> <input type="radio" name="jia" value="1"> 
        <font color="#FF0000"> 否特价 </font> <input name="jia" type="radio" value="0" checked> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" bgcolor="#FFFFFF"> <div align="center"> 
          <input type="submit" value="提交" name="B1" class=tijiao>
            
          <input type="reset" value="取消" name="B2" class=tijiao>
        </div></td>
    </tr>
  </table>
      <div align="left"></div></form>

 
</body>
</html>

<%end if%>

⌨️ 快捷键说明

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