?? system.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" -->
<!--登錄權(quán)限判斷,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
Function sql_AddNew(strSQL,objConn,intI,intJ,strFields,strValues,strTypes,strUrl)
On Error Resume Next
Dim rs,arrFields,arrValues,arrTypes,i
If strFields <> "" Then arrFields = Split(strFields,",,")
If strValues <> "" Then arrValues = Split(strValues,",,")
If strTypes <> "" Then arrTypes = Split(strTypes,",,")
If UBound(arrFields) <> UBound(arrValues) Then
Exit Function
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQL,objConn,intI,intJ
rs.AddNew
For i = 0 To UBound(arrFields)
rs(arrFields(i)) = arrValues(i)
Next
rs.Update
rs.Close
Set rs = Nothing
End Function
Dim strCounter,strToPrint,strForm,strList
Dim action,subAction
action = Trim(Request.QueryString("action"))
subAction = Trim(Request.QueryString("subAction"))
If action = "" Then Response.Redirect("?action=Level")
Select Case action
Case "Level"
Select Case subAction
'Case "new"
Case "save"
Call saveLevel()
Case "edit"
Call editLevel()
Case "restore"
Call restoreLevel()
Case "delete"
Call deleteLevel()
Case "list"
Call listLevel()
Case Else
listLevel()
End Select
Case "Group"
Select Case subAction
'Case "new"
Case "save"
Call saveGroup()
Case "edit"
Call editGroup()
Case "restore"
Call restoreGroup()
Case "delete"
Call deleteGroup()
Case "list"
Call listGroup()
Case Else
Call listGroup()
End Select
Case "ClientsType"
Select Case subAction
'Case "new"
Case "save"
Call saveClientsType()
Case "edit"
Call editClientsType()
Case "restore"
Call restoreClientsType()
Case "delete"
Call deleteClientsType()
Case "list"
Call listClientsType()
Case Else
Call listClientsType()
End Select
Case "RecordsType"
Select Case subAction
'Case "new"
Case "save"
Call saveRecordsType()
Case "edit"
Call editRecordsType()
Case "restore"
Call restoreRecordsType()
Case "delete"
Call deleteRecordsType()
Case "list"
Call listRecordsType()
Case Else
Call listRecordsType()
End Select
Case Else
Response.Redirect("?action=Level&subAction=list")
End Select
Sub saveLevel()
Dim lId,lName
lId = CInt(Abs(Request.Form("lId")))
lName = Trim(Request.Form("lName"))
If lId = "" Or lName = "" Then Response.Write("<script>history.back();</script>")
Dim rs,flag
flag = 0
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_level",conn,3,2
Do While Not rs.BOF And Not rs.EOF
If rs("lId") = lId Or rs("lName") = gName Then
flag = 1
Exit Do
End If
rs.MoveNext
Loop
If flag = 0 Then
rs.AddNew
rs("lId") = lId
rs("lName") = lName
rs.Update
End If
rs.Close
Set rs = Nothing
If flag = 1 Then
Response.Write("<script>" & VBCrlf)
Response.Write("alert(""編號或者名稱已經(jīng)存在。"")" & VBCrlf)
Response.Write("history.back();" & VBCrlf)
Response.Write("</script>")
Else
Response.Redirect("?action=Level")
End If
End Sub
Sub saveGroup()
Dim gId,gName
gId = CInt(Abs(Request.Form("lId")))
gName = Trim(Request.Form("lName"))
If gId = "" Or gName = "" Then Response.Write("<script>history.back();</script>")
Dim rs,flag
flag = 0
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_group",conn,3,2
Do While Not rs.BOF And Not rs.EOF
If rs("gId") = gId Or rs("gName") =gName Then
flag = 1
Exit Do
End If
rs.MoveNext
Loop
If flag = 0 Then
rs.AddNew
rs("gId") = gId
rs("gName") = gName
rs.Update
End If
rs.Close
Set rs = Nothing
If flag = 1 Then
Response.Write("<script>" & VBCrlf)
Response.Write("alert(""編號或者名稱已經(jīng)存在。"")" & VBCrlf)
Response.Write("history.back();" & VBCrlf)
Response.Write("</script>")
Else
Response.Redirect("?action=Group")
End If
End Sub
Sub saveClientsType()
Dim clientsType
clientsType = Trim(Request.Form("clientsType"))
If clientsType = "" Then Response.Write("<script>history.back();</script>")
Dim rs,flag
flag = 0
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_clientsType",conn,3,2
Do While Not rs.BOF And Not rs.EOF
If rs("clientsType") = clientsType Then
flag = 1
Exit Do
End If
rs.MoveNext
Loop
If flag = 0 Then
rs.AddNew
rs("clientsType") = clientsType
rs.Update
End If
rs.Close
Set rs = Nothing
If flag = 1 Then
Response.Write("<script>" & VBCrlf)
Response.Write("alert(""編號或者名稱已經(jīng)存在。"")" & VBCrlf)
Response.Write("history.back();" & VBCrlf)
Response.Write("</script>")
Else
Response.Redirect("?action=ClientsType")
End If
End Sub
Sub saveRecordsType()
Dim recordsType
recordsType = Trim(Request.Form("recordsType"))
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -