?? listall.asp
字號(hào):
<%@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" -->
<!--登錄權(quán)限判斷,Session和MD5加密判斷-->
<%
Rem Session("CRM_account") 用戶帳號(hào)
Rem Session("CRM_name") 用戶名
Rem Session("CRM_level") 用戶等級(jí)
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"">編號(hào)</td>" & VBCrlf
'strNormal = strNormal & " <td align=""center"" bgcolor=""menu"">公司名稱</td>" & VBCrlf
'strNormal = strNormal & " <td align=""center"" bgcolor=""menu"">公司網(wǎng)址</td>" & VBCrlf
'strNormal = strNormal & " <td width=""80"" align=""center"" bgcolor=""menu"">地區(qū)</td>" & VBCrlf
'strNormal = strNormal & " </tr>" & VBCrlf
'strAdmin = strAdmin & " <tr>" & VBCrlf
'strAdmin = strAdmin & " <td width=""60"" align=""center"" bgcolor=""menu"">編號(hào)</td>" & VBCrlf
'strAdmin = strAdmin & " <td align=""center"" bgcolor=""menu"">公司名稱</td>" & VBCrlf
'strAdmin = strAdmin & " <td align=""center"" bgcolor=""menu"">公司網(wǎng)址</td>" & VBCrlf
'strAdmin = strAdmin & " <td width=""80"" align=""center"" bgcolor=""menu"">地區(qū)</td>" & VBCrlf
'strAdmin = strAdmin & " <td width=""80"" align=""center"" bgcolor=""menu"">業(yè)務(wù)員</td>" & VBCrlf
'strAdmin = strAdmin & " </tr>" & VBCrlf
strToPrint = strToPrint & " <tr>" & VBCrlf
strToPrint = strToPrint & " <td width=""60"" align=""center"" bgcolor=""menu"">編號(hào)</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"">業(yè)務(wù)種類</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""80"" align=""center"" bgcolor=""menu"">聯(lián)系電話</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""80"" align=""center"" bgcolor=""menu"">公司聯(lián)系人</td>" & VBCrlf
strToPrint = strToPrint & " <td width=""60"" align=""center"" bgcolor=""menu"">業(yè)務(wù)員</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 & " 頁(yè) "
strOut(0) = strOut(0) & "當(dāng)前第 " & intCurrentPage & " 頁(yè) "
If intCurrentPage <> 1 And intTotalRecords <> 0 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=1""><<首頁(yè)</a> "
Else
strOut(0) = strOut(0) & "<<首頁(yè) "
End If
If intCurrentPage > 1 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage - 1 & """><上一頁(yè)</a> "
Else
strOut(0) = strOut(0) & "<上一頁(yè) "
End If
If intCurrentPage < intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage + 1 & """>下一頁(yè)></a> "
Else
strOut(0) = strOut(0) & "下一頁(yè)> "
End If
If intCurrentPage <> intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intTotalPages & """>尾頁(yè)>></a>"
Else
strOut(0) = strOut(0) & "尾頁(yè)>>"
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 & " 頁(yè) "
strOut(0) = strOut(0) & "當(dāng)前第 " & intCurrentPage & " 頁(yè) "
If intCurrentPage <> 1 And intTotalRecords <> 0 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=1""><<首頁(yè)</a> "
Else
strOut(0) = strOut(0) & "<<首頁(yè) "
End If
If intCurrentPage > 1 Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage - 1 & """><上一頁(yè)</a> "
Else
strOut(0) = strOut(0) & "<上一頁(yè) "
End If
If intCurrentPage < intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intCurrentPage + 1 & """>下一頁(yè)></a> "
Else
strOut(0) = strOut(0) & "下一頁(yè)> "
End If
If intCurrentPage <> intTotalPages Then
strOut(0) = strOut(0) & "<a href=""?pageNum=" & intTotalPages & """>尾頁(yè)>></a>"
Else
strOut(0) = strOut(0) & "尾頁(yè)>>"
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
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -