📄 listall.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="Connections/conn.asp" -->
<!--登录权限判断,Session和MD5加密判断-->
<%
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")
Function getGroupName(gId)
If gId = "" Then
getGroupName = ""
Else
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_group Where gId = " & gId,conn,3,1
If rs.RecordCount <> 1 Then
getGroupName = ""
Else
getGroupName = rs("gName")
End If
rs.Close
Set rs = Nothing
End If
End Function
Function getUserList(intLevel,intGroup)
Dim rs,strUserList
strUserList = "'" & Session("CRM_name") & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_user Where uLevel < " & intLevel & " And uGroup = " & intGroup,conn,3,1
Do While Not rs.BOF And Not rs.EOF
If strUserList = "" Then
strUserList = "'" & rs("uName") & "'"
Else
strUserList = strUserList & ",'" & rs("uName") & "'"
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
getUserList = strUserList
End Function
Dim strNormal,strAdmin,strCounter,strToPrint
'strNormal = strNormal & " <tr>" & VBCrlf
'strNormal = strNormal & " <td width=""60"" align=""center"" bgcolor=""menu"">编号</td>" & VBCrlf
'strNormal = strNormal & " <td align=""center"" bgcolor=""menu"">公司名称</td>" & VBCrlf
'strNormal = strNormal & " <td align=""center"" bgcolor=""menu"">公司网址</td>" & VBCrlf
'strNormal = strNormal & " <td width=""80"" align=""center"" bgcolor=""menu"">地区</td>" & VBCrlf
'strNormal = strNormal & " </tr>" & VBCrlf
'strAdmin = strAdmin & " <tr>" & VBCrlf
'strAdmin = strAdmin & " <td width=""60"" align=""center"" bgcolor=""menu"">编号</td>" & VBCrlf
'strAdmin = strAdmin & " <td align=""center"" bgcolor=""menu"">公司名称</td>" & VBCrlf
'strAdmin = strAdmin & " <td align=""center"" bgcolor=""menu"">公司网址</td>" & VBCrlf
'strAdmin = strAdmin & " <td width=""80"" align=""center"" bgcolor=""menu"">地区</td>" & VBCrlf
'strAdmin = strAdmin & " <td width=""80"" align=""center"" bgcolor=""menu"">业务员</td>" & VBCrlf
'strAdmin = strAdmin & " </tr>" & VBCrlf
strToPrint = strToPrint & " <tr>" & VBCrlf
strToPrint = strToPrint & " <td width=""60"" align=""center"" bgcolor=""menu"">编号</td>" & VBCrlf
strToPrint = strToPrint & " <td align=""center"" bgcolor=""menu"">公司名称</td>" & VBCrlf
strToPrint = strToPrint & " <td align=""center"" bgcolor=""menu"">公司地址</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""80"" align=""center"" bgcolor=""menu"">业务种类</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""80"" align=""center"" bgcolor=""menu"">联系电话</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""80"" align=""center"" bgcolor=""menu"">公司联系人</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""60"" align=""center"" bgcolor=""menu"">业务员</td>" & VBCrlf
strToPrint = strToPrint & " </tr>" & VBCrlf
''strCounter = ""
'If Session("CRM_level") = 9 Then
' strToPrint = strAdmin
'Else
' strToPrint = strNormal
'End If
Dim action
Dim arrList
action = Trim(Request("action"))
If action <> "" Then
Session("CRM_action") = action
Else
action = Session("CRM_action")
End If
Select Case action
Case "com"
If Trim(Request("searchCom")) <> "" Then
Session("CRM_keyWords") = Trim(Request("searchCom"))
End If
If Session("CRM_keyWords") = "" Then
arrList = listAll
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
Else
arrList = searchCom
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
End If
Case "url"
If Trim(Request("searchUrl")) <> "" Then
Session("CRM_keyWords") = Trim(Request("searchUrl"))
End If
If Session("CRM_keyWords") = "" Then
arrList = listAll
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
Else
arrList = searchUrl
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
End If
case "level"
arrList = level
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
case "checked"
arrList = checked
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
case "question"
arrList = question
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
Case "killSession"
arrList = listAll
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
case "check"
arrList = cStatus
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
Case Else
arrList = listAll
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
End Select
Function searchCom()
Dim rs,strOut(2),strUserList
Dim intTotalRecords,intTotalPages,intCurrentPage,intPageSize
intCurrentPage = CInt(ABS(Request("pageNum")))
If Not IsNumeric(intCurrentPage) Or intCurrentPage <= 0 Then intCurrentPage = 1
intPageSize = 50
Set rs = Server.CreateObject("ADODB.Recordset")
If Session("CRM_level") = 9 Then
rs.Open "Select * From baidu_client Where cCompany Like '%" & Session("CRM_keyWords") & "%' or cLinkman like '%" & Session("CRM_keyWords") & "%' or cInfo like '%" & Session("CRM_keyWords") & "%' Order By cSpaceEnd Desc",conn,3,1
Else
strUserList = getUserList(Session("CRM_level"),Session("CRM_group"))
rs.Open "Select * From baidu_client Where cCompany Like '%" & Session("CRM_keyWords") & "%' or cLinkman like '%" & Session("CRM_keyWords") & "%' or cInfo like '%" & Session("CRM_keyWords") & "%' And cUser In (" & strUserList & ") Order By cSpaceEnd Desc",conn,3,1
'If Session("CRM_level") = 2 Then
' rs.Open "Select * From baidu_client Where cCompany Like '%" & Session("CRM_keyWords") & "%' And cLocal = '" & getGroupName(Session("CRM_group")) & "' Order By cSpaceEnd Desc",conn,3,1
'Else
' rs.Open "Select * From baidu_client Where cCompany Like '%" & Session("CRM_keyWords") & "%' And cUser = '" & Session("CRM_name") & "' Order By cSpaceEnd Desc",conn,3,1
'End If
End If
intTotalRecords = rs.RecordCount
rs.PageSize = intPageSize
intTotalPages = rs.PageCount
If intCurrentPage > intTotalPages Then intCurrentPage = intTotalPages
If intTotalRecords > 0 Then rs.AbsolutePage = intCurrentPage
strOut(0) = strOut(0) & "共 " & intTotalRecords & " 条记录 "
strOut(0) = strOut(0) & "共 " & intTotalPages & " 页 "
strOut(0) = strOut(0) & "当前第 " & intCurrentPage & " 页 "
If intCurrentPage <> 1 And intTotalRecords <> 0 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=1""><<首页</a> "
Else
strOut(0) = strOut(0) & "<<首页 "
End If
If intCurrentPage > 1 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage - 1 & """><上一页</a> "
Else
strOut(0) = strOut(0) & "<上一页 "
End If
If intCurrentPage < intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage + 1 & """>下一页></a> "
Else
strOut(0) = strOut(0) & "下一页> "
End If
If intCurrentPage <> intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intTotalPages & """>尾页>></a>"
Else
strOut(0) = strOut(0) & "尾页>>"
End If
Dim k
k = 0
Do While Not rs.BOF And Not rs.EOF
k = k + 1
strOut(1) = strOut(1) & " <tr>" & VBCrlf
if rs("cStatus")=false then
strOut(1) = strOut(1) & " <td align=""right"">" & rs("cId") & "</td>" & VBCrlf
else
strOut(1) = strOut(1) & " <td align=""right"">" & "<img src=images/usd.gif> "&rs("cId") & "</td>" & VBCrlf
end if
if rs("level")=true then
strOut(1) = strOut(1) & " <td><a href=""view.asp?cId=" & rs("cId") & """>"&"<font color=red>" & rs("cCompany") & "</font>"&"</a></td>" & VBCrlf
else
strOut(1) = strOut(1) & " <td><a href=""view.asp?cId=" & rs("cId") & """>" & rs("cCompany") & "</a></td>" & VBCrlf
end if
strOut(1) = strOut(1) & " <td>" & rs("cAddress") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cType") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cTel") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cLinkman") & "</td>" & VBCrlf
'If Session("CRM_level") = 9 Then
strOut(1) = strOut(1) & " <td>" & rs("cUser") & "</td>" & VBCrlf
'End If
strOut(1) = strOut(1) & " </tr>" & VBCrlf
If k >= intPageSize Then Exit Do
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
searchCom = strOut
End Function
Function searchUrl()
Dim rs,strOut(2),strUserList
Dim intTotalRecords,intTotalPages,intCurrentPage,intPageSize
intCurrentPage = CInt(ABS(Request("pageNum")))
If Not IsNumeric(intCurrentPage) Or intCurrentPage <= 0 Then intCurrentPage = 1
intPageSize = 50
Set rs = Server.CreateObject("ADODB.Recordset")
If Session("CRM_level") = 9 Then
rs.Open "Select * From baidu_client Where cTel Like '%" & Session("CRM_keyWords") & "%' or phone Like '%" & Session("CRM_keyWords") & "%' or fax Like '%" & Session("CRM_keyWords") & "%' or qq Like '%" & Session("CRM_keyWords") & "%' or msn Like '%" & Session("CRM_keyWords") & "%' or cEmail Like '%" & Session("CRM_keyWords") & "%' Order By cSpaceEnd Desc",conn,3,1
Else
strUserList = getUserList(Session("CRM_level"),Session("CRM_group"))
rs.Open "Select * From baidu_client Where cTel Like '%" & Session("CRM_keyWords") & "%' or phone Like '%" & Session("CRM_keyWords") & "%' or fax Like '%" & Session("CRM_keyWords") & "%' or qq Like '%" & Session("CRM_keyWords") & "%' or msn Like '%" & Session("CRM_keyWords") & "%' or cEmail Like '%" & Session("CRM_keyWords") & "%' And cUser In (" & strUserList & ") Order By cSpaceEnd Desc",conn,3,1
'If Session("CRM_level") = 2 Then
' rs.Open "Select * From baidu_client Where cHomepage Like '%" & Session("CRM_keyWords") & "%' And cLocal = '" & getGroupName(Session("CRM_group")) & "' Order By cSpaceEnd Desc",conn,3,1
'Else
' rs.Open "Select * From baidu_client Where cHomepage Like '%" & Session("CRM_keyWords") & "%' And cUser = '" & Session("CRM_name") & "' Order By cSpaceEnd Desc",conn,3,1
'End If
End If
intTotalRecords = rs.RecordCount
rs.PageSize = intPageSize
intTotalPages = rs.PageCount
If intCurrentPage > intTotalPages Then intCurrentPage = intTotalPages
If intTotalRecords > 0 Then rs.AbsolutePage = intCurrentPage
strOut(0) = strOut(0) & "共 " & intTotalRecords & " 条记录 "
strOut(0) = strOut(0) & "共 " & intTotalPages & " 页 "
strOut(0) = strOut(0) & "当前第 " & intCurrentPage & " 页 "
If intCurrentPage <> 1 And intTotalRecords <> 0 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=1""><<首页</a> "
Else
strOut(0) = strOut(0) & "<<首页 "
End If
If intCurrentPage > 1 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage - 1 & """><上一页</a> "
Else
strOut(0) = strOut(0) & "<上一页 "
End If
If intCurrentPage < intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage + 1 & """>下一页></a> "
Else
strOut(0) = strOut(0) & "下一页> "
End If
If intCurrentPage <> intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intTotalPages & """>尾页>></a>"
Else
strOut(0) = strOut(0) & "尾页>>"
End If
Dim k
k = 0
Do While Not rs.BOF And Not rs.EOF
k = k + 1
strOut(1) = strOut(1) & " <tr>" & VBCrlf
if rs("cStatus")=false then
strOut(1) = strOut(1) & " <td align=""right"">" & rs("cId") & "</td>" & VBCrlf
else
strOut(1) = strOut(1) & " <td align=""right"">" & "<img src=images/usd.gif> "&rs("cId") & "</td>" & VBCrlf
end if
if rs("level")=true then
strOut(1) = strOut(1) & " <td><a href=""view.asp?cId=" & rs("cId") & """>"&"<font color=red>" & rs("cCompany") & "</font>"&"</a></td>" & VBCrlf
else
strOut(1) = strOut(1) & " <td><a href=""view.asp?cId=" & rs("cId") & """>" & rs("cCompany") & "</a></td>" & VBCrlf
end if
strOut(1) = strOut(1) & " <td>" & rs("cAddress") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cType") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cTel") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cLinkman") & "</td>" & VBCrlf
'If Session("CRM_level") = 9 Then
strOut(1) = strOut(1) & " <td>" & rs("cUser") & "</td>" & VBCrlf
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -