in-changehw.jsp
上传用户:szlmxq
上传日期:2014-01-31
资源大小:740k
文件大小:8k
源码类别:

Applet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
  2. <%   boolean founderr=false;
  3.  String hw_ids ,hw_cashs,sort_ids,pifas,dailis,errmsg,datas,tuijians,Nsort_ids;
  4.  hw_ids=request.getParameter("hw_id");
  5.  if(hw_ids!=null)
  6.  {
  7.  //--------------------------------------hw_ids!=null---------------------------------------------
  8.       hw_id=Cint(hw_ids);
  9.       if(hw_id!=0){
  10.         sql="SELECT * from hw where hw_id="+hw_id; 
  11.             rs=mdb.executeQuery(sql);
  12. if(rs.next())
  13. {
  14.                   hw_name=rs.getString("hw_name");
  15.                  hw_cash=rs.getInt("hw_cash");
  16.                  hw_pic=rs.getString("hw_pic");
  17.                 hw_sn=rs.getString("hw_sn");
  18.                  sort_id=rs.getInt("sort_id");
  19.                 Nsort_id=rs.getInt("Nsort_id");
  20.             tuijian=rs.getBoolean("tuijian");
  21.             hw_content=rs.getString("hw_content");
  22. hw_content=hw_content.replaceAll("<br>",String.valueOf(' '));
  23.         hw_content2=rs.getString("hw_content2");
  24. hw_content2=hw_content2.replaceAll("<br>",String.valueOf(' '));
  25.              hw_views=rs.getInt("hw_views");
  26.             hw_buys=rs.getInt("hw_buys");
  27.              chubsh=rs.getString("chubsh");
  28.            zhuang=rs.getString("zhuang");
  29.            hw_sn=rs.getString("hw_sn");
  30.            company=rs.getString("company");
  31.            yeshu=rs.getString("yeshu");
  32.            kaiben=rs.getString("kaiben");
  33.            isbn=rs.getString("isbn");
  34.            pifa=rs.getInt("pifa");
  35.            daili=rs.getInt("daili");
  36.            data=rs.getDate("data");
  37.            rs.close();
  38. %>
  39. <!-----------------------------------table to show the modify info---------------------------------------->
  40. <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" height="100" bgcolor="808080">
  41.   <tr> 
  42.     <td height="175"> 
  43.       <form name="form1" method="post" action="changehw.jsp?hw_id=<%=hw_id%>&action=save">
  44.         <table border="0" width="100%" cellspacing="1">
  45.           <tr bgcolor="#FFFFFF"> 
  46.             <td colspan="2"><font color="#FF0000">商品名称</font> 
  47.               <input type="text" name="hw_name" size="20" class=input value="<%=hw_name%>">
  48.               <font color="#FF0000"> &nbsp;&nbsp;&nbsp;&nbsp; 商品类别 </font> 
  49.               <select class="smallSel" name="sort_id" size="1">
  50. <%
  51.        sort_ids=request.getParameter("sort_id");
  52.        Nsort_ids=request.getParameter("Nsort_id");
  53.            String sel;
  54.           sql="select * from sort";
  55.            rs=mdb.executeQuery(sql);
  56.       if (!rs.next()){
  57.         out.print("Not record.");
  58.        }else
  59.        {  rs.previous();
  60.           while(rs.next())
  61.           {    sort_id=rs.getInt("sort_id");
  62.                     if (sort_id==Cint(sort_ids))
  63.                        {      sel="selected";
  64.                 }
  65.                     else
  66.             {
  67.                       sel="";
  68.                      }
  69.                   out.print("<option " +sel + " value='"+sort_id+"' name=sort_id>"+rs.getString("sort_name")+"</option>");
  70.               }
  71.       }
  72.      rs.close();
  73. %>
  74.               </select>
  75.               &nbsp;&nbsp;<font color="#FF0000">选择分类</font>: 
  76.               <select name="Nsort_id" size="1">
  77.                 <%
  78.        sql="select * from Nsort";
  79.         rs=mdb.executeQuery(sql);
  80.     if(!rs.next())
  81.     { out.print("Not record.");
  82.      }else
  83.     {  rs.previous();
  84.             while(rs.next())
  85.          { 
  86.              Nsort_id=rs.getInt("Nsort_id");
  87.                  if(Nsort_id==Cint(Nsort_ids))
  88.                  {       sel="selected";
  89.          }
  90.                  else
  91.           {
  92.                          sel="";
  93.                   }
  94.                  out.print( "<option " + sel + " value='" +  Nsort_id + "'>" + rs.getString("Nsort_name") + "</option>");
  95.         
  96.                   }
  97.          }
  98.              rs.close();
  99. %>
  100.               </select>
  101.               ** </td>
  102.           </tr>
  103.           <tr bgcolor="#FFFFFF"> 
  104.             <td colspan="2"><font color="#FF0000">图书原价</font> 
  105.               <input type="text" name="pifa" size="7" class=input value="<%=pifa%>">
  106.               元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;会员价格</font> 
  107.               <input type="text" name="hw_cash" size="7" class=input value="<%=hw_cash%>">
  108.               元 <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;VIP价格 </font> 
  109.               <input type="text" name="daili" size="7" class=input value="<%=daili%>">
  110.               元 </td>
  111.           </tr>
  112.           <tr bgcolor="#FFFFFF"> 
  113.             <td height="5" colspan="2"> 
  114.               <hr noshade size="1">
  115.             </td>
  116.           </tr>
  117.           <tr bgcolor="#FFFFFF"> 
  118.             <td width="25%"><font color="#000000">作者</font> 
  119.               <input type="text" name="hw_sn" size="10" class=input value="<%=hw_sn%>">
  120.             </td>
  121.             <td width="75%"><font color="#000000">出版社</font> 
  122.               <input type="text" name="chubsh" size="30" class=input value="<%=chubsh%>">
  123.             </td>
  124.           </tr>
  125.           <tr bgcolor="#FFFFFF"> 
  126.             <td width="25%"><font color="#000000">页数</font> 
  127.               <input type="text" name="yeshu" size="10" class=input value="<%=yeshu%>">
  128.             </td>
  129.             <td width="75%"><font color="#000000">出版日期</font> 
  130.               <input type="text" name="data" size="24" class=input value="<%=data%>">
  131.               格式:2002-10-10</td>
  132.           </tr>
  133.           <tr bgcolor="#FFFFFF"> 
  134.             <td width="25%"><font color="#000000">颜色</font> 
  135.               <input type="text" name="kaiben" size="10" class=input value="<%=kaiben%>">
  136.             </td>
  137.             <td width="75%"><font color="#000000">ISBN号码</font> 
  138.               <input type="text" name="isbn" size="30" class=input value="<%=isbn%>">
  139.             </td>
  140.           </tr>
  141.           <tr bgcolor="#FFFFFF"> 
  142.             <td height="5" colspan="2"> 
  143.               <hr noshade size="1">
  144.             </td>
  145.           </tr>
  146.           <tr bgcolor="#FFFFFF"> 
  147.             <td colspan="2"> <font color="#000000">装帧</font> 
  148.               <input type="text" name="zhuang" size="30" class=input value="<%=zhuang%>">
  149.             </td>
  150.           </tr>
  151.           <tr bgcolor="#FFFFFF"> 
  152.             <td colspan="2"><font color="#FF0000">简单内容介绍</font></td>
  153.           </tr>
  154.           <tr bgcolor="#FFFFFF"> 
  155.             <td valign="top" colspan="2"> 
  156.               <textarea rows="3" name="hw_content" cols="50" class=input><%=hw_content%></textarea>
  157.             </td>
  158.           </tr>
  159.           <tr bgcolor="#FFFFFF"> 
  160.             <td valign="top" colspan="2"><font color="#FF0000">详细内容介绍</font></td>
  161.           </tr>
  162.           <tr bgcolor="#FFFFFF"> 
  163.             <td valign="top" colspan="2"> 
  164.               <textarea rows="10" name="hw_content2" cols="50" class=input><%=hw_content2%></textarea>
  165.             </td>
  166.           </tr>
  167.           <tr bgcolor="#FFFFFF"> 
  168.             <td colspan="2"> <font color="#FF0000">商品图片</font> 
  169.               <input type="text" name="hw_pic" size="46" class=input value="<%=hw_pic%>"><a href="up.jsp" target="_blank">上传图片</a></td>
  170.           </tr>
  171.           <tr bgcolor="#FFFFFF"> 
  172.             <td colspan="2" height="24"> 
  173.               <input type="radio" name="tuijian" value="1">
  174.               推荐此商品 
  175.               <input type="radio" name="tuijian" value="0" checked>
  176.               不推荐
  177.               <input name="hw_id" type="hidden" id="hw_id" value="<%=hw_id%>"></td>
  178.           </tr>
  179.           <tr bgcolor="#FFFFFF" align="center"> 
  180.             <td colspan="2"> 
  181.               <input type="submit" name="Submit" value="修改">
  182.             </td>
  183.           </tr>
  184.         </table>
  185.       </form>
  186.     </td>
  187.   </tr>
  188. </table>
  189. <%        }//---------------------------rs.next end---------------------------------
  190.    }//---------------------------hw_id!=0 check end------------------------------------------------------
  191.     }//----------------------------hw_id!=null end-------------------------------------------------------------
  192. %>
  193.