?? history_list.jsp
字號:
<%
/**********************************************************
history_list.jsp
***********************************************************/
%>
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,oa.main.*"%>
<jsp:useBean id="pb" class="oa.main.ParentBean" scope="page"/>
<link href="../../css/person.css" type=text/css rel=stylesheet>
<%
oa.bean.PersonBean personBean =null;
try{
String uid = (String)session.getAttribute("zgbh");
if(uid==null)
{
response.sendRedirect("../../session_oa.htm");
return;
}
DealString ds = new DealString();
//取出當前人的職工編號
String person_ID = ds.toString((String)session.getAttribute("zgbh"));
//取得職工的級別
String mlevel = pb.toName("ZZ_ZGB","ZGBH","MLEVEL",person_ID);
if(mlevel.equals("")) mlevel = "3";
//查詢條件
String strTile = ds.toGBK(ds.toString((String)request.getParameter("txt_title")));
String strKey = ds.toGBK(ds.toString((String)request.getParameter("txt_key")));
if (pb.getConn() == null){
%>
數據庫無法響應,請<a href="javascript:window.history.back(-1);">返回</a>重試
<%out.close();
}
final int num_per_page = 15; //臨時設置,每頁記錄數
int recsum = 0; //記錄總數
int sum = 1; //總頁數
String str_cur = ds.toString(request.getParameter("cur")); //翻頁時傳遞頁碼
int cur=1;
if(!str_cur.equals(""))
cur = Integer.parseInt(str_cur);
// 設置查詢的 SQL 語句
String sql = "select A.ID,A.TITLE,A.SENDER,D.XM,A.TIME,E.XM as CHECKER_XM,A.CHECKERTIME,A.RECEIVERS,A.PERFORM,A.PERFORMER,A.MLEVEL from HG2_MEET_SUMMARY_HISTORY A,ZZ_ZGB D,ZZ_ZGB E where A.SENDER=D.ZGBH and A.CHECKER=E.ZGBH and LOWER(A.TITLE) like '%"+strTile.toLowerCase()+"%' and LOWER(A.KEYWORD) like '%"+strKey.toLowerCase()+"%'";
String where_condition = "";
if (!person_ID.equals("1")){ //不是系統管理員
where_condition = "( A.MLEVEL>="+mlevel+" or A.SENDER='"+person_ID+"' or A.CHECKER='"+person_ID+"' or A.PERFORMER='"+person_ID+"' or ( A.RECEIVERSZGBH like '%,"+uid+"' or A.RECEIVERSZGBH like '"+uid+",%' or A.RECEIVERSZGBH like '%,"+uid+",%' ) ) ";
}
String order_condition = "order by TIME desc ";
Vector vect = null;
//生成SQL語句
if(!where_condition.equals("")){
sql = sql + " and " + where_condition;
}
sql = sql + " " + order_condition ;
//out.print(sql);
//取得一頁記錄
vect = pb.getOnePage(sql,cur,num_per_page,false);
//總記錄數
Vector v1 = pb.getDataBySql(sql);
recsum = v1.size();
//總頁數
sum = Integer.parseInt((String)vect.get(0));
%>
<html>
<head>
<title>會議紀要歷史</title>
<link href="css/table.css" type=text/css rel=stylesheet>
<link href="css/links.css" type=text/css rel=stylesheet>
<script src="summary.js"></script>
</head>
<script>
function chkdata() {
if(!isDigit(document.all.cur.value)) {
alert("輸入的頁碼不是數字!");
document.all.cur.value="";
document.all.cur.focus();
return false;
}
if(document.all.cur.value==""){
alert("請輸入頁碼!");
document.all.cur.focus();
return false;
}
else{
var t = document.all.cur.value;
var curpage = <%=cur%>;
var sum = <%=sum%>;
while(t.length>curpage.length) {
alert("請跳至1和"+sum+"之間!");
document.all.cur.value="";
document.all.cur.focus();
return false;
}
if (t == curpage) {
return false;
}
if(t.length>sum.length) {
alert("請跳至1和"+sum+"之間!");
document.all.cur.value="";
document.all.cur.focus();
return false;
}
if(t<1||t>sum){
alert("請跳至1和"+sum+"之間!");
document.all.cur.value="";
document.all.cur.focus();
return false;
}
}
document.all.form1.action = "history_list.jsp";
}
function firsrpg() {
document.all.form1.action = "history_list.jsp?cur=1";
document.all.form1.submit();
}
function lastpg() {
document.all.form1.action = "history_list.jsp?cur=<%=cur-1%>";
document.all.form1.submit();
}
function nextpg() {
document.all.form1.action = "history_list.jsp?cur=<%=cur+1%>";
document.all.form1.submit();
}
function finalpg() {
document.all.form1.action = "history_list.jsp?cur=<%=sum%>";
document.all.form1.submit();
}
function search(){
document.all.form1.action = "history_list.jsp?cur=";
document.all.form1.submit();
}
function goclear(){
document.all.txt_title.value="";
document.all.txt_key.value="";
}
</script>
<BODY leftMargin=0 topMargin=0 >
<form name="form1" method="post" action="history_list.jsp">
<br> <font color="#505050" size=2>當前位置:會議管理>><a href="history_list.jsp">會議查詢</a></font>
<div align=center>
<font color="#666666" size=3><b>會議查詢結果<b></font>
</div>
<br>
<hr width="100%">
<TABLE border=0 cellSpacing=1 cellPadding=3 width="95%" align=center style="word-break:break-all;">
<tr height=25>
<td width="15%" align=left>標題:
<input type="text" name="txt_title" maxlength=80 size="20" class=text value="<%=strTile%>" style="color: #000000; background-color: #FFFFFF;font-family:宋體; font-size: 12px;BORDER-RIGHT: 1px solid #A5BEE0; BORDER-TOP: 1px solid #A5BEE0; BORDER-LEFT: 1px solid #A5BEE0; BORDER-BOTTOM: 1px solid #A5BEE0">
關鍵字: <input type="text" name="txt_key" maxlength=80 size="20" class=text value="<%=strKey%>" style="color: #000000; background-color: #FFFFFF;font-family:宋體; font-size: 12px;BORDER-RIGHT: 1px solid #A5BEE0; BORDER-TOP: 1px solid #A5BEE0; BORDER-LEFT: 1px solid #A5BEE0; BORDER-BOTTOM: 1px solid #A5BEE0">
<input type="button" value="搜索" onclick="return search()"> <input type="button" value="清空" onclick="return goclear()">
</td>
</tr>
</table>
<br>
<TABLE class="tab" cellSpacing=1 cellPadding=3 width="95%" align=center bgcolor=#A5BEE0 style="word-break:break-all;">
<TBODY>
<TR bgColor="#666666" height=25>
<font color="#ffffff">
<TD>
<CENTER><B><font color="#ffffff">紀要標題</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">級別</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">發布人</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">發布時間</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">審核領導</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">督辦人</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">紀要接收人</font></B></CENTER></TD>
</font>
</TR>
<%
personBean=new oa.bean.PersonBean();
int k=vect.size();
String[] bgcolor={"#ffffff","#E0E0E0"};
for(int i=1;i<k;i++){
Hashtable hash = (Hashtable)vect.get(i);
String ID = ds.toString((String)hash.get("ID"));
String TITLE = ds.toString((String)hash.get("TITLE"));
String SENDER = ds.toString((String)hash.get("SENDER"));
String SENDERXM = ds.toString((String)hash.get("XM"));
String TIME = ds.toString((String)hash.get("TIME"));
String CHECKERXM = ds.toString((String)hash.get("CHECKER_XM"));
String CHECKERTIME = ds.toString((String)hash.get("CHECKERTIME"));
String RECEIVERS = ds.toString((String)hash.get("RECEIVERS"));
String PERFORMER = ds.toString((String)hash.get("PERFORMER"));
String PERFORMERNAME = pb.toName("ZZ_ZGB","ZGBH","XM",PERFORMER);
String strLevel = ds.toString((String)hash.get("MLEVEL"));
if(strLevel.equals("1")){
strLevel = "一級";
}
if(strLevel.equals("2")){
strLevel = "二級";
}
if(strLevel.equals("3")){
strLevel = "三級";
}
String bmbh=personBean.toName("ZZ_ZGB","ZGBH","BMBH",SENDER);
String bm=ds.toString(personBean.getFatherName(bmbh))+ds.toString(personBean.getApartName(bmbh));
%>
<tr bgcolor="<%=bgcolor[i%2]%>" height=25>
<TD align=left>
<a style="cursor:hand;color:#000000" onmouseover="this.style.color = 'red';" onmouseout = "this.style.color = 'black';" href="history_read.jsp?id=<%=ID%>" title="紀要標題"><%=TITLE%></a></TD>
<TD align=center>
<%=strLevel%></TD>
<TD align=center title="<%=SENDERXM%>:<%=bm%>">
<%=SENDERXM%></TD>
<TD align=center>
<%=TIME.substring(0,16)%></TD>
<TD align=center>
<%=CHECKERXM%></TD>
<TD align=center>
<%=PERFORMERNAME%></TD>
<TD align=center<%if(RECEIVERS.length()>23){%> title="<%=RECEIVERS%>"<%}%>>
<%if(RECEIVERS.length()>23){%><%=RECEIVERS.substring(0,10)+"..."%><%}else{%><%=RECEIVERS%><%}%> </TD>
</tr>
<%
}
%>
<tr height=25 class="table_body">
<TD align=right colspan=7 bgColor=#E0E0E0>
共有記錄數:<%=recsum%>
<%if(vect.size()>1){%>
當前<font color=red><%=cur%></font>/<%=sum%>頁  <a onclick="firsrpg()" style="cursor:hand">第一頁   </a>
<%if(cur>1){%>
<a onclick="lastpg()" style="cursor:hand">上一頁   </a><%}%>
<%if(cur<sum){%>
<a onclick="nextpg()" style="cursor:hand">下一頁  </a><%}%>  
<a onclick="finalpg()" style="cursor:hand">最后頁   </a>
直接<input type=image src="../../images/hand.gif" name="gotof" onclick="return chkdata()">
<input type=text size=5 name="cur" class=formcolor >頁</TD>
<%}%>
</tr>
</tbody>
</table>
</form>
</body>
</html>
<script>
document.all.form1.onsubmit=chkdata;
</script>
<%}catch(Exception e){
out.println(e);
}finally{
if(pb!=null)
pb.closeConn();
if(personBean!=null)personBean.closeConn();
}%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -