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

📄 changehw1.jsp

📁 jsp做的网络购物系统 功能全面 有用户界面和管理界面 供大家学习哦
💻 JSP
字号:
<!--#include file="conn.asp"-->
<%
  if session("admin")="" then
  response.redirect "admin.asp"
  end if
%><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=../css.css rel=STYLESHEET type=text/css>
</head>
<%
dim hw_id ,hw_name,hw_cash,hw_pic,hw_date,sort_id,hw_content,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")
      hw_content=rs("hw_content")
      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_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")
hw_sn=request("hw_sn")
data=request("data")
kaiben=request("kaiben")
tuijian=request("tuijian")
    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>")        
        
        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_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")=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("tuijian")=tuijian
        rs.update
    end if
    response.write "商品修改成功!"
    response.write "<br>"
    response.write "<a href=delhw.asp>返回</a>"
    rs.close
else
%>




<table width="500" border="0" cellspacing="0" cellpadding="0" align="center" height="100" bgcolor="6894d8">
  <tr> 
    <td height="175"> 
      <form name="form1" method="post" action="changehw.asp?hw_id=<%=hw_id%>&action=save">
        <table border="0" width="100%" cellspacing="1">
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"><font color="#FF0000">商品名称</font> 
              <input type="text" name="hw_name" size="20" class=input value="<%=hw_name%>">
              <font color="#FF0000"> &nbsp;&nbsp;&nbsp;&nbsp; 商品类别 </font>
<select class="smallSel" name="sort_id" size="1">		  	  
<%
	dim rs,sql,sel
	dim content
	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;选择分类: <select name="Nsort_id" size="1">
<%
  	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>**
</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"><font color="#FF0000">商品原价</font> 
              <input type="text" name="pifa" size="7" class=input value="<%=pifa%>">
              元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;会员价格</font> 
              <input type="text" name="hw_cash" size="7" class=input value="<%=hw_cash%>">
              元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;VIP价格 </font> 
              <input type="text" name="daili" size="7" class=input value="<%=daili%>">
              元 </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="5" colspan="2"> 
              <hr noshade size="1">
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="25%">作者 
              <input type="text" name="hw_sn" size="10" class=input value="<%=hw_sn%>">
            </td>
            <td width="75%"> 公司
<input type="text" name="chubsh" size="30" class=input value="<%=chubsh%>">
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="25%">尺码
<input type="text" name="yeshu" size="10" class=input value="<%=yeshu%>">
            </td>
            <td width="75%">出版日期 
              <input type="text" name="data" size="24" class=input value="<%=data%>">
              格式:2002-10-10</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="25%">颜色
<input type="text" name="kaiben" size="10" class=input value="<%=kaiben%>">
            </td>
            <td width="75%"> 编号
<input type="text" name="isbn" size="30" class=input value="<%=isbn%>">
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="5" colspan="2"> 
              <hr noshade size="1">
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"> 包装类型 
              <input type="text" name="zhuang" size="30" class=input value="<%=zhuang%>">
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"> <font color="#FF0000">内容简介 </font></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign="top" colspan="2"> 
              <textarea rows="3" name="hw_content" cols="50" class=input><%=hw_content%></textarea>
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"> <font color="#FF0000">商品图片</font> 
              <input type="text" name="hw_pic" size="46" class=input value="<%=hw_pic%>">
              <a href="../up/index.asp" target="_blank"><font color="#FF0000">图形上传</font></a></td>
          </tr>
          <tr bgcolor="#FFFFFF" align="center"> 
            <td colspan="2"> 
              <input type="submit" name="Submit" value="修改">
            </td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
</table>

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

⌨️ 快捷键说明

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