Edit_file.jsp
上传用户:zdly666
上传日期:2022-08-09
资源大小:6511k
文件大小:5k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

JavaScript

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ include file="conn.jsp"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <%
  7. if(session.getAttribute("adminname")==null)
  8. {response.sendRedirect("sorry.jsp");}
  9. %>
  10. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  11. <title>修改文件</title>
  12. <link rel="stylesheet" type="text/css" href="../Admin_Style.css">
  13. <script language="javascript">
  14. function YanZheng()
  15. {
  16. if (myform.Title.value=="")
  17. {alert("标题不能为空!");myform.Title.focus();return false}
  18. if (myform.Synopsis.value=="")
  19. {alert("简介不能为空");myform.Synopsis.focus();return false}
  20. if (myform.Introduce.value=="")
  21. {alert("详细介绍不能为空");myform.Introduce.focus();return false}
  22. </script>
  23. <!-- 
  24. var flag=false; 
  25. function DrawImage(ImgD){ 
  26. var image=new Image(); 
  27. image.src=ImgD.src; 
  28. if(image.width>0 && image.height>0){ 
  29. flag=true; 
  30. if(image.width/image.height>= 200/150){ 
  31. if(image.width>200){ 
  32. ImgD.width=200; 
  33. ImgD.height=(image.height*200)/image.width; 
  34. }else{ 
  35. ImgD.width=image.width; 
  36. ImgD.height=image.height; 
  37. ImgD.alt=image.width+"×"+image.height; 
  38. else{ 
  39. if(image.height>150){ 
  40. ImgD.height=150; 
  41. ImgD.width=(image.width*150)/image.height; 
  42. }else{ 
  43. ImgD.width=image.width; 
  44. ImgD.height=image.height; 
  45. ImgD.alt=image.width+"×"+image.height; 
  46. //--> 
  47. </script>
  48. </head>
  49. <body background="img/beijing.gif">
  50. <jsp:include page="Menu.jsp" flush="true"/>
  51. <br>
  52. <% 
  53. //得到id
  54. String File_ID=request.getParameter("id");
  55. //连接查询
  56. String condition="select S_fileInfor.column_id,file_id,file_title,";
  57. condition+="file_synopsis,file_introduce,file_date,file_name,";
  58. condition+="S_fileColumn.column_name from S_fileInfor,S_fileColumn ";
  59. condition+="where S_fileInfor.column_id=S_fileColumn.column_id and file_id='"+File_ID+"'";
  60. ResultSet fs=stmt.executeQuery(condition);
  61. fs.first();
  62. String File_Title=fs.getString("file_title");
  63. String File_Synopsis=fs.getString("file_synopsis");
  64. String FIle_Introduce=fs.getString("file_introduce");
  65. String File_Date=fs.getString("file_date");
  66. String File_Name=fs.getString("file_name");
  67. String Column_Name=fs.getString("column_name");
  68. String ColumnID=String.valueOf(fs.getInt("column_id"));
  69. fs.close();
  70. fs=null;
  71. %>
  72. </table>
  73. <form name="myform" method="post" action="Operate_File.jsp?EditType=fileEdit&id=<%=File_ID%>&file=<%=File_Name%>" enctype="multipart/form-data" onSubmit="return YanZheng()">
  74.   <table width="77%" height="262" border="0" align="center" cellpadding="2" cellspacing="1">
  75.     <tr> 
  76.       <td height="47" colspan="2"><div align="center"><strong>资料修改</strong></div></td>
  77.     </tr>
  78. <tr> 
  79.       <td height="25"><div align="right">栏目: </div></td>
  80.       <td height="25">
  81. <%
  82. String sql="select * from S_fileColumn";
  83.  rs=stmt.executeQuery(sql);
  84. rs.beforeFirst();%>
  85. <select name="Column_ID">
  86. <option value="<%=ColumnID%>">请选择栏目</option>
  87. <%  
  88. while(rs.next())
  89. {
  90. String column_id = String.valueOf(rs.getInt("column_id"));//栏目id
  91. String column_name = rs.getString("column_name");//栏目名
  92. %>
  93. <option value="<%=column_id%>"><%=column_name%></option>         
  94. <%}%>
  95. </select>
  96.   原属于 <%= Column_Name%>栏目</td>
  97.     </tr>
  98.     <tr> 
  99.       <td width="114" height="33" align="right" valign="middle"><div align="right">标题:</div></td>
  100.       <td width="476"><input name="Title" type="text" value="<%= File_Title %>" size="50" maxlength="50"></td>
  101.     </tr>
  102.  <tr> 
  103.       <td width="114" height="33" align="right" valign="middle"><div align="right">上传日期:</div></td>
  104.       <td width="476"><input name="Date" type="text" value="<%= File_Date %>" size="50" maxlength="50"></td>
  105.     </tr>
  106.     <tr> 
  107.       <td width="114" height="33" align="right" valign="middle"><div align="right">简介:</div></td>
  108.       <td width="476"><input name="Synopsis" type="text" size="50" maxlength="100" value="<%= File_Synopsis %>"></td>
  109.     </tr>
  110.     <tr> 
  111.       <td width="114" height="33" align="right" valign="middle"><div align="right">详细介绍:</div></td>
  112.       <td width="476"><textarea name="Introduce" cols="48" rows="5"><%= FIle_Introduce %></textarea></td>
  113.     </tr>
  114.  <tr> 
  115.       <td width="114" height="33" align="right" valign="middle"><div align="right">当前文件名为:</div></td>
  116.       <td width="476"><%=File_Name%></td>
  117.     </tr>
  118.     <tr> 
  119.       <td width="114" height="33" align="right" valign="middle"><div align="right">重新上传:</div></td>
  120.       <td width="476"><input type="file" name="File" size="40"></td>
  121.     </tr>
  122.     <tr> 
  123.       <td height="24" colspan="2" align="right" valign="middle"> <div align="center">
  124.         <input type="submit" name="Submit1" value=" 确 定 "> &nbsp;&nbsp;
  125.         <input type="reset" name="Submit2" value="重置" >   &nbsp;&nbsp; 
  126.  <input type="button" name="Submit2" value="取消" onclick="history.back()"> 
  127.       </div></td>
  128.     </tr>
  129.     <tr> 
  130.       <td height="25" colspan="2" align="right" valign="middle">&nbsp;</td>
  131.     </tr>
  132. <tr align="center"><td align="center" valign="middle"><a href="picture1.jsp"></a>返回个人相册</td></tr>
  133.   </table>
  134.  
  135. </form>
  136. </body>
  137. <%
  138. rs.close();
  139. rs=null;
  140. stmt.close();
  141. conn.close();
  142. %>
  143. </html>