📄 manageuser.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option Explicit
Response.Buffer = True
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<!--#include file="md5.asp"-->
<!--#include file="Connections/conn.asp" -->
<!--登录权限判断,Session和MD5加密判断-->
<%
''生成下拉列表
Function getList(i,sTable,iId,sValue,sName,selfValue)
If i < 1 Or i > 2 Then
getList = ""
Exit Function
End If
Dim strList
Dim rs
If i = 1 Then
strList = "<select name=""" & sName & """ selfValue=""" & selfValue & """>"
strList = strList & "<option value="""">请选择</option>"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From " & sTable & "",conn,3,1
Do While Not rs.BOF And Not rs.EOF
strList = strList & "<option value=""" & rs(sValue) & """>" & rs(sValue) & "</option>"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
strList = strList & "</select>"
getList = strList
Else
strList = "<select name=""" & sName & """ selfValue=""" & selfValue & """>"
strList = strList & "<option value="""">请选择</option>"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From " & sTable & "",conn,3,1
Do While Not rs.BOF And Not rs.EOF
strList = strList & "<option value=""" & rs(iId) & """>" & rs(sValue) & "</option>"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
strList = strList & "</select>"
getList = strList
End If
End Function
Rem Session("CRM_account") 用户帐号
Rem Session("CRM_name") 用户名
Rem Session("CRM_level") 用户等级
If Session("CRM_account") = "" Or Session("CRM_name") = "" Or Session("CRM_level") <= 0 Then Response.Redirect("login.asp")
If Session("CRM_level") <> 9 Then Response.Redirect("listAll.asp")
Function getGroupName(gId)
If Not IsNumeric(gId) Or gId < 0 Then
getGroupName = ""
Else
Dim rs,gName
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_group Where gId = " & gId,conn,3,1
If rs.RecordCount <> 1 Then
gName = ""
Else
gName = rs("gName")
End If
rs.Close
Set rs = Nothing
getGroupName = gName
End If
End Function
Function getLevelName(lId)
If Not IsNumeric(lId) Or lId <= 0 Then
getLevelName = ""
Else
Dim rs,lName
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_level Where lId = " & lId,conn,3,1
If rs.RecordCount <> 1 Then
lName = ""
Else
lName = rs("lName")
End If
rs.Close
Set rs = Nothing
getLevelName = lName
End If
End Function
Dim strCounter,strToPrint
Dim rs,intTotalRecords,intTotalPages,intCurrentPage,intPageSize
intCurrentPage = CInt(ABS(Request("pageNum")))
If Not IsNumeric(intCurrentPage) Or intCurrentPage <= 0 Then intCurrentPage = 1
intPageSize = 10
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_user Order By uId",conn,3,1
intTotalRecords = rs.RecordCount
rs.PageSize = intPageSize
intTotalPages = rs.PageCount
If intCurrentPage > intTotalPages Then intCurrentPage = intTotalPages
If intTotalRecords > 0 Then rs.AbsolutePage = intCurrentPage
strCounter = strCounter & "共 " & intTotalRecords & " 条记录 "
strCounter = strCounter & "共 " & intTotalPages & " 页 "
strCounter = strCounter & "当前第 " & intCurrentPage & " 页 "
If intCurrentPage <> 1 And intTotalRecords <> 0 Then
strCounter = strCounter & "<a href=""?pageNum=1""><<首页</a> "
Else
strCounter = strCounter & "<<首页 "
End If
If intCurrentPage > 1 Then
strCounter = strCounter & "<a href=""?pageNum=" & intCurrentPage - 1 & """><上一页</a> "
Else
strCounter = strCounter & "<上一页 "
End If
If intCurrentPage < intTotalPages Then
strCounter = strCounter & "<a href=""?pageNum=" & intCurrentPage + 1 & """>下一页></a> "
Else
strCounter = strCounter & "下一页> "
End If
If intCurrentPage <> intTotalPages Then
strCounter = strCounter & "<a href=""?pageNum=" & intTotalPages & """>尾页>></a>"
Else
strCounter = strCounter & "尾页>>"
End If
Dim i
i = 0
Do While Not rs.BOF And Not rs.EOF
i = i + 1
strToPrint = strToPrint & " <tr>" & VBCrlf
strToPrint = strToPrint & " <td align=""center"">" & rs("uId") & "</td>" & VBCrlf
If rs("uBlock") = False Then
strToPrint = strToPrint & " <td>" & rs("uAccount") & "</td>" & VBCrlf
Else
strToPrint = strToPrint & " <td><font color=""#FF0000"">" & rs("uAccount") & "</font></td>" & VBCrlf
End If
strToPrint = strToPrint & " <td>" & rs("uPassword") & "</td>" & VBCrlf
strToPrint = strToPrint & " <td>" & rs("uName") & "</td>" & VBCrlf
strToPrint = strToPrint & " <td>" & getGroupName(rs("uGroup")) & "</td>" & VBCrlf
strToPrint = strToPrint & " <td>" & getLevelName(rs("uLevel")) & "</td>" & VBCrlf
If rs("uBlock") = False Then
strToPrint = strToPrint & " <td align=""center"">[<a href=""?action=edit&uId=" & rs("uId") & """>修改</a>] [<a href=""?action=block&uId=" & rs("uId") & """>冻结</a>] [<a href=""?action=delete&uId=" & rs("uId") & """ onClick=""return confirm('确定删除该用户和相\r关的所有资料?');"">删除</a>]</td>" & VBCrlf
Else
strToPrint = strToPrint & " <td align=""center"">[<a href=""?action=edit&uId=" & rs("uId") & """>修改</a>] [<a href=""?action=block&uId=" & rs("uId") & """>解冻</a>] [<a href=""?action=delete&uId=" & rs("uId") & """ onClick=""return confirm('确定删除该用户和相\r关的所有资料?');"">删除</a>]</td>" & VBCrlf
End If
strToPrint = strToPrint & " </tr>" & VBCrlf
If i >= intPageSize Then Exit Do
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>客户资料收集系统</title>
<link href="myStyle.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function showHideHead(strSrc)
{
var strFile = strSrc.substring(strSrc.lastIndexOf("/"),strSrc.length);
if (strFile == "/arrow_up.gif"){
oHead.style.display = "none";
oHeadCtrl.src = "images/arrow_down.gif";
oHeadCtrl.alt = "显示头部";
oHeadBar.title = "显示头部";
}
else {
oHead.style.display = "block";
oHeadCtrl.src = "images/arrow_up.gif";
oHeadCtrl.alt = "隐藏头部";
oHeadBar.title = "隐藏头部";
}
}
function checkInput(o)
{
var oo = eval("document.all." + o);
var num = oo.length;
for(var i=0;i<num;i++){
if(oo[i].value == ""){
alert(oo[i].selfValue + "不能为空。");
oo[i].focus();
return false
break;
}
}
}
if (this.location.href == top.location.href){
top.location.href = "";
}
-->
</script>
</head>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style>
</head>
<body style="background-color: menu;" >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr id="oHead" style="display: block;">
<td height="1" valign="top">
<table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"><img src="images/null.gif" width="1" height="1"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="menu">
<tr>
<td align="left" background='images/tab_top_background_runner.gif'> <table width="5" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/null.gif" width="1" height="1"></td>
</tr>
</table>
<table onClick="window.location.replace('listAll.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr >
<td><img src="images/tab_on_left.gif" width="16" height="24"></td>
<td background="images/tab_on_middle.gif"><span class="STYLE1">查看所有数据</span></td>
<td><img src="images/tab_on_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('addData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif"><span class="STYLE1">添加数据</span></td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('advanceSearch.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif"><span class="STYLE1">高级搜索</span></td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('dataForm.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif"><span class="STYLE1">数据报表</span></td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('exportData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif"><span class="STYLE1">数据导出</span></td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('question.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif"><span class="STYLE1">问题集</span></td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('plan.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">计划与总结</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<% If Session("CRM_level") = 9 Then %>
<table onClick="window.location.replace('transData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif"><span class="STYLE1">数据转移</span></td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onClick="window.location.replace('manageUser.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -