changehw1.jsp
上传用户:helenhuo66
上传日期:2007-06-01
资源大小:865k
文件大小:8k
源码类别:

百货/超市行业

开发平台:

Java

  1. <!--#include file="conn.asp"-->
  2. <%
  3.   if session("admin")="" then
  4.   response.redirect "admin.asp"
  5.   end if
  6. %><head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  8. <link href=../css.css rel=STYLESHEET type=text/css>
  9. </head>
  10. <%
  11. 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
  12. set rs=server.createobject("adodb.recordset")
  13. sql="select * from hw where hw_id="&request("hw_id") 
  14. rs.open sql,conn,1,1
  15.       hw_id=rs("hw_id")
  16.       hw_name=rs("hw_name")
  17.       hw_cash=rs("hw_cash")
  18.       hw_pic=rs("hw_pic")
  19.       hw_date=rs("hw_date")
  20. hw_sn=rs("hw_sn")
  21.       sort_id=rs("sort_id")
  22.  Nsort_id=rs("Nsort_id")
  23.       hw_content=rs("hw_content")
  24.       hw_views=rs("hw_views")
  25.       hw_buys=rs("hw_buys")
  26.       chubsh=rs("chubsh")
  27.       zhuang=rs("zhuang")
  28.       hw_sn=rs("hw_sn")
  29.       company=rs("company")
  30.       yeshu=rs("yeshu")
  31.       kaiben=rs("kaiben")
  32.       isbn=rs("isbn")
  33. pifa=rs("pifa")
  34. daili=rs("daili")
  35. data=rs("data")
  36. rs.close
  37. %>
  38. <%
  39. if request("action")="save" then
  40.     hw_name=request("hw_name")
  41.     hw_content=request("hw_content")
  42.     hw_cash=request("hw_cash")
  43.     hw_pic=request("hw_pic")
  44. chubsh=request("chubsh")
  45. zhuang=request("zhuang")
  46. yeshu=request("yeshu")
  47. isbn=request("isbn")
  48.     sort_id=request("sort_id")
  49. Nsort_id=request("Nsort_id")
  50.     company=request("company")
  51.    pifa=request("pifa")
  52. daili=request("daili")
  53. hw_sn=request("hw_sn")
  54. data=request("data")
  55. kaiben=request("kaiben")
  56. tuijian=request("tuijian")
  57.     if not(isnumeric(hw_cash)) then
  58.         errmsg="<br>"+"<li>图书的价格应该为数字"
  59.         founderr=true
  60.     end if
  61.     if hw_name="" then
  62.         errmsg=errmsg+"<br>"+"<li>图书名称不能为空"
  63.         founderr=true
  64.     end if
  65.     if hw_content="" then
  66.         errmsg=errmsg+"<Br>"+"<li>图书介绍不能为空"
  67.         founderr=true
  68.     end if
  69.     if sort_id="" then
  70.         errmsg=errmsg+"<br>"+"<li>图书类别不能为空"
  71.         founderr=true
  72.     end if
  73. if Nsort_id="" then
  74.         errmsg=errmsg+"<br>"+"<li>图书类别不能为空"
  75.         founderr=true
  76.     end if
  77.    
  78.     
  79.     if hw_pic="" then hw_pic="img/noimage.gif"
  80.     
  81.     if founderr=true then
  82.         response.write errmsg
  83.         response.write "<br>"
  84.         response.write "<a href=addhw.asp>返回</a>"
  85.         response.end
  86.     else
  87.         hw_name=server.htmlencode(hw_name)
  88.         hw_name=replace(hw_name," ","&nbsp;")
  89.         hw_name=replace(hw_name,chr(13)&chr(10),"<Br>")
  90.         
  91.         
  92.         hw_content=server.htmlencode(hw_content)
  93.         hw_content=replace(hw_content," ","&nbsp;")
  94.         hw_content=replace(hw_content,chr(13)&chr(10),"<Br>")        
  95.         
  96.         hw_pic=server.htmlencode(hw_pic)    
  97.         
  98.         sql="select * from hw where hw_id="&request("hw_id")
  99.         rs.open sql,conn,3,3
  100.         rs("hw_name")=hw_name
  101.         rs("hw_content")=hw_content
  102.         rs("hw_cash")=hw_cash
  103.         rs("sort_id")=sort_id
  104. rs("Nsort_id")=Nsort_id
  105.        rs("company")=company
  106.        rs("daili")=daili
  107.        rs("pifa")=pifa
  108.        rs("hw_sn")=hw_sn
  109.    rs("chubsh")=chubsh
  110.    rs("kaiben")=kaiben
  111.    rs("yeshu")=yeshu
  112.    rs("data")=data
  113.    rs("isbn")=isbn
  114.    rs("zhuang")=zhuang
  115.         rs("hw_pic")=hw_pic
  116. rs("tuijian")=tuijian
  117.         rs.update
  118.     end if
  119.     response.write "商品修改成功!"
  120.     response.write "<br>"
  121.     response.write "<a href=delhw.asp>返回</a>"
  122.     rs.close
  123. else
  124. %>
  125. <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" height="100" bgcolor="6894d8">
  126.   <tr> 
  127.     <td height="175"> 
  128.       <form name="form1" method="post" action="changehw.asp?hw_id=<%=hw_id%>&action=save">
  129.         <table border="0" width="100%" cellspacing="1">
  130.           <tr bgcolor="#FFFFFF"> 
  131.             <td colspan="2"><font color="#FF0000">商品名称</font> 
  132.               <input type="text" name="hw_name" size="20" class=input value="<%=hw_name%>">
  133.               <font color="#FF0000"> &nbsp;&nbsp;&nbsp;&nbsp; 商品类别 </font>
  134. <select class="smallSel" name="sort_id" size="1">      
  135. <%
  136. dim rs,sql,sel
  137. dim content
  138. sort_id=request("sort_id")
  139. Nsort_id=request("Nsort_id")
  140.   set rs=server.createobject("adodb.recordset")
  141.    sql="select * from sort"
  142.   rs.open sql,conn,1,1
  143. if rs.eof and rs.bof then
  144. response.write "Not record."
  145. else
  146. do while not rs.eof
  147.         if sort_id=cstr(rs("sort_id")) then
  148.                sel="selected"
  149.         else
  150.                sel=""
  151.         end if
  152. response.write "<option " & sel & " value='"+CStr(rs("sort_ID"))+"' name=sort_id>"+rs("sort_name")+"</option>"+chr(13)+chr(10)
  153. rs.movenext
  154.      loop
  155. end if
  156. rs.close
  157. %>        
  158. </select>
  159. &nbsp;&nbsp;选择分类: <select name="Nsort_id" size="1">
  160. <%
  161.    sql="select * from Nsort"
  162.   rs.open sql,conn,1,1
  163. if rs.eof and rs.bof then
  164. response.write "Not record."
  165. else
  166.         do while not rs.eof
  167.         if Nsort_id=cstr(rs("Nsort_id")) then
  168.                sel="selected"
  169.         else
  170.                sel=""
  171.         end if
  172.         response.write "<option " & sel & " value='" +  Cstr(rs("Nsort_id")) + "'>" + rs("Nsort_name") + "</option>"
  173.         rs.MoveNext
  174.         Loop
  175. end if
  176.         rs.close
  177. %>
  178.       </select>**
  179. </td>
  180.           </tr>
  181.           <tr bgcolor="#FFFFFF"> 
  182.             <td colspan="2"><font color="#FF0000">商品原价</font> 
  183.               <input type="text" name="pifa" size="7" class=input value="<%=pifa%>">
  184.               元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;会员价格</font> 
  185.               <input type="text" name="hw_cash" size="7" class=input value="<%=hw_cash%>">
  186.               元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;VIP价格 </font> 
  187.               <input type="text" name="daili" size="7" class=input value="<%=daili%>">
  188.               元 </td>
  189.           </tr>
  190.           <tr bgcolor="#FFFFFF"> 
  191.             <td height="5" colspan="2"> 
  192.               <hr noshade size="1">
  193.             </td>
  194.           </tr>
  195.           <tr bgcolor="#FFFFFF"> 
  196.             <td width="25%">作者 
  197.               <input type="text" name="hw_sn" size="10" class=input value="<%=hw_sn%>">
  198.             </td>
  199.             <td width="75%"> 公司
  200. <input type="text" name="chubsh" size="30" class=input value="<%=chubsh%>">
  201.             </td>
  202.           </tr>
  203.           <tr bgcolor="#FFFFFF"> 
  204.             <td width="25%">尺码
  205. <input type="text" name="yeshu" size="10" class=input value="<%=yeshu%>">
  206.             </td>
  207.             <td width="75%">出版日期 
  208.               <input type="text" name="data" size="24" class=input value="<%=data%>">
  209.               格式:2002-10-10</td>
  210.           </tr>
  211.           <tr bgcolor="#FFFFFF"> 
  212.             <td width="25%">颜色
  213. <input type="text" name="kaiben" size="10" class=input value="<%=kaiben%>">
  214.             </td>
  215.             <td width="75%"> 编号
  216. <input type="text" name="isbn" size="30" class=input value="<%=isbn%>">
  217.             </td>
  218.           </tr>
  219.           <tr bgcolor="#FFFFFF"> 
  220.             <td height="5" colspan="2"> 
  221.               <hr noshade size="1">
  222.             </td>
  223.           </tr>
  224.           <tr bgcolor="#FFFFFF"> 
  225.             <td colspan="2"> 包装类型 
  226.               <input type="text" name="zhuang" size="30" class=input value="<%=zhuang%>">
  227.             </td>
  228.           </tr>
  229.           <tr bgcolor="#FFFFFF"> 
  230.             <td colspan="2"> <font color="#FF0000">内容简介 </font></td>
  231.           </tr>
  232.           <tr bgcolor="#FFFFFF"> 
  233.             <td valign="top" colspan="2"> 
  234.               <textarea rows="3" name="hw_content" cols="50" class=input><%=hw_content%></textarea>
  235.             </td>
  236.           </tr>
  237.           <tr bgcolor="#FFFFFF"> 
  238.             <td colspan="2"> <font color="#FF0000">商品图片</font> 
  239.               <input type="text" name="hw_pic" size="46" class=input value="<%=hw_pic%>">
  240.               <a href="../up/index.asp" target="_blank"><font color="#FF0000">图形上传</font></a></td>
  241.           </tr>
  242.           <tr bgcolor="#FFFFFF" align="center"> 
  243.             <td colspan="2"> 
  244.               <input type="submit" name="Submit" value="修改">
  245.             </td>
  246.           </tr>
  247.         </table>
  248.       </form>
  249.     </td>
  250.   </tr>
  251. </table>
  252.      <%
  253. end if
  254. set rs=nothing
  255. conn.close
  256. set conn=nothing
  257. %>