【JSP开源代码栏目提醒】:以下是网学会员为您推荐的JSP开源代码-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)has
上一篇:
hide.jsp
下一篇:
数字水印技术的无线传感器网络安全机制研究思考