⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filtermgr.jsp

📁 电信的网厅的整站代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.uurm.Purview,
                 com.doone.fj1w.common.ConfigFactory,
                 com.doone.data.*,
                 com.doone.uurm.WebAuth,
                 com.doone.fj1w.common.*"%>
<%String sPurvICode="NGB002002";%>
<%
	int iRowCount=10;
	int iStartPage=0;
	int iPageTotalCount=0;

	WebAuth auth = WebAuth.getInstance(request);

    if ( ! auth.IsAuthed() ) {
	    out.write("<script language=\"javascript\">self.parent.location.replace(\"" + request.getContextPath() + "/view/login/login.jsp" + "\");</script>");
	    return;
    }
	else if ( ! auth.CheckPurv(sPurvICode) ) {
	    out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
	    return;
	}

	Filters[] oFilters=Filters.getFiltersList(new DacClient());
	String sPage=request.getParameter("page");
	if(sPage!=null) iStartPage=new Integer(sPage).intValue()-1;
	if(oFilters!=null) {
		iPageTotalCount=oFilters.length/iRowCount;
		if(oFilters.length%iRowCount>0) iPageTotalCount++;
	}
	if(iStartPage<0)  iStartPage=0;
	if(iStartPage>=iPageTotalCount)  iStartPage=iPageTotalCount-1;
%>

<html>
<head>
<title>信息过滤管理</title>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
	<link href="../../common/style/main.css" rel="stylesheet" type="text/css" />
	<script language="JavaScript" src="../../common/XMLHttpClient.js"></script>
	<script language="JavaScript" src="../../common/script/ChangeStyle.js"></script>
	<script language="JScript.Encode" src="../../common/script/tree.js"></script>
	<script language="JavaScript">
	var intRowIndex = 1;
	var oldintRowIndex=1;
	function insertRow(tbIndex){
	   var objRow = myTable.insertRow(tbIndex);
	   var objCel = objRow.insertCell(0);
	   objCel.align="center";
	   objCel.innerHTML = "自动生成<input name=id type=\"hidden\" value=\"new\"></input>";
	   var objCel = objRow.insertCell(1);
	   objCel.innerHTML ="<input name=filter maxlength=20></input>";
	   var objCel = objRow.insertCell(2);
	   objCel.align="center";
	   objCel.innerHTML ="<input type=\"button\" class=\"button\" onclick=\"deleteRow(intRowIndex)\" value=\"删除行\">"
	   					+"";
	
	   objRow.attachEvent("onclick", getIndex);
	   objRow.attachEvent("onmouseover", getIndex);
	   clear();
	   objRow.style.backgroundColor = "#B0B0FF";
	   //objRow.style.cssText =  "background-color:#E8E8F0;"
	}
	
	function deleteRow(tbIndex){
		try {
			var ids = myTable.rows[tbIndex].cells[0].all.tags("input");
			if ( ids.length == 1 && ids[0].value != new String("new") ) {
				if (confirm("你确定删除?")) {
					var id=ids.item(0).value;//主键值
					if(deleteInDB(id)=="true"){
						myTable.deleteRow(tbIndex);
						if(tbIndex==1){
							window.location.reload();
						}
					}									
				}
			}
			else {
				myTable.deleteRow(tbIndex);
			}
		}
		catch(ex){}
	}
	
	function deleteInDB(FILTERINFOID){
		var xmlHttp = new XMLHttpClient("<%= request.getContextPath()%>/XmlHttpService");
		//传入信息编号
		xmlHttp.append("FILTERINFOID",FILTERINFOID);
		var str = xmlHttp.submitAsString("StringFilter","delete");
		if(str.substr(6)=="1") 
			return "true";
		else 
			return "false";
	}
	
	
	function getIndex(){
		try{
		   oldintRowIndex = event.srcElement.parentElement.rowIndex;
		   if(typeof(oldintRowIndex)!='undefined')intRowIndex=oldintRowIndex;
		   if(oldintRowIndex==0)    intRowIndex=1;
		   //pos.innerText = intRowIndex;
		   clear();
		   myTable.rows[intRowIndex].style.backgroundColor = "#B0B0FF";
	   }catch(ex){}
	}
	function clear()
	{
	   for(var i=0;i<myTable.rows.length;i++)
	   {
		   myTable.rows[i].style.cssText =  "background-color:#FFFFFF";
	   }
	}
	function go1(){
		window.location='./FilterMgr.jsp?page='+document.all.go_page1.options[document.all.go_page1.selectedIndex].value;
	}
	function go2(){
		window.location='./FilterMgr.jsp?page='+document.all.go_page2.options[document.all.go_page2.selectedIndex].value;
	}
	</script>
	
	<SCRIPT LANGUAGE="JavaScript">
	function windowOpen(url,width,height) {
		window.open(url,"windowRef","width=" + width + ",height=" + height+",top=120,left=200,screenX=10,screenY=20");
	}
	function openPopup(){
		window.open("","_popup","toolbars=0,location=0,top=150,left=200,width=600,height=400");
		return true;
	}
	</script>
	<style><!--
		select {width: 50px;}
		input {width: 100%;}
	--></style>
</head>
<body onload="clear()">
<jsp:include page="../../common/inc_top.jsp" >
	<jsp:param name="purvCode" value="<%=sPurvICode%>"/>
</jsp:include>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="400">
</table>
<form name="myForm" action="/manager/updatefilters" target="_popup" onsubmit="return openPopup()">
<table width="100%" border="0" cellpadding="1" cellspacing="1" class="InnerTable" >
<tr>
	  <td class="OuterHead" colspan="2">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="OuterTable">
      <tr>
      <td>
      <span id="ItemTitle"><font face="webdings">8</font>信息过滤管理</span><br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span>
      *说明:	请在右边的输入框中输入您需要过滤的关键字,网页中添加内容是如果有出现这些关键字,系统将不允许提交。
       主要设置信息为色情、暴力、反动性等关键字眼。
       </span>
      </td>     
    </tr>
  <tr>
    <td class="InnerMain" width="100%"  align="left" valign="top">
    	  <table width="100%" align="center" border="0" cellpadding="2" cellspacing="1" class="InnerTable" id="myTable">
       <tr>
       <td class="InnerHead" width="20%" align="center">编号</td>
       <td class="InnerHead" width="60%"  align="left">过滤信息</td>
       <td class="InnerHead" width="20%"  align="center">
       <input type="button" class="button" onclick="insertRow(myTable.rows.length);" value="添加行">
       <input type="submit" class="button"  value="保存"></td>
       </tr> <%
	if(oFilters!=null && oFilters.length > 0) {  
		if(iPageTotalCount<=1) {
			out.print("<input name=old_id type=hidden value=\"");
			for(int i=0;i<oFilters.length-1;i++) {
			    out.print(oFilters[i].getFilterInfoId()+"_");
			}
			out.print(oFilters[oFilters.length-1].getFilterInfoId());
			out.print("\"></input>");
			for(int i=0;i<oFilters.length;i++) { %>
       <tr onclick="getIndex()" onmouseover="getIndex()">
	       <td align="center"><input name=id type="hidden" value="<%=oFilters[i].getFilterInfoId()%>"></input><%=oFilters[i].getFilterInfoId()%></td>
	       <td align="left"><input name=filter maxlength="20" value="<%=oFilters[i].getFilterInfo()%>"></input></td>
	       <td align="center"><input type="button" class="button" onclick="deleteRow(intRowIndex)" value="删除行"></td>
       </tr> <%
			}
		}
		else {
			int icount=(iStartPage+1)*iRowCount;
			if(icount>oFilters.length) icount= oFilters.length;
	
			out.print("<input name=old_id type=hidden value=\"");
	        for(int i=iStartPage*iRowCount;i<(icount-1);i++) {
	              out.print(oFilters[i].getFilterInfoId()+"_");
	        }
	        out.print(oFilters[icount-1].getFilterInfoId());
	        out.print("\"></input>");
	        for(int i=iStartPage*iRowCount;i<icount;i++) { %>
          <tr onclick="getIndex()" onmouseover="getIndex()">
	          <td width="20%" align="center"><input name=id type="hidden" value="<%=oFilters[i].getFilterInfoId()%>"></input><%=oFilters[i].getFilterInfoId()%></td>
	          <td width="60%"  align="left"><input name=filter maxlength="20" value="<%=oFilters[i].getFilterInfo()%>"></input></td>
	          <td width="20%"  align="center"><input type="button" class="button" onclick="deleteRow(intRowIndex)" value="删除行"></td>
          </tr> <%
	         }
   		}
	} %>
      </table>
    </td>
  </tr>
  <tr>
	  <td class="OuterHead" colspan="2">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="OuterTable">
      <tr>
      <td>
      <span id="ItemTitle">

      </td>
      <td class="OuterHead" align="right">
      <span id="ItemTitle"><input type="button" class="button" value="上一页" onclick="javascript:window.location='./FilterMgr.jsp?page=<%=iStartPage%>'"></input>
      <input type="button" class="button" value="下一页" onclick="javascript:window.location='./FilterMgr.jsp?page=<%=iStartPage+2%>'"></input>
      <select name="go_page2" onchange="go2()" >
      <%      
          for(int i=1;i<=iPageTotalCount;i++)
          {   if(i==(iStartPage+1))
              out.print("<option value="+i+" selected>"+i+"</option>");
              else
              out.print("<option value="+i+">"+i+"</option>");
          }
      %>
      </select></span>
      </td>
      </tr>
      </table>
<%--      <span id="pos"></span>--%>
      </td>


    </tr>
</table>


</form>
  </center>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -