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

📄 admin_provuser.asp

📁 这是去年开发的中移鼎讯手机进销存系统 大家
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
dim iCount,Action
Action=Trim(request("Action"))
if GetUserGPower<>9999  then 
	Call  Msg("您没有权限",1,"")
End if
%>
<html>
<head>
<title>用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/mobile_sale.css" rel="stylesheet" type="text/css">
<script src="../js/ChkFrm.js" language=javascript></script>
<SCRIPT language=javascript>

function CheckAdd()
{
  if(document.form1.username.value=="")
    {
      alert("用户名不能为空!");
	  document.form1.username.focus();
      return false;
    }
    
  if(document.form1.Password.value=="")
    {
      alert("密码不能为空!");
	  document.form1.Password.focus();
      return false;
    }
    
  if((document.form1.Password.value)!=(document.form1.PwdConfirm.value))
    {
      alert("初始密码与确认密码不同!");
	  document.form1.PwdConfirm.select();
	  document.form1.PwdConfirm.focus();	  
      return false;
    }
	
  if (document.form1.Purview[1].checked==true){
	GetClassPurview();
  }
}
function CheckModifyPwd()
{
  if(document.form1.Password.value=="")
    {
      alert("密码不能为空!");
	  document.form1.Password.focus();
      return false;
    }
  if((document.form1.Password.value)!=(document.form1.PwdConfirm.value))
    {
      alert("初始密码与确认密码不同!");
	  document.form1.PwdConfirm.select();
	  document.form1.PwdConfirm.focus();	  
      return false;
    }
}

function CheckModifyPurview()
{
  if (document.form1.Purview[1].checked==true){
	GetClassPurview();
  }
}



</script>

</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2" align="center"><strong>用 户 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航:</strong></td>
    <td height="30">
<%
	Dim Rst,Sqlt,k
	if GetUserGPower=9999 then
		Response.Write("&nbsp;<a href=""Admin_ProvUser.asp?CityID=0"">省级用户</a>&nbsp;|&nbsp;<font color=""#0000FF"">查看各地区用户:</font>")
		Sqlt="Select CityID,CityName from City order by CityID asc;"
		Call sql_open(Rst,Sqlt,Conn,1,1)
		for k=0 to Rst.recordcount
			Response.write "<a href=Admin_ProvUser.asp?CityID="&Rst("CityID")&">"&Rst("CityName")&"</a>&nbsp;"
			Rst.movenext
			If Rst.eof then Exit for
		Next
		Call Rs_End(Rst)
	elseif GetUserGPower=999 then	
		Response.write ("<br><font color=""#0000FF"">查看各县用户:</font>")
		Sqlt = "Select County.*,City.* from County Inner join City on City.CityID=County.CityID where City.CityID='"&cstr(GetCityID)&"' order by County.CountyID asc;"
		Call sql_open(Rst,Sqlt,Conn,1,1)
		for k=0 to Rst.Recordcount
			Response.write "<a href=Admin_ProvUser.asp?CityID="&Rst("CityID")&"&CountyID="&Rst("CountyID")&">"&Rst("CountyName")&"</a>&nbsp;"
			Rst.movenext
			If Rst.eof then Exit For
		Next
		Call Rs_End(Rst)
	end if	
	%>
	
	</td>
  </tr>
</table>
<%

if Action="Add" then
	call AddAdmin()
elseif Action="SaveAdd" then
	call SaveAdd()
elseif Action="ModifyPwd" then
	call ModifyPwd()
elseif Action="SaveModifyPwd" then
	call SaveModifyPwd()
elseif Action="CheckList" then		'审核
	call CheckList()
elseif Action="Del" then
	call DelAdmin()
else
	call main()
end if

call Conn_End(conn)

sub main()
	Dim CityID,CountyID
	CityID = Request("CityID")
	CountyID = Request("CountyID")
'////////////////////////////////////////////////////
	if CityID="" Then
		Sql = "select T_User.*,T_UserGroup.* from T_User Inner join T_UserGroup on T_UserGroup.UserGID=T_User.UserGID where T_UserGroup.UserGPower='"&cstr(GetUserGPower)&"' order by T_User.UserID desc;"
	Else
		Sql = "select T_User.*,T_UserGroup.* from T_User Inner join T_UserGroup on T_UserGroup.UserGID=T_User.UserGID where T_User.CityID='"&cstr(CityID)&"' order by T_User.UserID desc;"
	End if
'/////////////////////////////////////////////////////
	Call sql_open(Rs,Sql,Conn,1,1)
	iCount=Rs.recordcount
%>
<br>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
  <tr>
  <form name="myform" method="Post" action="Admin_ProvUser.asp" onsubmit="return confirm('确定要删除选中的用户吗?');">
     <td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr align="center" class="title">
    <td height="22">组</td>
    <td>公司名</td>
    <td>用户名</td>
    <td>姓名</td>
    <td>电话</td>
    <td>状态</td>
    <td>操作</td>
    </tr>
  <%do while not Rs.EOF %>
  <tr align="center" class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'"> 
    <td>
<%
	if Rs("UserGID")=8 and Rs("CountyID")=0 then
		Response.write "<font color='#0000FF'>市</font>分销点"
	elseif Rs("UserGID")=8 then
		Response.write "<font color='#0000FF'>县</font>分销点"
	else
		response.write rs("UserGName")
	end if
%></td>
    <td><%=rs("UserUnit")%></td>
    <td><a href="mailto:<%=Rs("UserEmail")%>"><%=rs("UserName")%></a></td>
    <td><%=rs("UserTrueName")%></td>
    <td><%=rs("UserTEL")%></td>
    <td><%
	if Rs("UserIsCheck")=0 then
		Response.write "<font color=""#FF0000"">未审核</font>"
	else
		Response.write "已审核"
	end if
	%></td>
    <td>
	<%
	'UserID=trim(Session("UserID")) then
	
'	if Rs("UserGID")<>8 then
'		Response.write " | <a href=""Admin_ProvUser.asp?Action=ModifyPwd&id="&Rs("UserID")&""">修改权限</a>"
'	End if

	if Rs("UserPower")="A" then
		if GetUserPower="A" then
			Response.Write "<a href=""ShowUser.asp?id="&Rs("UserID")&""">查看</a>"
			Response.Write " | <a href=""Admin_ProvUser.asp?Action=CheckList&CityID="&CityID&"&id="&Rs("UserID")&""">"
			if Rs("UserIsCheck")=0 then 
				Response.write "审核"
			else
				Response.write "取消"
			end if
			Response.Write "</a>"
			if trim(Rs("UserID"))<>trim(Session("UserID")) then
				Response.write " | <a href=""Admin_ProvUser.asp?Action=Del&CityID="&CityID&"&id="&Rs("UserID")&"""  onClick=""return confirm('确定要删除吗?此项操作将无法恢复!');"">删除</A>"
			end if
		else
			response.Write("<font color='#FF0000'>无权查看</font>")
		end if
		
	else
		if GetUserPower="A" or GetUserPower="B" then
			Response.Write "<a href=""ShowUser.asp?id="&Rs("UserID")&""">查看</a>"
			Response.Write " | <a href=""Admin_ProvUser.asp?Action=CheckList&CityID="&CityID&"&id="&Rs("UserID")&""">"
			if Rs("UserIsCheck")=0 then 
				Response.write "审核"
			else
				Response.write "取消"
			end if
			Response.Write "</a>"
			if trim(Rs("UserID"))<>trim(Session("UserID")) then
				Response.write " | <a href=""Admin_ProvUser.asp?Action=Del&CityID="&CityID&"&id="&Rs("UserID")&"""  onClick=""return confirm('确定要删除吗?此项操作将无法恢复!');"">删除</A>"
			end if
		else
			response.Write("<font color='#0000FF'>无权查看</font>")
		end if
			
	end if

	%>
	
	</td>
    </tr>
  <%
		Rs.MoveNext
	Loop
  %>
</table>  
     </td>
  </form></tr></table>
<%
	Call Rs_End(Rs)
end sub

sub AddAdmin()
%>
<Script>
function showadv(){
if (document.myform.UserGID.value == 5) {
	CityArea.style.display = "none";
	CountyArea.style.display = "none";
	LevArea.style.display = "";
}
if (document.myform.UserGID.value == 6) {
	CityArea.style.display = "";
	CountyArea.style.display = "none";
	LevArea.style.display = "none";	
}
if (document.myform.UserGID.value == 7) {
	CityArea.style.display = "none";
	CountyArea.style.display = "";
	LevArea.style.display = "none";	
}
}
</Script>
<form method="post" action="Admin_ProvUser.asp" name="myform" onsubmit="javascript:return CheckAdd();">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="title"> 
      <td height="22" colspan="2"> <div align="center"><strong>新 增 用 户</strong></div></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg"><strong> 用 户 名:</strong></td>
      <td width="65%" class="tdbg"><input name="UserName" type="text"></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg"><strong> 初始密码: </strong></td>
      <td width="65%" class="tdbg"><input name="Password" type="password" id="Password"></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg"><strong> 确认密码:</strong></td>
      <td width="65%" class="tdbg"><input name="PwdConfirm" type="password" id="PwdConfirm"></td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg"><strong>真实姓名:</strong></td>
      <td class="tdbg"><input name="UserTrueName" type="text" id="UserTrueName"></td>
    </tr>
    <tr class="tdbg">
      <td class="tdbg"><strong>组:</strong></td>
      <td class="tdbg"><select name="UserGID" id="UserGID" onChange="showadv()">
        <%'Call Opt_N("T_UserGroup","UserGID","UserGName",GetUserGID)%>
		<%
		if GetUserPower="A" then
			Call Opt_M("T_UserGroup","UserGID","UserGName",GetUserGID,"UserGID<>8",0)
		else
			Call Opt_M("T_UserGroup","UserGID","UserGName",GetUserGID,"UserGID<>8 and UserGID<>5",0)
		end if
		%>
      </select></td>
    </tr>
    <tr class="tdbg" id=CityArea
	<%
	if GetUserGPower=9999 then
		Response.write  "style=""DISPLAY : none"""
	else
		Response.write "style=""DISPLAY : none"""
	end if
	%>>
      <td class="tdbg"><strong>市:</strong></td>
      <td class="tdbg"><select name="CCityID" id="CCityID">
        <%Call Opt_N("City","CityID","CityName","",0)%>
      </select></td>
	</tr>	
    <tr class="tdbg" id=CountyArea
	<%
	if GetUserGPower=9999 then
		Response.write "style=""DISPLAY : none"""
	end if
	%>>
      <td class="tdbg"><strong>县:</strong></td>
      <td class="tdbg">
<!--联动下拉框开始-->
<%
Dim Rst,Sqlt,Rstt,sqltt
Dim kCount
Sqlt = "select * from County order by CountyID asc"
Call sql_open(Rst,Sqlt,Conn,1,1)
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%

⌨️ 快捷键说明

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