📄 batchset.jsp
字号:
<%@ page session="true" buffer="none" contentType="text/html; charset=GB2312" import="java.sql.*,java.util.*,java.lang.*,net.xerllent.campus.util.*,net.xerllent.campus.database.*,net.xerllent.campus.sysadmin.*" %>
<%
security.checkAuth(session,"Ic",response,request);
int AuthLevel=security.getAuthLevel(session,"Ic");
%>
<%
//得到用户所选的查询条件值
String logtime=ParamUtils.getParameter(request,"selectregtime","*");
String status=ParamUtils.getParameter(request,"selectstatus","*");
String idletime=ParamUtils.getParameter(request,"selectidletime","*");
String str="";
int currentRecord=0; //记录的当前位置
int pagecolorint=0; //记录页面颜色的交替显示顺序
String PageColor=new String(); //页面显示的颜色
Calendar cal=Calendar.getInstance();
CString cstring=new CString();
String nowstr=cstring.getDateTimeString(cal.getTime());
String sqlstr="select UserID,UserName,UserTrueName,UserMTeamName,UserPassed,ConstrainIPPassed,ArchiveEditKey from act_user where UserID>0";
if(!status.equals("*"))
sqlstr+=" and UserPassed="+status;
if(!logtime.equals("*")){
cal.add(Calendar.DATE,-Integer.parseInt(logtime));
String timestr=cstring.getDateString(cal.getTime());
sqlstr+=" and UserCreateTime>='"+timestr+"'";
}
if(!idletime.equals("*")){
cal.add(Calendar.DATE,-Integer.parseInt(idletime));
String timestr=cstring.getDateTimeString(cal.getTime());
sqlstr+=" and UserLastLogTime<'"+timestr+"'";
}
DbQuery myQuery=new DbQuery ();
myQuery.setPageSize(request);
myQuery.setCurrentPage(request) ;
myQuery._currentPageURL="";
myQuery.setHidden("selectregtime",logtime);
myQuery.setHidden("selectstatus",status);
myQuery.setHidden("selectidletime",idletime);
myQuery.prepareStatement(sqlstr);
myQuery.executeQuery();
%>
<html>
<head>
<title>校园.NET</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="../../jscript/floatPanel.js"></script>
<script>
//js函数将所有的checkbox都选中
function delchkAllItem(){
var count;
count=form1.recordcount.value;
if(form1.deletechk.checked==true){
for(i=0;i<count;i++){
if(eval("form1.deletechk"+i+".disabled")==false)
eval("form1.deletechk"+i+".checked=true");
}
}else{
for(i=0;i<count;i++){
eval("form1.deletechk"+i+".checked=false");
}
}
}
function constrchkAllItem(){
var count;
count=form1.recordcount.value;
if(form1.ipconstrainchk.checked==true){
for(i=0;i<count;i++){
eval("form1.ipconstrainchk"+i+".checked=true");
}
}else{
for(i=0;i<count;i++){
eval("form1.ipconstrainchk"+i+".checked=false");
}
}
}
function editchkAllItem(){
var count;
count=form1.recordcount.value;
if(form1.archeditkeychk.checked==true){
for(i=0;i<count;i++){
eval("form1.archeditkeychk"+i+".checked=true");
}
}else{
for(i=0;i<count;i++){
eval("form1.archeditkeychk"+i+".checked=false");
}
}
}
function permitchkAllItem(){
var count;
count=form1.recordcount.value;
if(form1.permitchk.checked==true){
for(i=0;i<count;i++){
eval("form1.permitchk"+i+".checked=true");
}
}else{
for(i=0;i<count;i++){
eval("form1.permitchk"+i+".checked=false");
}
}
}
//确认函数,是否真要删除记录
function checkit(){
var sObj;
if(confirm("删除该成员的所有信息,确认要删除吗?")){
form1.ondelete.value="1";
form1.submit();
}
}
</script>
<link rel="stylesheet" href="../../images/campus.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0">
<table width="100%" height="22" border="0" cellspacing="0" cellpadding="0">
<tr>
<td ></td>
</tr>
</table>
<DIV id=floater style="LEFT: 0px; TOP: 0px">
<form name="buttonform" action="" method=post>
<table width="100%" class="gl_mainBar" height="22" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" nowrap>【系统管理-批量设置】</td>
<td align="right" nowrap>
<input type="button" name="Submit0" value="设 置" class="button1" onClick="form1.submit()" <%if(AuthLevel<2){out.print("disabled");}%>>
<input type="button" name="Submit1" value="删 除" class="button1" onClick="checkit()" <%if(AuthLevel<3){out.print("disabled");}%>>
<input type="button" name="Submit2" value="恢 复" class="button1" onClick="form1.reset()">
</td>
<td width="10"> </td>
</tr>
</table>
</form>
</DIV>
<form name="form2" action="" method=post class="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="40" class="f90">
<tr>
<td width="128" background="../../images/ModIco_System.gif" nowrap valign="bottom" align="right"><b><font size="3">批量设置</font></b></td>
<td align="right" nowrap> 注册时间
<select name="selectregtime" class="input1" onchange="form2.submit()">
<option value="0" <% if(logtime.equals("0")) { %>selected<% } %>>今天</option>
<option value="1" <% if(logtime.equals("1")) { %>selected<% } %>>1天内</option>
<option value="7" <% if(logtime.equals("7")) { %>selected<% } %>>1星期内</option>
<option value="30" <% if(logtime.equals("30")) { %>selected<% } %>>1月内</option>
<option value="60" <% if(logtime.equals("60")) { %>selected<% } %>>2月内</option>
<option value="180" <% if(logtime.equals("180")) { %>selected<% } %>>半年内</option>
<option value="360" <% if(logtime.equals("360")) { %>selected<% } %>>1年内</option>
<option value="*" <% if(logtime.equals("*")) { %>selected<% } %>>所有</option>
</select>
帐号状态
<select name="selectstatus" class="input1" onchange="form2.submit()">
<option value="0" <% if(status.equals("0")) { %>selected<% } %>>禁用</option>
<option value="1" <% if(status.equals("1")) { %>selected<% } %>>启用</option>
<option value="*" <% if(status.equals("*")) { %>selected<% } %>>所有</option>
</select>
帐号闲置
<select name="selectidletime" class="input1" onchange="form2.submit()">
<option value="30" <% if(idletime.equals("30")) { %>selected<% } %>>1月以上</option>
<option value="60" <% if(idletime.equals("60")) { %>selected<% } %>>2月以上</option>
<option value="90" <% if(idletime.equals("90")) { %>selected<% } %>>3月以上</option>
<option value="120" <% if(idletime.equals("120")) { %>selected<% } %>>4月以上</option>
<option value="150" <% if(idletime.equals("150")) { %>selected<% } %>>5月以上</option>
<option value="180" <% if(idletime.equals("180")) { %>selected<% } %>>半年以上</option>
<option value="360" <% if(idletime.equals("360")) { %>selected<% } %>>1年以上</option>
<option value="*" <% if(idletime.equals("*")) { %>selected<% } %>>所有</option>
</select>
</td>
<td align="right" width="10"> </td>
</tr>
</table>
</form>
<%myQuery.printPageBooter(out);%>
<form name='form1' action='dealbatchset.jsp' class='form' method=post>
<table width='90%' border='0' cellspacing='0' cellpadding='0' class='f90' align='center'>
<tr>
<td width='30' height='20' class='gl_tdBar' align='center'>
<input type='checkbox' name='deletechk' value='checkbox' onclick='delchkAllItem();'>
</td>
<td class='gl_tdBar' nowrap >用户姓名
</td>
<td class='gl_tdBar' nowrap >登陆名称
</td>
<td class='gl_tdBar' nowrap>主属部门
</td>
<td class='gl_tdBar' width='120' nowrap>IP限制启用
<input type='checkbox' name='ipconstrainchk' value='checkbox' onclick='constrchkAllItem();'>
</td>
<td class='gl_tdBar' width='130' nowrap>档案编辑开关
<input type='checkbox' name='archeditkeychk' value='checkbox' onclick='editchkAllItem();'>
</td>
<td class='gl_tdBar' width='90' nowrap>帐号禁用
<input type='checkbox' name='permitchk' value='checkbox' onclick='permitchkAllItem();'>
</td>
</tr>
<%
ResultSet rs = myQuery.getResultSet();
int recordcount=0;
if(rs!=null) {
Vector AllTeamVect=new Vector();
AllTeamVect.addAll(Team.getAllTeam().values());
//循环显示所有查询出来的结果
for(int i=0;i<myQuery._pageSize;i++) {
if(pagecolorint==0){
PageColor="gl_tdColor1";
pagecolorint=1;
}else{
PageColor="gl_tdColor2";
pagecolorint=0;
}
str=("<tr><td align='center' class='"+PageColor+"'>");
str+="<input type='checkbox' name=\"";
str+="deletechk"+i;
str+="\"";
if(User.isSystemUser(rs.getInt("UserID")))
str+=" disabled ";
str+=" value='"+new String().valueOf(rs.getInt("UserID"))+"'>";
str+=("</td><td class='"+PageColor+"'>");
out.println(str) ;
str="<a href='../UserUpdate.jsp?UserID="+rs.getInt("UserID")+"'>" ;
str+=rs.getString("UserTrueName") ;
str+="</a>";
str+=("</td><td class='"+PageColor+"'>") ;
out.println(str) ;
str=rs.getString("UserName") ;
str+="<input type='hidden' name='username"+i+"' value="+rs.getString("UserName")+" >";
str+=("</td><td class='"+PageColor+"' width='120'> <select name='select"+i+"' calss='input1'>");
out.println(str) ;
String teamname= rs.getString("UserMTeamName") ;
for(int j=0;j<AllTeamVect.size();j++){
String TeamName=AllTeamVect.elementAt(j).toString();
if(teamname.equals(TeamName))
out.println("<option value='"+TeamName+"' selected>"+TeamName+"</option>\n");
else
out.println("<option value='"+TeamName+"'>"+TeamName+"</option> \n");
}
if(teamname.equals("无部门"))
str="<option value='无部门' selected>无部门</option>";
else
str="<option value='无部门'>无部门</option>";
out.println(str);
str="</select></td><td align='center' class='"+PageColor+"'>";
out.println(str) ;
if( rs.getInt("ConstrainIPPassed")>0){
str="<input type='checkbox' name='ipconstrainchk"+i+"' value='1' checked></td><td align='center' class='"+PageColor+"'>";
out.println(str) ;
}else{
str="<input type='checkbox' name='ipconstrainchk"+i+"' value='1'></td><td align='center' class='"+PageColor+"'>";
out.println(str) ;
}
if( rs.getInt("ArchiveEditKey")>0){
str="<input type='checkbox' name='archeditkeychk"+i+"' value='1' checked></td><td align='center' class='"+PageColor+"'>";
out.println(str) ;
}else{
str="<input type='checkbox' name='archeditkeychk"+i+"' value='1'></td><td align='center' class='"+PageColor+"'>";
out.println(str) ;
}
if( rs.getInt("UserPassed")>0){
str="<input type='checkbox' name='permitchk"+i+"' value='0'></td><td align='center' class='"+PageColor+"'>";
out.println(str) ;
}else{
str="<input type='checkbox' name='permitchk"+i+"' value='0' checked></td></tr>";
out.println(str) ;
}
recordcount++;
if(!rs.next()){
break;
}
}
}
myQuery.close();
%>
<tr>
<td width='30' height='20' class='gl_tdBar'> 删 </td>
<td class='gl_tdBar' nowrap >用户姓名</td>
<td class='gl_tdBar' nowrap >登陆名称</td>
<td class='gl_tdBar' nowrap>主属部门</td>
<td class='gl_tdBar' width='110' nowrap>IP限制启用</td>
<td class='gl_tdBar' width='120' nowrap>档案编辑开关</td>
<td class='gl_tdBar' width='90' nowrap>帐号禁用</td>
</tr>
</table>
<input type='hidden' name='ondelete' value="0">
<input type='hidden' name='recordcount' value=<%=recordcount%> >
</form>
<%myQuery.printPageFooter(out);%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -