?? meeting_index.jsp
字號:
<%@ page language="java" pageEncoding="gb2312"%>
<%@ page import="java.util.*"%>
<jsp:directive.page import="com.hiernate.persistence.Meeting"/>
<jsp:directive.page import="com.hiernate.util.HibernateUtil"/>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<head>
<html:base />
<title>會議記錄顯示頁面</title>
<style type="text/css">
<!--
@import url("../../CSS/style.css");
-->
</style>
</head>
<body background="../../Images/main_center.jpg">
<table width="801" border="0" cellpadding="0" cellspacing="0" background="../../Images/main_center.jpg">
<tr>
<td height="488" valign="top"><table width="100%" height="84%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" height="119" border="0" cellpadding="-2" cellspacing="-2" background="../images/bbs/bbs_01.gif">
<tr valign="top">
<td width="100%" height="43" background="../../Images/main_top.JPG"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<tr>
<td width="5%"><br> <img src="../../Images/isexists.gif" width="16" height="16"></td>
<td width="23%" align="left"><br> <b>會議管理</b></td>
<td width="72%" valign="bottom"> </td>
</tr>
</table></td>
</tr>
<tr valign="top">
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="-2" cellspacing="-2" background="../../Images/main_center.jpg">
<tr>
<td width="817" valign="top">
<table width="557" height="54" border="0" cellpadding="-2" cellspacing="-2" background="../Images/meeting/meeting_02.gif">
<tr>
<td width="7%" height="33" align="center" valign="middle"> </td>
<td width="23%" align="center"> </td>
<td width="5%" height="33"><div align="center" class="style10">
<img src="../../Images/add.gif" width="20" height="18"></div></td>
<td width="47%" height="33"><div align="left" class="STYLE11">
<%
String strpurview = (String)application.getAttribute("Purview");
if(strpurview.equalsIgnoreCase("只讀")){
%>
<a href="noaddmeeting.jsp">錄入會議信息</a>
<%}else{ %>
<a href="#" onClick="Javascript:window.open('meeting_add.jsp','','width=545,height=350');return false">錄入會議信息</a></td>
<%} %>
<td width="18%" height="33"><div align="center"></div></td>
</tr>
<tr>
<td height="21" colspan="6"> </td>
</tr>
</table>
<table align="center">
<tr>
</tr>
</table>
<table width="75%" height="27" border="1" align="center" cellpadding="-2" cellspacing="-2">
<!-- 設(shè)置表格樣式 -->
<tr>
<td width="55%"><div align="center" >會議主題</div></td><!-- 設(shè)置表頭內(nèi)容 -->
<td width="13%"><div align="center" >主持人</div></td>
<td width="25%"><div align="center" >會議時間</div>
<div align="center" class="style3"></div></td>
<td width="7%"><div align="center" >刪除</div></td>
</tr>
<%
String currPage = request.getParameter("currPage"); //獲得當前頁數(shù)
int iCurrPage = 1 ; //定義目前的頁數(shù),注意初始值不能為“0”
int pages = 1 ; //定義總頁數(shù)。
int allRecCount = 0 ; //定義表中總的記錄數(shù)
int recPerPage = 5 ; //定義每頁顯示的記錄數(shù)
allRecCount = HibernateUtil.findMeetingCount(); //調(diào)用工具類中方法,查詢出總的記錄數(shù)
pages = (allRecCount - 1)/recPerPage + 1 ; //計算出總的頁數(shù)
if(pages == 0){ //對頁數(shù)進行有效性處理,使頁數(shù)的最小值是1
pages = 1;
}
if(currPage != null && !currPage.equalsIgnoreCase("")){ //判斷currpage是否為空
iCurrPage = Integer.parseInt(currPage); //將currpage賦值給iCurrpage
}
List listMeeting =HibernateUtil.finMeeting((iCurrPage - 1) * recPerPage, recPerPage); //調(diào)用分頁方法
if(listMeeting.isEmpty()){
out.println("暫無信息"); //如果查詢結(jié)果為空時,頁面輸出"暫無信息"
}
if(!listMeeting.isEmpty() && listMeeting.size()>0){
for(int i= 0;i<listMeeting.size();i++){ //利用循環(huán)語句把查找的所有記錄依次顯示出來
Meeting meeting = (Meeting)listMeeting.get(i);
session.getAttribute("Meeting");
%>
<tr>
<td>
<a href="#" onClick="JScript:window.open('meeting_detail.jsp?currPage=<%=iCurrPage%>&&ID=<%=meeting.getId() %>','','width=545,height=380');return false"><%=meeting.getSubject()%></a></td>
<td><div align="center" class="STYLE11"><%=meeting.getCPerson()%></div></td><!--將查找出來的會議內(nèi)容依次在表格中顯示-->
<td><div align="center" class="STYLE11"><%=meeting.getMTime()%> </div></td>
<% String purview = (String)application.getAttribute("Purview"); //獲得將保存在application中的登錄用戶權(quán)限
if(purview.equalsIgnoreCase("只讀")){ //如果用戶的權(quán)限是"只讀",將轉(zhuǎn)入meeting_delno.jsp頁面,不能進行刪除操作。
%>
<td><div align="center">
<a href="meeting_delno.jsp">
<img src="../../Images/del.gif" width="16" height="16" border="0"></td>
<%} %>
<%if(purview.equalsIgnoreCase("系統(tǒng)")){ %> <!-- 用戶權(quán)限為"系統(tǒng)",可以進行刪除操作 -->
<td><a href="#" onClick="JScript:window.open('meeting_del_ok.jsp?ID=<%=meeting.getId()%>&link=<%=listMeeting.size()%>&currPage=<%=iCurrPage%>','','width=550,height=350');return false">
<img src="../../Images/del.gif" width="16" height="16" border="0"></a>
</td>
</tr>
<%}}}%>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="-2" cellpadding="-2" background="../../Images/main_center.jpg">
<tr>
<td height="25" class="STYLE2"><div align="center" class="STYLE11">
<%
if(recPerPage < allRecCount){
String href = " <a href='meeting_index.jsp?currPage="; //分頁地址
StringBuffer sbf = new StringBuffer(); //制作分頁條
if(iCurrPage > 1){ //構(gòu)造上一頁
sbf.append(href+(iCurrPage - 1)+"'>上一頁</a>");
}
for(int i = 1 ; i <= pages ; i ++){
if(i == iCurrPage){
sbf.append(href+i+"'>["+i+"]</a>"); //追加串,區(qū)分當前頁
}
else{
sbf.append(href+i+"'>"+i+"</a>");
}
}
if(iCurrPage < pages){
sbf.append(href+(iCurrPage + 1)+"'>下一頁</a>"); //構(gòu)造下一頁
}
%>
<%out.print("當前頁數(shù):["+iCurrPage+"/"+pages+"]");%> <!-- 頁面顯示當前頁數(shù)和總頁數(shù) -->
<%=sbf.toString()%> <!-- 將制作的分頁條顯示在頁面上 -->
<%}%>
</div></td>
</tr>
</table>
</body>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -