?? listallaaa.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
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
''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 "killSession"
Session("CRM_keyWords") = ""
Session("CRM_action") = ""
Response.Redirect("listAll.asp")
Case Else
arrList = listAll
strToPrint = strToPrint & arrList(1)
strCounter = arrList(0)
End Select
Function searchCom()
Dim rs,strOut(2)
Dim 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")
If Session("CRM_level") = 9 Then
rs.Open "Select * From baidu_client Where cCompany Like '%" & Session("CRM_keyWords") & "%' Order By cId Desc",conn,3,1
Else
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 cId Desc",conn,3,1
Else
rs.Open "Select * From baidu_client Where cCompany Like '%" & Session("CRM_keyWords") & "%' And cUser = '" & Session("CRM_name") & "' Order By cId 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) & "當(dāng)前第 " & 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>"
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
strOut(1) = strOut(1) & " <td align=""center"">" & rs("cId") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td><a href=""view.asp?cId=" & rs("cId") & """>" & rs("cCompany") & "</a></td>" & VBCrlf
strOut(1) = strOut(1) & " <td><a href=""http://" & rs("cHomepage") & """ target=""_blank"">" & rs("cHomepage") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cArea") & "</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)
Dim 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")
If Session("CRM_level") = 9 Then
rs.Open "Select * From baidu_client Where cHomepage Like '%" & Session("CRM_keyWords") & "%' Order By cId Desc",conn,3,1
Else
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 cId Desc",conn,3,1
Else
rs.Open "Select * From baidu_client Where cHomepage Like '%" & Session("CRM_keyWords") & "%' And cUser = '" & Session("CRM_name") & "' Order By cId 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) & "當(dāng)前第 " & 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
strOut(1) = strOut(1) & " <td align=""center"">" & rs("cId") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td><a href=""view.asp?cId=" & rs("cId") & """>" & rs("cCompany") & "</a></td>" & VBCrlf
strOut(1) = strOut(1) & " <td><a href=""http://" & rs("cHomepage") & """ target=""_blank"">" & rs("cHomepage") & "</td>" & VBCrlf
strOut(1) = strOut(1) & " <td>" & rs("cArea") & "</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
strOut(0) = "共 條記錄 共 頁 當(dāng)前第 頁 <<首頁 <上一頁 下一頁> 尾頁>>"
searchUrl = strOut
End Function
Function listAll()
Dim rs,strOut(2)
Dim 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")
If Session("CRM_level") = 9 Then
rs.Open "Select * From baidu_client Order By cId Desc",conn,3,1
Else
If Session("CRM_level") = 2 Then
rs.Open "Select * From baidu_client Where cLocal = '" & getGroupName(Session("CRM_group")) & "' Order By cId Desc",conn,3,1
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -