📄 alarmdisplay_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.text.*;
import com.am.*;
import java.sql.*;
public final class alarmdisplay_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\n');
out.write('\n');
out.write('\n');
com.am.OpenDB dbconn = null;
synchronized (application) {
dbconn = (com.am.OpenDB) _jspx_page_context.getAttribute("dbconn", PageContext.APPLICATION_SCOPE);
if (dbconn == null){
dbconn = new com.am.OpenDB();
_jspx_page_context.setAttribute("dbconn", dbconn, PageContext.APPLICATION_SCOPE);
}
}
out.write('\n');
DataBase db=new DataBase();alarm myalarm=new alarm(); //myalarm.setConnection(dbconn.getConnection());DealString ds = new DealString();String txtsrch = ds.toGBK((String) request.getParameter("txt_search"));if (txtsrch==null)txtsrch = ""; //checkbox 状态 String chkon = ds.toString ((String) request.getParameter("chk_search")); //按什么字段搜索 String strSrchZD = ds.toString ((String)request.getParameter("txt_srch")); String strLevel = ds.toString((String)request.getParameter("level"));
out.write("\n\n<div align=center><font style='font-size: 24px;font-weight: bold;font-family: \"楷体_GB2312\";'><b>报警信息处理</b><b></b></font></div>\n<script type=\"\">\n\n<script>\n\n\tfunction srch()\n\t{\n\t\tonchgss(document.all.sel_search);\n\t\tdocument.all.txt_edit.value = \"\";\n\t\tdocument.all.txt_personno.value = \"\";\n\t\tif(document.all.txt_search.value == \"\")\n\t\t{\n\t\t\talert(\"请输入搜索内容!\");\n\t\t\treturn false;\n\t\t}\n\t\tif(document.all.txt_srch.value == \"\")\n\t\t{\n\t\t\talert(\"请选择查询字段!\");\n\t\t\treturn false;\n\t\t}\n\t\tif(document.all.chk_search.value==\"ON\" && document.all.txt_search.value == \"\")\n\t\t{\n\t\t\talert(\"请输入搜索内容\");\n\t\t\treturn false;\n\t\t}\n\t\tdocument.all.form1.action = \"index1.jsp\";\n\t\tdocument.all.form1.submit();\n\t}\n\tfunction oncheck(myname){\n\t\tif(myname.checked)\n\t\t\tmyname.value=\"ON\";\n\t\telse\n\t\t\tmyname.value=\"\";\n\t}\n\tfunction dispall()\n\t{\n\t\tdocument.all.txt_type.value = 3;\n\t\tdocument.all.txt_paixu.value = 0;\n\t\tdocument.all.txt_srch.value = \"\";\n\t\tdocument.all.txt_edit.value = \"\";\n\t\tdocument.all.txt_personno.value = \"\";\n\t\tdocument.all.form1.action = \"index1.jsp\";\n\t\tdocument.all.form1.submit();\n");
out.write("\t}\n\tfunction isDigit(str)\n\t{\n\t\tvar bool = true;\n\t\tfor(var i=0;i<str.length;i++)\n\t\t{\n\t\t\tif(!(str.charAt(i)>=0&&str.charAt(i)<=9))\n\t\t\t{\n\t\t\t\tbool = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn bool;\n\t}\n\tfunction clrsrch()\n\t{\n\t\tdocument.all.txt_srch.value=\"\";\n\t}\n\tfunction tiredps()\n\t{\n\t\tdocument.all.txt_type.value = 3;\n\t\t//document.all.txt_paixu.value = \"\";\n\t\t//document.all.txt_srch.value = \"\";\n\t\tdocument.all.txt_edit.value = 5;\n\t\t//document.all.txt_personno.value = \"\";\n\t\tdocument.all.form1.action = \"index1.jsp\";\n\t\tdocument.all.form1.submit();\n\t}\n</script>\n<br>\n\n<input type=hidden name=\"txt_cont\" value=\"\">\n<hr align=\"center\" width=\"95%\" size=\"2\" noshade>\n<TABLE WIDTH=\"95%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center style=\"table-layout:fixed\">\n<tr>\n <td width=\"72\" height=\"44\"><input type=\"button\" name=\"all\" value=\"显示全部\" class=fashion_1 style='cursor: default' onclick=\"dispall();\"></td>\n <td width=\"181\" align=\"left\"><input type=\"text\" name=\"txt_search\" size=\"20\" value=\"");
out.print(txtsrch);
out.write("\" style=\"border-style: double; border-color: #000000\" onchange=\"clrsrch();\"> </td>\n<td><input type=\"button\" name=\"search\" value=\"搜索\" class=fashion_1 style='cursor:hand' onclick=\"return srch();\"></td>\n<td width=\"144\" align=\"center\"><select name =\"sel_search\" ><!--onchange=\"onchgss(this);\"-->\n\n\n<option value=\"\"");
if(strSrchZD==""){
out.write("selected");
}
out.write(">请选择查询字段</option>\n\n<option value=\"1\"");
if(strSrchZD=="1"){
out.write("selected");
}
out.write(">开始时间</option>\n\t<option value=\"2\"");
if(strSrchZD=="2"){
out.write("selected");
}
out.write(">局站</option>\n\t<option value=\"3\"");
if(strSrchZD=="3"){
out.write("selected");
}
out.write(">设备</option>\n </select>\n </td>\n<td width=\"153\" align=\"left\" nowrap><select name=\"level\" >\n <option value=\"\" selected>所有级别</option>\n <option value=\"0\">一般告警</option>\n <option value=\"1\">重要告警</option>\n <option value=\"2\">紧急告警</option>\n </select>\n 告警等级\n </td>\n\n<td width=\"175\" align=\"left\">\n");
if(chkon=="ON"){
out.write("\n <input type=\"checkbox\" id=\"chk_search\" name=\"chk_search\" value=\"ON\" class=fashion_1 onclick=\"oncheck(this);\" checked><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>精确查询</font>\n ");
}else{
out.write("\n <input type=\"checkbox\" id=\"chk_search\" name=\"chk_search\" value=\"\" class=fashion_1 onclick=\"oncheck(this);\"><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>模糊查询</font>\n");
}
out.write("\n</td>\n</tr>\n</table>\n<br>\n<TABLE cellSpacing=1 cellPadding=0 width=\"95%\" align=center bgColor=#000000 style=\"background-color: #999999 \">\n<TBODY>\n<TR bgColor=#FFFFFF>\n<TD width=\"128\" >\n <CENTER><B><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'><a style=\"cursor:default;\">告警号<img src=\"\" alt=\"\"></a></font></B></CENTER></TD>\n<TD width=\"130\" >\n <CENTER><B><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'><a style=\"cursor: default;\">开始时间<img src=\"\" alt=\"\"></a></font></B></CENTER></TD>\n<TD width=\"210\" >\n <CENTER><B><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'><a style=\"cursor:default;\">站点<img src=\"\" alt=\"\"></a></font></B></CENTER></TD>\n <TD width=\"210\" >\n <CENTER><B><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'><a style=\"cursor:default;\">设备<img src=\"\" alt=\"\"></a></font></B></CENTER></TD>\n<TD>\n <CENTER><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'><B>操作</B></font></CENTER></TD>\n\n\n</TR>\n<TR bgColor=#ffffff>\n");
out.write(" <TD colSpan=3 height=15></TD>\n\t<TD align=\"center\"><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'></TD>\n\t <TD align=\"center\"><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>\n\t <A onclick=\"myalarm.add();\" style=\"cursor: default;\">新增</A> </FONT></TD>\n\t</TR>\n");
Vector vect = new Vector(); myalarm.setConnection(dbconn.getConnection());if(chkon=="ON")//精确查询{ if(strSrchZD=="1"||strSrchZD==null)//按开始时间查询 vect = (Vector)myalarm.getData(true,"stime",false,"stime",txtsrch,true); else if(strSrchZD=="2") vect = (Vector)myalarm.getData(true,"stime",false,"station",txtsrch,true); else if(strSrchZD=="3") vect = (Vector)myalarm.getData(true,"stime",false,"equipment",txtsrch,true); }else{ if(strSrchZD=="1" || strSrchZD==null )//按stime vect = (Vector)myalarm.getData(true,"stime",false,"stime",txtsrch,false); else if(strSrchZD=="2")//按stationvect = (Vector)myalarm.getData(true,"stime",false,"station",txtsrch,false);else if(strSrchZD=="3") vect = (Vector)myalarm.getData(true,"stime",false,"equipment",txtsrch,false);}Hashtable ht = (Hashtable)vect.get(0); String sql = (String)ht.get("sql");String bm = (String)request.getParameter("bm"); if(bm==null || bm=="") bm = "1"; int cur = Integer.parseInt(bm);//int recsum=0;//Integer it=(Integer)vect.lastElement();//if(it!=null) {recsum=it.intValue();}int recsum =((Integer)vect.get(vect.size()-1)).intValue();vect = (Vector)myalarm.getOnePage(sql,cur,3);int sum = Integer.parseInt((String)vect.get(0)); out.print(sum); String bgcolor="";for(int i=1;i<vect.size();i++){ if ((i%2)!=0) { bgcolor="#FFFFFF"; }else { bgcolor="#ffffff"; } Hashtable hash = (Hashtable)vect.get (i); String strno = (String)hash.get("no");//编号 String strstime = (String)hash.get("stime");//开始时间 String strstation = (String)hash.get("station"); String strequipment = (String)hash.get("equipment"); String strsignal = (String)hash.get("signal"); String stralarmInfo = (String)hash.get("alarmInfo");
out.write("\n <TR bgColor=\"");
out.print( bgcolor);
out.write("\" >\n <TD width=128 align=center><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>");
out.print(strno);
out.write("</font></TD>\n <TD width=130 align=center><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>");
out.print(strstime);
out.write("</font></TD>\n <TD width=130 align=center><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>");
out.print(strstation);
out.write("</font></TD>\n <TD width=130 align=center><font style='COLOR:#000000;FONT-FAMILY: 楷体_GB2312;font-size: 14px;'>");
out.print(strequipment);
out.write("</font></TD>\n <TD width=\"448\" align=center>\n <FONT color=\"#000000\">\n <A title=\"修改报警信息\"onclick=\"myalarm.mod('");
out.print(strno);
out.write("');\" style=\"cursor: default;\">修改</A>\n <A title=\"删除人员\"onclick=\"myalarm.delete('");
out.print(strno);
out.write("');\" style=\"cursor: default;\">删除</A>\n </FONT>\n </TD>\n </TR>\n ");
int t =-1; int s = -1;
out.write("\n <tr >\n <TD align=right colspan=8 bgColor=#FFFFFF>\n 共有记录数:");
out.print(recsum);
out.write(" \n ");
if(vect.size()>1){
out.write("\n 当前");
out.print(cur);
out.write('/');
out.print(sum);
out.write("页   <a onclick=\"firsrpg()\" style=\"cursor:hand\">第一页    </a> <!--href=\"index1.jsp?txt_type=3&bm=1\"-->\n ");
if(cur>1){ t=cur-1;
out.write("\n <a onclick=\"lastpg()\" style=\"cursor:hand\">上一页    </a>");
}
out.write("<!--href=\"index1.jsp?txt_type=3&bm=");
out.print(t);
out.write("\"-->\n ");
if(cur<sum){ s=cur+1;
out.write("\n <a onclick=\"nextpg()\" style=\"cursor:hand\">下一页   </a>");
}
out.write("  \n <!--href=\"index1.jsp?txt_type=3&bm=");
out.print(s);
out.write("\"-->\n <a onclick=\"finalpg()\" style=\"cursor:hand\">最后页    </a><!--href=\"index1.jsp?txt_type=3&bm=");
out.print(sum);
out.write("\"-->\n 直接<input type=image src=\"\" name=\"gotof\" onclick=\"return chkdata()\">\n <input type=text size=5 name=bm class=formcolor>页</TD>\n ");
}
out.write("\n </tr>\n\n</TBODY></TABLE>\n<script type=\"\">\nfunction firsrpg()\n{\n document.all.txt_type.value = \"3\";\n document.all.txt_edit.value = \"\";\n document.all.form1.action = \"index1.jsp?bm=1\";\n document.all.form1.submit();\n}\nfunction lastpg()\n{\n document.all.txt_type.value = \"3\";\n document.all.txt_edit.value = \"\";\n document.all.form1.action = \"index1.jsp?bm=\"+");
out.print(t);
out.write(";\n document.all.form1.submit();\n}\nfunction nextpg()\n{\n document.all.txt_type.value = \"3\";\n document.all.txt_edit.value = \"\";\n document.all.form1.action = \"index1.jsp?bm=\"+");
out.print(s);
out.write(";\n document.all.form1.submit();\n}\nfunction finalpg()\n{\n document.all.txt_type.value = \"3\";\n document.all.txt_edit.value = \"\";\n document.all.form1.action = \"index1.jsp?bm=\"+");
out.print(sum);
out.write(";\n document.all.form1.submit();\n}\nfunction chkdata()\n\t{\n\t\tdocument.all.txt_type.value = 3;\n\t\tif(!isDigit(document.all.bm.value))\n {\n\t\t\talert(\"输入的页码不是数字!\");\n\t\t\tdocument.all.bm.value=\"\";\n\t\t\tdocument.all.bm.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(document.all.bm.value==\"\")\n\t\t{\n\t\t\talert(\"请输入页码!\");\n\t\t\tdocument.all.bm.value=\"\";\n\t\t\tdocument.all.bm.focus();\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar t = document.all.bm.value;\n\t\t\tvar cur = ");
out.print(cur);
out.write(";\n\t\t\tvar sum = ");
out.print(sum);
out.write(";\n\n\t\t\twhile(t.length>cur.length)\n {\n\t\t\t\talert(\"请跳至1和\"+sum+\"之间!\");\n\t\t\t\tdocument.all.bm.value=\"\";\n\t\t\t\tdocument.all.bm.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(t==cur){return false;}\n\n\n\t\t\twhile(t.length>sum.length)\n\t\t\t{\n\t\t\t\talert(\"请跳至1和\"+sum+\"之间!\");\n\t\t\t\tdocument.all.bm.value=\"\";\n\t\t\t\tdocument.all.bm.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(t<1||t>sum)\n\t\t\t{\n\t\t\t\talert(\"请跳至1和\"+sum+\"之间!\");\n\t\t\t\tdocument.all.bm.value=\"\";\n\t\t\t\tdocument.all.bm.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n</script>\n");
}
out.write('\n');
if(myalarm!=null)myalarm.closeconn();
out.write('\n');
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -