📄 listuppic.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gbk" %>
<%@ page import="java.util.*,com.jspsmart.upload.*,com.zzx.updown.*,com.zzx.util.*,net.ijsp.news.util.*,net.ijsp.news.news.*,java.text.*,java.sql.*"%>
<%!final String URL = "uploadpic.jsp";%>
<%
request.setCharacterEncoding("gbk");
int lineSize = 10;
int currentPage = 1;
int allRecorders = 0;
int pageSize = 0;
%>
<%
UpPicOper uppicoper = new UpPicOper();
allRecorders = uppicoper.queryCount();
pageSize = (allRecorders + lineSize - 1) / lineSize;
try {
currentPage = Integer.parseInt(request.getParameter("cp"));
} catch (Exception e) {
}
%>
<table border="1" align="center" width="600" >
<tr>
<td width="10%" align="center">
序号 </td>
<td width="25%" align="center">
类别 </td>
<td width="25%" align="center">
图片描述 </td>
<td width="25%" align="center">
图片名称 </td>
<td width="15%" align="center">
操作 </td>
</tr>
<%
List all = uppicoper.queryAll(currentPage,lineSize);
Iterator itor = all.iterator();
int i =0;
int type=1;
String str ="";
while (itor.hasNext()) {
UpPic uppic = (UpPic)itor.next();
i++;
int udid = uppic.getId();
String filename = uppic.getFilename();
String filecontent = uppic.getFilecontent();
type = uppic.getType();
switch(type){
case 1:
str="新闻图片";
break;
case 2:
str="党员风采";
break;
case 3:
str="学子风采";
break;
case 4:
str="校友风采";
break;
default:
str="未知";
}
%>
<tr align="center">
<td width="10%"><%=i%></td>
<td width="25%"><%=str%></td>
<td width="25%"><%=filecontent%></td>
<td width="25%"><%=filename%></td>
<td width="15%"><a href="deleteuppic.jsp?id=<%=udid%>" onclick="javascript:return confirm('确认删除吗');">删除</a></td>
</tr>
<%
}
%>
</table>
<table align="center" >
<tr><td height="50"></td></tr>
<tr><td align="center" colspan="3">
<!--使用隐藏域提交 -->
<form action="<%=URL%>" name="spage">
<input type="button" value="首页" onClick="openPage(1)"
<%=currentPage == 1 ? "disabled" : ""%>>
<input type="button" value="前一页"
onClick="openPage(<%=(currentPage - 1)%>)"
<%=currentPage == 1 ? "disabled" : ""%>>
<input type="button" value="下一页"
onClick="openPage(<%=currentPage + 1%>)"
<%=currentPage == pageSize ? "disabled" : ""%>>
<input type="button" value="尾页" onClick="openPage(<%=pageSize%>)"
<%=currentPage == pageSize ? "disabled" : ""%>>
<input type="hidden" name="cp" value="" />
分页:<font color="red" size="5"><%=currentPage%></font> /
<font color="red" size="5"><%=pageSize%></font>
</form>
</td></tr>
</table>
<script type="text/javascript">
function openPage(curPage){
this.spage.cp.value=curPage;
this.spage.submit();
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -