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

📄 empmain_userright.asp

📁 好用的管理,代码程序 好用的管理,代码程序
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/EmpMain.asp" -->
<!--#include file="EmpMain_CheckRight.asp"-->
<%
if fncheckupart(1)=true or fncheckupart(2)=true then
else
response.Write("没有权限访问该页!")
response.end
end if
%>
<%
Dim UR
Dim UR_numRows

Set UR = Server.CreateObject("ADODB.Recordset")
UR.ActiveConnection = MM_EmpMain_STRING
UR.Source = "SELECT F_UserName,F_Id FROM T_User where F_IsPass=true"
UR.CursorType = 0
UR.CursorLocation = 2
UR.LockType = 1
UR.Open()

UR_numRows = 0
%>

<%
if request.QueryString("UserID") <> "" then
Dim URight
Dim URight_numRows

Set URight = Server.CreateObject("ADODB.Recordset")
URight.ActiveConnection = MM_EmpMain_STRING
URight.Source = "SELECT * FROM T_User where F_IsPass=true and F_Id = " & request.QueryString("UserID")
URight.CursorType = 0
URight.CursorLocation = 2
URight.LockType = 1
URight.Open()

URight_numRows = 0
username = URight("F_UserName")
password = URight("F_UserPass")
PayList = URight("F_ClientInformation")
EmpList = URight("F_AddStaff")
HolList = URight("F_TrackRecord")
overview = URight("F_ConsignorRecord")
user_right=URight("F_Authority")
shenf=URight("F_Region")

end if
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
<link rel="stylesheet" href="CSS/SellWellWeb.css" type="text/css">
<script language="javascript" src="js_Lib/fnCheckForm.js"></script>
<script>
function doReload(obj){
   window.location = "Empmain_UserRight.asp?UserID="+obj.options[obj.selectedIndex].value
}

function showopen(obj,w,h){

 var arr = showModalDialog(obj, window, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; help: no; scroll: yes; status: no");  
if ((arr != null))
  {          
          insertHTML(str);
   }

}

   
function fnDoDelete(){
	if(document.form1.UserID.value==""){
		alert("请选择一个用户!")
		return
	}
	if(document.form1.textfield.selectedIndex==1){
	  alert("不能删除管理员帐号!")
	  return
	}
	if(confirm("您确认要删除该用户?")){
		window.location = "Empmain_DeleteUser.asp?UserID=<%=request.QueryString("UserID")%>"
	}
}

function ifdisabled(obj){
var str=this.value;
if (str==1 && str==2 && str==3){
document.form1.shenf.disabled=true;
}

}
</script>
</head>

<body bgcolor="#EAF4FF" topmargin="2" class="body">
 
<form method="POST" action="EmpMain_UserRight_Process.asp" name="form1" id="form1">
<fieldset style="padding: 2" class="fiedset"><legend>用户列表</legend>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber1" align="center">
    
	<tr> 
      <td width="29%" class="Caption">用户名:</td>
      <td width="71%" class="ValueArea">
        <select name="textfield" class="Text" onChange="doReload(this)">
		<option>新增用户</option>
		<%while not UR.EOF%>
		<option <%if request("UserID") <> "" then%><%if Cint(request("UserID")) = Cint(UR("F_Id")) then%>selected<%end if%><%end if%> value="<%=UR("F_ID")%>"><%=UR("F_UserName")%></option>
		 <% 
		 UR.movenext
		wend
		%>
		</select>
        </td>
    </tr>
  </table>
  </fieldset>
  
  <fieldset style="padding: 2" class="fiedset">帐号信息</legend> 
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber1" align="center">
    <tr> 
      <td width="29%" nowrap class="Caption">用户名:</td>
      <td width="71%" class="ValueArea">
        <input name="UserName" type="text" class="Text" id="UserName" Need="1" value="<%=username%>" ></td>
    </tr>
    <tr> 
      <td width="29%" nowrap class="Caption">密码:</td>
      <td width="71%" class="ValueArea">
        <input name="password" type="Password" class="Text" title="不修改,请留空!" id="password" value="" Need="1" >
        </td>
    </tr>
	    <tr> 
      <td width="29%" nowrap class="Caption">权限:</td> 
      <td width="71%" class="ValueArea"> <select name="user_right"   title="请选择权限!" >
	  <option />
        <option value="1" <%if instr(user_right,1) then%> selected <%end if %>>管理员 </option>
        <option  value="2" <%if instr(user_right,2) then%> selected <%end if %>>总经理 </option>
        <option value="3" <%if instr(user_right,3) then%> selected <%end if %>>部门经理 </option>
        <option  value="4" <%if instr(user_right,4) then%> selected <%end if %>>地区主管</option>
        <option  value="5" <%if instr(user_right,5) then%> selected <%end if %>>销售员</option></select>
        </td>
    </tr>
	<tr> 
      <td width="29%" nowrap class="Caption">地区:</td> 
      <td width="71%" class="ValueArea">
        <input name="shenf" type="text" class="Text" id="shenf"   title="请点击选择地区!" value="<%=shenf%>" Need="1"  onClick="showopen('Empmain_dq.asp?id=<%=request("UserID")%>',400,400)">
        </td>
    </tr>
  </table>
  </fieldset> 
  
  <fieldset style="padding: 2" class="fiedset"> <legend>权限信息</legend> 
  <table border="1" cellpadding="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber2" align="center">
    <tr> 
      <td width="50%" align="center" class="listTitle">模块</td>
      <td width="25%" align="center" class="listTitle">只读</td>
      <td width="25%" align="center" class="listTitle">可写</td>
    </tr>
    <tr> 
      <td align="center" class="ListValueGray">客户信息</td>
      <td align="center" class="ListValueGray"> 
        <input name="payList" type="checkbox"  id="payList" value="1" <%if instr(PayList,"1") then%>checked<%end if%>>
        </td>
      <td align="center" class="ListValueGray"> 
        <input name="payList" type="checkbox"  id="payList" value="2" <%if instr(PayList,"2") then%>checked<%end if%>>
        </td>
    </tr>
    <tr> 
      <td align="center" class="ListValueWhite">购买记录</td>
      <td align="center" class="ListValueWhite"> 
        <input name="HolList" type="checkbox" id="HolList" value="1" <%if instr(HolList,"1") then%>checked<%end if%>>
        </td>
      <td align="center" class="ListValueWhite"> 
        <input name="HolList" type="checkbox" id="HolList" value="2" <%if instr(HolList,"2") then%>checked<%end if%>>
        </td>
    </tr>
    <tr> 
      <td width="50%" align="center" class="ListValueGray">员工添加 
      </td>
      <td width="25%" align="center" class="ListValueGray">
          <input name="EmpList" type="checkbox" id="EmpList" value="1" <%if instr(EmpList,"1") then%>checked<%end if%>>
          </td>
      <td width="25%" align="center" class="ListValueGray"> 
          <input name="EmpList"  type="checkbox" id="EmpList" value="2" <%if instr(EmpList,"2") then%>checked<%end if%>>
          </td>
    </tr>
    <tr>
      <td align="center" class="ListValueWhite">跟踪信息</td>
      <td align="center" class="ListValueWhite">
        <input name="overview"  type="checkbox" id="overview" value="1" <%if instr(overview,"1") then%>checked<%end if%>>
        </td>
      <td align="center" class="ListValueWhite">
        <input name="overview"  type="checkbox" id="overview" value="2" <%if instr(overview,"2") then%>checked<%end if%>>
        </td>
    </tr>
  </table>
  </fieldset>
  <p>
    <input type="hidden" name="UserID" value="<%=trim(request("UserID"))%>">
    <input type="button" value="提交" name="B1" class="button" onClick="fnCheckForm()">
    
	<input type="button" value="删除" name="B2" class="button" onClick="fnDoDelete()">
  </p>
</form>
</body>
</html>
<%
UR.Close()
Set UR = Nothing
%>

⌨️ 快捷键说明

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