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

📄 systemuser_editlist.asp

📁 ASP程序实现的科技期刊系统
💻 ASP
字号:
<!--#include file="../Include/TimeOut.asp"-->
<%modulecode="0203"%>
<!--#include file="../Include/ModuleUserCheck.asp"-->
<!--#include file="../Include/online.asp"-->
<html>
<head>
<title>系统用户列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
TD {FONT-SIZE: 9pt}

A:link
{
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}
A:visited
{
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}
A:active
{
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}
A:hover
{
    COLOR: blue;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}

</style>
</head>

<Script Language=JavaScript>
<!--
function SelAll_onclick(){
	if(ConList.SelAll.checked){
		SetAll();
	}
	else{
		UnSetAll();
	}
}
function SetAll(){
	var intCount;
	if(ConList.all("checkCon").length > 1){
		for(intCount = 0; intCount < ConList.all("checkCon").length; intCount++){
			ConList.checkCon(intCount).checked = true;
		}
	}
	else{
		ConList.checkCon.checked = true;
	}
	
}
function UnSetAll(){
	var intCount;
	if(ConList.all("checkCon").length > 1){
		for(intCount = 0; intCount < ConList.all("checkCon").length; intCount++){
			ConList.checkCon(intCount).checked = false;
		}
	}
	else{
		ConList.checkCon.checked = false;
	}
	
}
function checkCon_onclick(){
	var intCount;
	ConList.SelAll.checked = true;
	if(ConList.all("checkCon").length > 1){
		for(intCount = 0; intCount < ConList.all("checkCon").length; intCount++){
			if(ConList.checkCon(intCount).checked == false){
				ConList.SelAll.checked = false;
			}
		}
	}
	else{
		if(ConList.checkCon.checked == false){
			ConList.SelAll.checked = false;
		}
	}
	
}
			function open1(Code)
			{
			window.open("/user/User_MoreDisplay.asp?Code="+Code,"用户详细资料","height=410,width=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no")
			}
//-->
</Script>

<script language="vbscript"runat="server">
function msgzh()
	msgzh= MsgBox ("确定要删除这些记录吗?", vbYesNo, "提示信息")
	if msgzh=vbyes then document.ConList.submit()
end function
function check_onclick(i,tpr)
	msgsindel= MsgBox ("确定要删除这条记录吗?", vbYesNo, "提示信息")
	if msgsindel=vbyes then
		if  tpr > 1 then
			for intcount = 0 to  ConList.all("checkCon").length - 1
				if intcount=i-1 then ConList.checkCon(intCount).checked=true else  ConList.checkCon(intCount).checked=false
			next
			else 
			ConList.checkCon.checked = true
		end if
		document.ConList.submit()
	end if 
end function


</script>



<body bgcolor="#FFFFFF" text="#000000">

<%
	dim objrec         'recordset对象
	dim strsql         'sql语句
	dim delYN		   '是否有管理员权限
	delYN="n"	
	for i=0 to ubound(session("role"))-1
		if session("role")(i)="系统维护员" then delYN="y"
	next

	if Request.QueryString("muldel")="muldel"then   '从删除转来, 删除相应记录
			for each item in  Request.Form("checkCon")
				code=Item
				if delYN="n" and len(code)=3 then'跳出循环,无管理员权限,并欲删除的用户编码为3位主管部门
				else'执行
	            set adocom=server.CreateObject("ADODB.Command")
	  	        adocom.ActiveConnection=conn
				adocom.CommandType=4
				adocom.CommandText="PR_XT_UserDelete"
				set paramenter1=adocom.CreateParameter("chrUserCode",200,1,40,code)
				adocom.Parameters.Append paramenter1
				adocom.Execute
				set adocom=nothing
				end if
			next
		set adocom=nothing
	end if 
	
if not  Request.QueryString("strsql")="" then
	select case Request.QueryString("strsql")
	case "query"	'由查询转来
			dim code
			dim name
			dim sex,zhicheng,xueli,xuewei
			dim strQueryType
			dim strSQLWhere
			code=trim(Request.Form("usercode"))
			name=trim(Request.Form("username"))
			sex=trim(Request.Form("sex"))
			zhiwei=trim(Request.Form("zhiwei"))
			xueli=trim(Request.Form("xueli"))
			zhicheng=trim(Request.Form("zhicheng"))
			departcode=trim(Request.Form("departcode"))
			YouXiao=trim(Request.Form("YouXiao"))
			role=trim(Request.Form("role"))
			'复选框选中时,strQueryType="%"
			if Request.Form("checkbox").Count=1 then
			   strQueryType="%"
			   else 
			   strQueryType=""
			end if
			'无任何where选项时
			strsql="select * from XT_VC_User where 1=1"
			'根据角色生成where选项
			select case role
				case 0 '系统维护员
				strSQLWhere=""
				case 1 '申报者
				strSQLWhere="and 有效标志='1'"
				case 2 '主管部门
				strSQLWhere=" and left(用户编码,3)='"&left(session("UserCode"),3)&"'"
				case 3 '项目计划员
				strSQLWhere=""
				case 4 '项目管理员
				strSQLWhere=""
				case 5 '项目拨款员
				strSQLWhere=""
				case 6 '部门领导
				strSQLWhere=""
			end select
			
			'按查询界面各输入框生成多条件where选项
			if not code="" then
			   strSQLWhere=strSQLWhere+" and 用户编码 like '"+strQueryType+code+strQueryType+"'"
			end if
			if not name="" then
			   strSQLWhere=strSQLWhere+" and 用户姓名 like '"+strQueryType+name+strQueryType+"'"
			end if
			if not sex="" then
			   strSQLWhere=strSQLWhere+" and 性别 like '"+strQueryType+sex+strQueryType+"'"
			end if
			if not Zhicheng="" then
			   strSQLWhere=strSQLWhere+" and 职称 like '"+strQueryType+ZhiCheng+strQueryType+"'"
			end if
			if not XueLi="" then
			   strSQLWhere=strSQLWhere+" and 学历 like '"+strQueryType+XueLi+strQueryType+"'"
			end if
			if not ZhiWei="" then
			   strSQLWhere=strSQLWhere+" and 学位 like '"+strQueryType+ZhiWei+strQueryType+"'"
			end if
			if not DepartCode="" then
			   strSQLWhere=strSQLWhere+" and 部门编码 like '"+strQueryType+DepartCode+strQueryType+"'"
			end if
			if not YouXiao="" then
			   strSQLWhere=strSQLWhere+" and 有效标志 like '"+strQueryType+YouXiao+strQueryType+"'"
			end if
			strSQL=strSQL+StrSQLWhere

	case else  '各页间转换
			strsql=Request.QueryString("strsql")
			
	end  select
	set objres=server.CreateObject ("adodb.recordset")
	objres.CursorType =3
	objres.CursorLocation =3
	objres.LockType =2
	objres.Open strsql,strconn
	
	
	dim pagesum '页数
	dim thispagerecords '当前页记录条数 
	dim recordcode '记录序号
	dim curpage '当前页码
	dim pagesize
	pagesize=10
	pagesum=objres.PageCount 
	if Request.QueryString("page")=""then curpage=1 else curpage=Request.QueryString("page")
	
	if cint(curpage)> cint(pagesum) then curpage=pagesum           '转换成整数格式时必须的,大量实验已经证明
end if
%>
 <% if not  Request.QueryString("strsql")="" then %> 
 <form name=ConList method="post" action="systemUser_EditList.asp?muldel=muldel&strsql=<%=server.URLEncode(strsql)%>&page=<%=curpage%>">
 <% else %>   
   <form name=ConList method="post" action="systemUser_EditList.asp">
  <% 
   end if
  %> 
 
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
      <td width="457"><img src="../User/Images/title_user.gif" width="227" height="38"></td>
    <td width="50">
      <div align="center"><a href="systemUser_Query.asp?query=query"><img src="../public/images/query.gif" width="24" height="18" border="0"><br>
       </a> <font color="#003399">查询</font></div>
    </td>
    <td width="50"> 
        <div align="center"><a href="../user/selfUsercode_edit.asp?strsql=<%=server.URLEncode (strsql)%>&page=<% =curpage%>" ><img src="../public/images/new.gif" width="19" height="23" border="0"></a><br>
        <font color="#003399">新增</font> </div>
    </td>
    <td width="50"> 
        <div align="center"><a href="vbscript:msgzh()"><img src="../public/images/del.gif" width="23" height="20" border="0"></a><br>
        <font color="#003399">删除</font> </div>
    </td>
    <td width="50"> 
      <div align="center"><a href="#"><img src="../public/images/print.gif" width="23" height="20" border="0"></a><br>
        <font color="#003399">打印</font></div>
    </td>
  </tr>
</table>


  <table width="100%" border="0" cellspacing="1" cellpadding="1" bordercolor="#0099FF" align="center" bgcolor="#006699">
    <tr bordercolor="#0099FF" bgcolor="#6699CC"> 
      <td width="25" height="26"> 
        <div align="center"><a href="#"> 
          <input type="checkbox" name="SelAll" onclick ="SelAll_onclick()"value="checkbox">
          </a></div>
      </td>
      <td width="38" height="26" align="center"> 
        <div align="center"><font color="#FFFFFF">序号</font></div>
      </td>
      <td width="83" height="26"> 
        <div align="center"><font color="#FFFFFF">用户编码</font></div>
      </td>
      <td height="26" width="164"> 
        <div align="center"><font color="#FFFFFF">用户姓名</font></div>
      </td>
      <td height="26" width="121"> 
        <div align="center"><font color="#FFFFFF">用户类型</font></div>
      </td>
      <td width="88" height="26"> 
        <div align="center"><font color="#FFFFFF">有效标志</font></div>
      </td>
      <td width="73" height="26"> 
        <div align="center"><font color="#FFFFFF">详细资料</font></div>
      </td>
      <td width="88" height="26"> 
        <div align="center"><font color="#FFFFFF">用户设置</font></div>
      </td>
      <td width="38" height="26"> 
        <div align="center"><font color="#FFFFFF">修改</font></div>
      </td>
      <td width="50" height="26"> 
        <div align="center"><font color="#FFFFFF">删除</font></div>
      </td>
    </tr>
    <%
	if   Request.QueryString("strsql")="" then Response.End 
	if objres.RecordCount >pagesize*curpage then thispagerecords=pagesize else thispagerecords=objres.RecordCount-pagesize*(curpage-1)
	recordcode=10*(curpage-1)
	if objres.RecordCount >0 then 
			objres.MoveFirst 
			objres.Move((curpage-1)*10)	
		else 
	%>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="10" height="26"> 对不起,没有符合要求的记录! </td>
    </tr>
    <%
			Response.End 
	end if
    for i=1 to thispagerecords 
     recordcode=recordcode+1
    %>
    <tr bgcolor="#FFFFFF"> 
      <td width="25" height="26" align="center"> 
        <div align="center"> 
          <input type="checkbox" name="checkCon" <%if role=2 and len(objres.Fields("用户编码").Value)=3 then %> onclick="alert('您无删除主管部门的权限!');this.checked=false" <%else%>onclick="checkCon_onclick()" <%end if%>value=<% =objres.Fields("用户编码").Value %>>
        </div>
      </td>
      <td width="38" height="26" align="center"> 
        <% =recordcode%>
      </td>
      <td width="83" height="26"> 
        <% = objres.Fields("用户编码").Value %>
      </td>
      <td height="26" width="164"> 
        <%  = objres.Fields("用户姓名").Value %>
      </td>
      <td height="26" width="121"> <%=objres("用户类型")%> </td>
      <td width="88" height="26"> 
        <%if not objres("有效标志")="1" then Response.Write "× " else Response.Write "√" end if%>
      </td>
      <td width="73" height="26" align="center"><a href="javascript:open1('<%=objres("用户编码")%>')"><img src="../User/Images/more.jpg" width="47" height="16" border="0"></a> 
      </td>
      <td width="88" height="26" align="center"><a href="/user/UserCode_Confirm_Edit.asp?code=<% = objres.Fields("用户编码").Value %>&strsql=<%=server.URLEncode (strsql)%>&page=<% =curpage%>"><img src="../User/Images/more.gif" width="16" height="15" border="0"></a> 
      </td>
      <td width="38" height="26" align="center"> 
        <div align="center"><a href="<%if len(objres.Fields("用户编码").Value)=3 then %>../system/topdepart_edit.asp?<%else%>../user/selfUserCode_edit.asp?<%end if%>code=<% = objres.Fields("用户编码").Value %>&name=<% =objres.Fields("用户姓名").Value %>&strsql=<%=server.URLEncode(strsql)%>&page=<%=curpage%>&edit=edit"><img src="../public/images/edit.gif" width="19" height="17" border="0"></a></div>
      </td>
      <td width="50" height="26" align="center"> 
        <div align="center"><%if role=2 and len(objres.Fields("用户编码").Value)=3 then %><a href="javascript:alert('您无删除主管部门的权力!')"><%else %></a><a href="vbscript:check_onclick(<%=i%>,<% =thispagerecords%>)"><%end if%><img src="../public/images/del1.gif" width="19" height="17" border="0"></a></div>
      </td>
    </tr>
    <%
     objres.MoveNext 
       next
    %>
    <tr> 
      <td colspan="10" height="26" bgcolor="#6699CC"> 
        <div align="right"> 
          <%
 
    if   curpage>1 then  Response.Write ("<a href="+"systemUser_EditList.asp?page=1"+"&strsql="+server.URLEncode(strsql)+"> 首页</a>"+" | ") else Response.Write "首页 | "
    if   recordcode>pagesize then   Response.Write ("<a href="+"systemUser_EditList.asp?page="+cstr(curpage-1)+"&strsql="+server.URLEncode(strsql)+"> 上一页</a>"+" | ") else Response.Write "上一页 | "
    if   recordcode<objres.RecordCount  then   Response.Write ("<a href="+"systemUser_EditList.asp?page="+cstr(curpage+1)+"&strsql="+server.URLEncode(strsql)+"> 下一页</a>"+" | ") else Response.Write "下一页 | "
    if    recordcode<objres.RecordCount  then   Response.Write ("<a href="+"systemUser_EditList.asp?page="+cstr (pagesum)+"&strsql="+server.URLEncode(strsql)+"> 末页</a>"+"  ") else Response.Write "末页  "
     %>
            第 
          <%  =curpage %>
          页/共 
          <% =pagesum  %>
          页/共 
          <% =objres.RecordCount %>
          条记录  </div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

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