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

📄 edit_file.jsp

📁 读您的文件包读您的文件包读您的文件包读您的文件包
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="conn.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
	
if(session.getAttribute("adminname")==null)
{response.sendRedirect("sorry.jsp");}
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>修改文件</title>
<link rel="stylesheet" type="text/css" href="../Admin_Style.css">
<script language="javascript">

function YanZheng()
{

if (myform.Title.value=="")
{alert("标题不能为空!");myform.Title.focus();return false}

if (myform.Synopsis.value=="")
{alert("简介不能为空");myform.Synopsis.focus();return false}

if (myform.Introduce.value=="")
{alert("详细介绍不能为空");myform.Introduce.focus();return false}

</script>



<!-- 
var flag=false; 
function DrawImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= 200/150){ 
if(image.width>200){ 
ImgD.width=200; 
ImgD.height=(image.height*200)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"×"+image.height; 
} 
else{ 
if(image.height>150){ 
ImgD.height=150; 
ImgD.width=(image.width*150)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"×"+image.height; 
} 
} 
} 
//--> 
</script>

</head>
<body background="img/beijing.gif">

<jsp:include page="Menu.jsp" flush="true"/>
<br>


<% 
//得到id
String File_ID=request.getParameter("id");
//连接查询
String condition="select S_fileInfor.column_id,file_id,file_title,";
condition+="file_synopsis,file_introduce,file_date,file_name,";
condition+="S_fileColumn.column_name from S_fileInfor,S_fileColumn ";
condition+="where S_fileInfor.column_id=S_fileColumn.column_id and file_id='"+File_ID+"'";

ResultSet fs=stmt.executeQuery(condition);
fs.first();
String File_Title=fs.getString("file_title");
String File_Synopsis=fs.getString("file_synopsis");
String FIle_Introduce=fs.getString("file_introduce");
String File_Date=fs.getString("file_date");
String File_Name=fs.getString("file_name");
String Column_Name=fs.getString("column_name");
String ColumnID=String.valueOf(fs.getInt("column_id"));
fs.close();
fs=null;

%>
</table>
<form name="myform" method="post" action="Operate_File.jsp?EditType=fileEdit&id=<%=File_ID%>&file=<%=File_Name%>" enctype="multipart/form-data" onSubmit="return YanZheng()">
  <table width="77%" height="262" border="0" align="center" cellpadding="2" cellspacing="1">
    <tr> 
      <td height="47" colspan="2"><div align="center"><strong>资料修改</strong></div></td>
    </tr>
<tr> 
      <td height="25"><div align="right">栏目: </div></td>
      <td height="25">
	<%
	String sql="select * from S_fileColumn";
	 rs=stmt.executeQuery(sql);
	rs.beforeFirst();%>
	<select name="Column_ID">
	<option value="<%=ColumnID%>">请选择栏目</option>
	<%  
	
	while(rs.next())
	{
	String column_id = String.valueOf(rs.getInt("column_id"));//栏目id
	String column_name	= rs.getString("column_name");//栏目名	
	
	%>			
	<option value="<%=column_id%>"><%=column_name%></option>         			
	<%}%>
	</select>	
	  原属于 <%= Column_Name%>栏目</td>
    </tr>
    <tr> 
      <td width="114" height="33" align="right" valign="middle"><div align="right">标题:</div></td>
      <td width="476"><input name="Title" type="text" value="<%= File_Title %>" size="50" maxlength="50"></td>
    </tr>
	
	 <tr> 
      <td width="114" height="33" align="right" valign="middle"><div align="right">上传日期:</div></td>
      <td width="476"><input name="Date" type="text" value="<%= File_Date %>" size="50" maxlength="50"></td>
    </tr>
	
	    <tr> 
      <td width="114" height="33" align="right" valign="middle"><div align="right">简介:</div></td>
      <td width="476"><input name="Synopsis" type="text" size="50" maxlength="100" value="<%= File_Synopsis %>"></td>
    </tr>
	    <tr> 
      <td width="114" height="33" align="right" valign="middle"><div align="right">详细介绍:</div></td>
      <td width="476"><textarea name="Introduce" cols="48" rows="5"><%= FIle_Introduce %></textarea></td>
    </tr>
	
		 <tr> 
      <td width="114" height="33" align="right" valign="middle"><div align="right">当前文件名为:</div></td>
      <td width="476"><%=File_Name%></td>
    </tr>
	
	
	    <tr> 
      <td width="114" height="33" align="right" valign="middle"><div align="right">重新上传:</div></td>
      <td width="476"><input type="file" name="File" size="40"></td>
    </tr>
    <tr> 
      <td height="24" colspan="2" align="right" valign="middle"> <div align="center">
        <input type="submit" name="Submit1" value=" 确 定 "> &nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" >   &nbsp;&nbsp; 
		 <input type="button" name="Submit2" value="取消" onclick="history.back()"> 
      </div></td>
    </tr>
    <tr> 
      <td height="25" colspan="2" align="right" valign="middle">&nbsp;</td>
    </tr>
	<tr align="center"><td align="center" valign="middle"><a href="picture1.jsp"></a>返回个人相册</td></tr>
  </table>
 
</form>
</body>
<%
rs.close();
rs=null;
stmt.close();
conn.close();
%>
</html>

⌨️ 快捷键说明

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