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

📄 changehw.asp

📁 ASP+ACCESS 产品报价系统 开发环境简单 主要是周杰伦FANs的交互活动
💻 ASP
字号:
<% @ LANGUAGE="VBSCRIPT" %>
<%
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>
<%
dim hw_id ,hw_name,hw_cash,hw_pic,hw_date,sort_id,hw_content,hw_content2,he_views,he_buys,chubsh,zhuang,hw_sn,company,yeshu,kaiben,isbn,pifa,daili,data
set rs=server.createobject("adodb.recordset")
sql="select * from hw where hw_id="&request("hw_id") 
rs.open sql,conn,1,1
      hw_id=rs("hw_id")
      hw_name=rs("hw_name")
      hw_cash=rs("hw_cash")
      hw_pic=rs("hw_pic")
      hw_date=rs("hw_date")
hw_sn=rs("hw_sn")
      sort_id=rs("sort_id")
Nsort_id=rs("Nsort_id")
tuijian=rs("tuijian")
      hw_content=rs("hw_content")
	  hw_content2=rs("hw_content2")
      hw_views=rs("hw_views")
      hw_buys=rs("hw_buys")
      chubsh=rs("chubsh")
      zhuang=rs("zhuang")
      hw_sn=rs("hw_sn")
      company=rs("company")
      yeshu=rs("yeshu")
      kaiben=rs("kaiben")
      isbn=rs("isbn")
pifa=rs("pifa")
daili=rs("daili")
data=rs("data")
rs.close
%>
<%
if request("action")="save" then
    hw_name=request("hw_name")
    hw_content=request("hw_content")
	hw_content2=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")
tuijian=request("tuijian")
    company=request("company")
   pifa=request("pifa")
daili=request("daili")
hw_sn=request("hw_sn")
data=request("data")
kaiben=request("kaiben")
    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_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>")        
        
        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("hw_content")=hw_content
		rs("hw_content2")=hw_content2
        rs("hw_cash")=hw_cash
        rs("sort_id")=sort_id
       rs("company")=company
       rs("daili")=daili
       rs("pifa")=pifa
       rs("hw_sn")=hw_sn
	   rs("chubsh")=chubsh
	   rs("kaiben")=kaiben
	   rs("yeshu")=yeshu
	   rs("data")=data
	   rs("isbn")=isbn
	   rs("zhuang")=zhuang
        rs("hw_pic")=hw_pic
rs("Nsort_id")=Nsort_id
rs("tuijian")=tuijian
        rs.update
    end if
    response.write "商品修改成功!"
    response.write "<br>"
    response.write "<a href=delhw.asp>返回</a>"
    rs.close
    

else
%>



<form name="form1" method="post" action="changehw.asp?hw_id=<%=hw_id%>&action=save">
  <table width="60%" border="0" cellpadding="3" cellspacing="1" bgcolor="#378d02">
    <tr bgcolor="#99cc00"> 
      <td colspan="2"> 
        <div align="center"><strong>商品修改</strong></div></td>
    </tr>
    <tr bgcolor="#eef7ee"> 
      <td colspan="2"><font color="#FF0000">手机名称</font> 
        <input type="text" name="hw_name" size="10" class=biaodan value="<%=hw_name%>"> 
        <font color="#FF0000"> &nbsp;&nbsp;&nbsp;&nbsp; 手机型号</font> <select class="beizhu" name="sort_id" size="1">
          <%
	dim rs,sql
	dim content,sel
	sort_id=request("sort_id")
	Nsort_id=request("Nsort_id")
 	set rs=server.createobject("adodb.recordset")
  	sql="select * from sort"
 	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "Not record."
	else
	do while not rs.eof
        if sort_id=cstr(rs("sort_id")) then
               sel="selected"
        else
               sel=""
        end if	
	response.write "<option " & sel & " value='"+CStr(rs("sort_ID"))+"' name=sort_id>"+rs("sort_name")+"</option>"+chr(13)+chr(10)
	rs.movenext
    	loop
	end if
	rs.close
%>
        </select> &nbsp;&nbsp;<font color="#FF0000">选择分类</font> <select name="Nsort_id" size="1" class="beizhu">
          <%
  	sql="select * from Nsort"
 	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "Not record."
	else
        do while not rs.eof
        if Nsort_id=cstr(rs("Nsort_id")) then
               sel="selected"
        else
               sel=""
        end if	
        response.write "<option " & sel & " value='" +  Cstr(rs("Nsort_id")) + "'>" + rs("Nsort_name") + "</option>"
        rs.MoveNext
        Loop
	end if
        rs.close
%>
        </select> <font color="#FF0000">** </font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"><font color="#FF0000">手机原价</font> <input type="text" name="pifa" size="7" class=biaodan value="<%=pifa%>">
        元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;会员价格</font> <input type="text" name="hw_cash" size="7" class=biaodan value="<%=hw_cash%>">
        元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;VIP价格 </font> <input type="text" name="daili" size="7" class=biaodan value="<%=daili%>">
        元 </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="5" colspan="2" bgcolor="#eef7ee">&nbsp; </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="27%"><font color="#FF0000">作者:</font> <font color="#FF0000"> 
        <input type="text" name="hw_sn" size="10" class=biaodan value="<%=hw_sn%>">
        </font></td>
      <td width="73%"><font color="#FF0000">出版社名:</font> <font color="#FF0000"> 
        <input type="text" name="chubsh" size="15" class=biaodan value="<%=chubsh%>">
        </font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="27%"><font color="#FF0000">页数:</font> <font color="#FF0000"> 
        <input type="text" name="yeshu" size="10" class=biaodan value="<%=yeshu%>">
        </font></td>
      <td width="73%" bgcolor="#eef7ee"><font color="#FF0000">出版日期:</font> <font color="#FF0000"> 
        <input type="text" name="data" size="15" class=biaodan value="<%=data%>">
        <font color="#999999">格式:2002-10-10</font></font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="27%"><font color="#FF0000">颜色:</font> <font color="#FF0000"> 
        <input type="text" name="kaiben" size="10" class=biaodan value="<%=kaiben%>">
        </font></td>
      <td width="73%"><font color="#FF0000">ISBN号码:</font> <font color="#FF0000"> 
        <input type="text" name="isbn" size="15" class=biaodan value="<%=isbn%>">
        </font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="5" 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="<%=zhuang%>"> 
      </td>
    </tr>
    <tr bgcolor="#eef7ee"> 
      <td><font color="#FF0000">简单内容介绍: </font></td>
      <td bgcolor="#eef7ee"><div align="center"><font color="#FF0000"> 
          <textarea rows="3" name="hw_content" cols="40" class=beizhu><%=hw_content%></textarea>
          </font></div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td valign="top" colspan="2">&nbsp; </td>
    </tr>
    <tr bgcolor="#eef7ee"> 
      <td valign="top"><font color="#FF0000">详细内容介绍: </font></td>
      <td valign="top" bgcolor="#eef7ee"><div align="center"><font color="#FF0000"> 
          <textarea rows="5" name="hw_content2" cols="40" class=beizhu><%=hw_content2%></textarea>
          </font></div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td valign="top" colspan="2">&nbsp; </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" bgcolor="#eef7ee"> <font color="#FF0000">商品图片:</font> 
        <input type="text" name="hw_pic" size="25" class=biaodan value="<%=hw_pic%>"> 
        <a href="up.asp" target="_blank">上传图片</a></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" height="24"> <input type="radio" name="tuijian" value="-1">
        推荐此商品 
        <input type="radio" name="tuijian" value="0" checked>
        不推荐</td>
    </tr>
    <tr bgcolor="#FFFFFF" align="center"> 
      <td colspan="2" bgcolor="#eef7ee"> 
        <input name="Submit" type="submit" class="tijiao" value="修改">
          <input name="Submit2" type="reset" class="tijiao" value="取消"> </td>
    </tr>
  </table>
</form>
<%
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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