Picture.jsp
资源名称:zyp.rar [点击查看]
上传用户:zdly666
上传日期:2022-08-09
资源大小:6511k
文件大小:4k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
- <%@ include file="conn.jsp"%>
- <link type="text/css" rel="stylesheet" href="style.css">
- <script language="javascript">
- <!--
- 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>= 360/270){
- if(image.width>360){
- ImgD.width=360;
- ImgD.height=(image.height*360)/image.width;
- }else{
- ImgD.width=image.width;
- ImgD.height=image.height;
- }
- ImgD.alt=image.width+"×"+image.height;
- }
- else{
- if(image.height>270){
- ImgD.height=270;
- ImgD.width=(image.width*270)/image.height;
- }else{
- ImgD.width=image.width;
- ImgD.height=image.height;
- }
- ImgD.alt=image.width+"×"+image.height;
- }
- }
- }
- //-->
- </script>
- <%
- //计算当前文件定位。
- String EditID=request.getParameter("EditID");//当前记录
- String Row=request.getParameter("RowID");//当前行数
- String Column=request.getParameter("Column");//
- //选择媒体文件
- String file_SQL="select * from S_fileInfor,S_fileColumn where ";
- file_SQL+="S_fileInfor.column_id=S_fileColumn.column_id and ";
- file_SQL+="S_fileInfor.column_id='"+Column+"' order by file_id desc ";
- ResultSet frs=stmt.executeQuery(file_SQL);
- frs.last();
- int Total=frs.getRow();//得到总记录条数
- String Column_Name=frs.getString("column_name");
- int RowID=Integer.parseInt(Row);//转换成整型
- String StrSQL;
- StrSQL="select * from S_fileInfor where file_id='"+EditID+"'";
- ResultSet rs2=stmt.executeQuery(StrSQL);
- rs2.first();
- String title=rs2.getString("file_title");
- String introduce=rs2.getString("file_introduce");
- String synopsis=rs2.getString("file_synopsis");
- String time=rs2.getString("file_date");
- String fileName=rs2.getString("file_name");
- %>
- <table width="362" border="0" align="center" cellspacing="0">
- <tr>
- <td width="360">asdfasdfasdf</td>
- </tr>
- <tr>
- <td>
- <div align="center"><img src="file/<%=fileName%>" width="62" height="44" onload="javascript:DrawImage(this);"/></div></td>
- </tr>
- <tr>
- <td>asdfasdfsadf</td>
- </tr>
- <tr>
- <td>
- </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </table>
- <%
- String SQL_ROW;
- SQL_ROW="select * from S_fileInfor where column_id='"+Column+"'order by file_id desc";
- ResultSet rs1=stmt.executeQuery(SQL_ROW);
- int Pre_EditID;//上一条记录的ID
- int Pre_RowID;//上一条记录的行号
- if(RowID-1==0)//如果当前行-1=0,则没有上一条记录
- {
- rs1.first();
- Pre_EditID=rs1.getInt("file_id");
- Pre_RowID=1;
- }
- else
- {
- rs1.absolute(RowID-1);
- Pre_EditID=rs1.getInt("file_id");
- Pre_RowID=RowID-1;
- }
- String Ptitle=rs1.getString("file_title");//上一条记录的标题
- int Next_EditID;//下一条记录的ID
- int Next_RowID;//下一条记录的行号
- if(RowID==Total)
- {
- rs1.last();
- Next_EditID=rs1.getInt("file_id");
- Next_RowID=Total;
- }
- else
- {
- rs1.absolute(RowID+1);
- Next_EditID=rs1.getInt("file_id");
- Next_RowID=RowID+1;
- }
- String Ntitle=rs1.getString("file_title");
- %>
- </p>
- <table width="83%" border="0" align="center">
- <tr>
- <td width="26%"><div align="center">上一个文件</div></td>
- <%if(RowID==1)
- {%>
- <td width="12%">没有了</td>
- <%}else{%>
- <td width="62%">
- <a href="Picture1.jsp?EditID=<%=Pre_EditID%>&Column=<%=Column%>&RowID=<%=Pre_RowID%>&Type=1"><%=Ptitle%></td>
- <%}%>
- </tr>
- <tr>
- <td ><div align="center">下一个文件:</div></td>
- <%if(RowID==Total)
- {%>
- <td>没有了</td>
- <%}else{%>
- <td><a href="Picture1.jsp?EditID=<%=Next_EditID%>&Column=<%=Column%>&RowID=<%=Next_RowID%>&Type=1"><%=Ntitle%></a></td>
- <%}%>
- </tr>
- </table>