📄 function.asp
字号:
inputS = mid(inputStr,i_C,1)
For i_B = 1 to BadLen
inBadS = mid(BadStr,i_B,1)
viBadS = mid(viewBadStr,i_B,1)
Select Case mode
Case "0"
if inputS = inBadS then inputS = viBadS else inputS = inputS end if
Case "1"
if inputS = inBadS then inputS = viewBadStr
End Select
Next
inputStrA = inputStrA & inputS
Next
Check = inputStrA
End Function
Public Function usertype(SQL,Rusertypeid,boxWidth,boxName,uTypeALL)
if boxWidth = "" then boxWidth = 100
Set uRst = Server.CreateObject("Adodb.RecordSet")
uRst.Open(SQL),Conn,1,1
if not uRst.eof then
dim utypeWrite
utypeWrite = "<select name = '" & boxName & "' style = 'width:" & boxWidth & "'>"
for i_ut = 1 to uRst.RecordCount
if uRst.eof then Exit for
utypeid = uRst("utypeid")
uTypeName = uRst("uTypeName")
uopt = uopt & "<option value = '" & utypeid & "' " & v1v2(utypeid,Rusertypeid," style = 'color:red;' selected = 'selected' ","") & ">" & uTypeName & "</option>"
uRst.movenext
next
else
end if
uRst.Close
Set uRst = Nothing
if utypeALL = "view" then utALL = "<option value = '0' " & v1v2(0,Rtypeid," style = 'color:red;' selected = 'selected' ","") & ">全部类别</option>" else tALL = ""
usertype = utypeWrite & uopt & utALL & "</select>"
End Function
Public Function admintype(SQL,RAtypeid,boxWidth,boxName,ATypeALL)
if boxWidth = "" then boxWidth = 100
Set aRst = Server.CreateObject("Adodb.RecordSet")
aRst.Open(SQL),Conn,1,1
if not aRst.eof then
dim atypeWrite
atypeWrite = "<select name = '" & boxName & "' style = 'width:" & boxWidth & "'>"
for i_at = 1 to aRst.RecordCount
if aRst.eof then Exit for
Atypeid = aRst("Atypeid")
ATypeName = aRst("ATypeName")
aopt = aopt & "<option value = '" & Atypeid & "' " & v1v2(Atypeid,RAtypeid," style = 'color:red;' selected = 'selected' ","") & ">" & ATypeName & "</option>"
aRst.movenext
next
else
end if
aRst.Close
Set aRst = Nothing
if AtypeALL = "view" then AtALL = "<option value = '0' " & v1v2(0,RAtypeid," style = 'color:red;' selected = 'selected' ","") & ">全部类别</option>" else tALL = ""
admintype = atypeWrite & aopt & atALL & "</select>"
End Function
Public Function mtype(SQL,Rmtypeid,boxWidth,boxName,ATypeALL)
if boxWidth = "" then boxWidth = 100
Set mRst = Server.CreateObject("Adodb.RecordSet")
mRst.Open(SQL),Conn,1,1
if not mRst.eof then
dim mtypeWrite
mtypeWrite = "<select name = '" & boxName & "' style = 'width:" & boxWidth & "'>"
for i_mt = 1 to mRst.RecordCount
if mRst.eof then Exit for
mtypeid = mRst("mtypeid")
mTypeName = mRst("mTypeName")
mopt = mopt & "<option value = '" & mtypeid & "' " & v1v2(mtypeid,Rmtypeid," style = 'color:red;' selected = 'selected' ","") & ">" & mTypeName & "</option>"
mRst.movenext
next
else
end if
mRst.Close
Set mRst = Nothing
if mtypeALL = "view" then mtALL = "<option value = '0' " & v1v2(0,Rmtypeid," style = 'color:red;' selected = 'selected' ","") & ">全部类别</option>" else tALL = ""
mtype = mtypeWrite & mopt & mtALL & "</select>"
End Function
Public Function usertypeSub(SQL,Rusertypeid,boxWidth,boxName,uTypeALL)
if boxWidth = "" then boxWidth = 100
Set uRst = Server.CreateObject("Adodb.RecordSet")
Set uRst_ = Server.CreateObject("Adodb.RecordSet")
uRst.Open(SQL),Conn,1,1
if not uRst.eof then
dim utypeSubWrite
Response.Write"<select name = '" & boxName & "' style = 'width:" & boxWidth & "' >"
for i_ut = 1 to uRst.RecordCount
if uRst.eof then Exit for
utypeid = uRst("utypeid")
uTypeName = uRst("uTypeName")
uTypeSelect = uRst("uTypeSelect")
Response.Write"<option value = '' style = 'color:blue;'>" & uTypeName & "</option>"
uRst_.Open("select * from usertype where uTypeSelect = " & utypeid & ""),Conn,1,1
if not uRst_.eof then
for i_ut_ = 1 to uRst_.RecordCount
if uRst_.eof then exit for
utypeid_ = uRst_("utypeid")
uTypeName_ = uRst_("uTypeName")
uTypeSelect_ = uRst_("uTypeSelect")
utypeidSelected = v1v2(utypeid_,Rusertypeid," style = 'color:red;' selected = 'selected' " , "")
Response.Write"<option value = '" & utypeid_ & "' " & utypeidSelected & "> " & uTypeName_ & "</option>"
uRst_.movenext
next
else
end if
uRst_.Close
uRst.movenext
next
else
end if
uRst.Close
Set uRst = Nothing
Set uRst_ = Nothing
if utypeALL = "view" then utALL = "<option value = '0' " & v1v2(0,Rtypeid," style = 'color:red;' selected = 'selected' ","") & ">全部类别</option>" else tALL = ""
Response.Write utALL & "</select>"
End Function
Public Function admintypeSub(SQL,Radmintypeid,boxWidth,boxName,uTypeALL)
if boxWidth = "" then boxWidth = 100
Set aRst = Server.CreateObject("Adodb.RecordSet")
Set aRst_ = Server.CreateObject("Adodb.RecordSet")
aRst.Open(SQL),Conn,1,1
if not aRst.eof then
dim AtypeSubWrite
Response.Write"<select name = '" & boxName & "' style = 'width:" & boxWidth & "' >"
for i_at = 1 to aRst.RecordCount
if aRst.eof then Exit for
Atypeid = aRst("Atypeid")
ATypeName = aRst("ATypeName")
ATypeSelect = aRst("ATypeSelect")
Response.Write"<option value = '' style = 'color:blue;'>" & ATypeName & "</option>"
aRst_.Open("select * from admintype where ATypeSelect = " & Atypeid & ""),Conn,1,1
if not aRst_.eof then
for i_at_ = 1 to aRst_.RecordCount
if aRst_.eof then exit for
Atypeid_ = aRst_("Atypeid")
ATypeName_ = aRst_("ATypeName")
ATypeSelect_ = aRst_("ATypeSelect")
AtypeidSelected = v1v2(Atypeid_,Radmintypeid," style = 'color:red;' selected = 'selected' " , "")
Response.Write"<option value = '" & Atypeid_ & "' " & AtypeidSelected & "> " & ATypeName_ & "</option>"
aRst_.movenext
next
else
end if
aRst_.Close
aRst.movenext
next
else
end if
aRst.Close
Set aRst = Nothing
Set aRst_ =Nothing
if AtypeALL = "view" then AtALL = "<option value = '0' " & v1v2(0,Radmintypeid," style = 'color:red;' selected = 'selected' ","") & ">全部类别</option>" else AALL = ""
Response.Write AtALL & "</select>"
End Function
Public Function mtypeSub(SQL,Rmtypeid,boxWidth,boxName,mTypeALL)
if boxWidth = "" then boxWidth = 100
Set mRst = Server.CreateObject("Adodb.RecordSet")
Set mRst_ = Server.CreateObject("Adodb.RecordSet")
mRst.Open(SQL),Conn,1,1
if not mRst.eof then
dim mtypeSubWrite
Response.Write"<select name = '" & boxName & "' style = 'width:" & boxWidth & "' >"
for i_mt = 1 to mRst.RecordCount
if mRst.eof then Exit for
mtypeid = mRst("mtypeid")
mTypeName = mRst("mTypeName")
mTypeSelect = mRst("mTypeSelect")
Response.Write"<option value = '' style = 'color:blue;'>" & mTypeName & "</option>"
mRst_.Open("select * from mtype where mTypeSelect = " & mtypeid & ""),Conn,1,1
if not mRst_.eof then
for i_mt_ = 1 to mRst_.RecordCount
if mRst_.eof then exit for
mtypeid_ = mRst_("mtypeid")
mTypeName_ = mRst_("mTypeName")
mTypeSelect_ = mRst_("mTypeSelect")
mtypeidSelected = v1v2(mtypeid_,Rmtypeid," style = 'color:red;' selected = 'selected' " , "")
Response.Write"<option value = '" & mtypeid_ & "' " & mtypeidSelected & "> " & mTypeName_ & "</option>"
mRst_.movenext
next
else
end if
mRst_.Close
mRst.movenext
next
else
end if
mRst.Close
Set mRst = Nothing
Set mRst_ =Nothing
if mtypeALL = "view" then mtALL = "<option value = '0' " & v1v2(0,Rmtypeid," style = 'color:red;' selected = 'selected' ","") & ">全部类别</option>" else mALL = ""
Response.Write mtALL & "</select>"
End Function
Public Function PriceTypeList(BoxName,PriceType,RPriceType)
PriceTypeList = "" & _
"<select name = '" & BoxName & "'>" & _
"<option value = '1' " & v1v2(1,RPriceType," style = 'color:red;' selected = 'selected' ","") & ">价格类型一</option>" & _
"<option value = '2' " & v1v2(2,RPriceType," style = 'color:red;' selected = 'selected' ","") & ">价格类型二</option>" & _
"<option value = '3' " & v1v2(3,RPriceType," style = 'color:red;' selected = 'selected' ","") & ">价格类型三</option>" & _
"<option value = '4' " & v1v2(4,RPriceType," style = 'color:red;' selected = 'selected' ","") & ">价格类型四</option>" & _
"</select>"
End Function
Public function financeType_(SQL,BoxName,boxW,RfinanceType)
dim fRs , i_fRs , f , f_
if boxW = "" then boxW = "auto"
Set fRs = Server.CreateObject("Adodb.RecordSet")
fRs.Open(SQL),Conn,1,1
if not fRs.eof then
f = "<select name = '" & BoxName & "' style = 'width:" & boxW & ";'>"
for i_fRs = 1 to fRs.RecordCount
ftypeid_ = fRs("ftypeid")
if RfinanceType = ftypeid_ then fSelected = " style = 'color:red;' checked = 'true' " else fSelected = ""
f_ = f_ & "<option value = '" & ftypeid_ & "' " & fSelected & ">" & fRs("ftypeName") & "</option>"
fRs.movenext
next
financeType_ = f & f_ & "</select>"
else
financeType_ = "<span style = 'color:red;'>请在类别管理添加一个财务类别</span>"
end if
fRs.Close
Set fRs = Nothing
end function
Public Function Logining(Loginid,LoginPass,gourl)
BadStr = "[[]]`~!@#$%^&*()_-+=|\ <>/?'"""
viewBadStr = "LL]]`~!@#$%^&*()_-+=|\ 〈〉/?’”"
Loginid = Check(BadStr,trim(Request("Loginid")),viewBadStr,"0")
LoginPass = Check(BadStr,trim(Request("LoginPassWord")),viewBadStr,"0")
SQL = "select * from admins where Loginid = '" & Loginid & "' and LoginPassWord = '" & Loginpass & "'"
'Server.Transfer gourl
Rs.Open(SQL),conn,1,3
if not Rs.eof then
Session("Seuid_inc") = Rs("aid")
Session("Seloginid_inc") = Rs("loginid")
Session("SeTrueName_inc") = Rs("TrueName")
Session("Sepass_inc") = Rs("LoginPassWord")
Session("SeFlag_inc") = Rs("Flag")
Session("SeRank_inc") = Rs("Rank")
Rs("lasttime") = now()
Rs.update
Response.Redirect gourl & "?info=登陆成功.请稍候…"
else
Response.Redirect gourl & "?info=错误的用户名或密码!"
Exit function
end if
Rs.Close
End Function
Seuid_inc = isNumber(Session("Seuid_inc"),"int",0)
Seloginid_inc = Session("Seloginid_inc")
SeTrueName_inc = Session("SeTrueName_inc")
Sepass_inc = Session("Sepass_inc")
SeFlag_inc = Session("SeFlag_inc")
SeRank_inc = isNumber(Session("SeRank_inc"),"int",1000)
'thisFlag
'SessionFlag 用户字段的flag
'sgin 分隔符
Public Function AdminSelFlag(thisFlag,sgin)
AdminSelFlag = false
dim SessionFlag
SessionFlag = SelectZD("select flag from admins where aid = " & Seuid_inc & "","")
if isnull(SessionFlag) or SessionFlag = "" then
exit function
end if
SessionFlagSplit = Split(Replace(SessionFlag," ",""),sgin)
SessionFlagUbound = Ubound(SessionFlagSplit)
for iFlag = 0 to SessionFlagUbound
if SessionFlagSplit(iFlag) = thisFlag then
AdminSelFlag = true
exit function
else
AdminSelFlag = false
end if
next
end Function
Public Function isLogin
isLogin = true
if isNumber(Seuid_inc,"int",0) = 0 then exit function
isLogin = true
End Function
Public Function Logouting
SQL = "update admins set lasttime = '" & now() & "' where aid = " & isNumber(Seuid_inc,"int",0) & ""
Conn.Execute(SQL)
Session.Abandon
Logouting = viewinfo("divLoca","您已经成功退出!请稍候…","index.asp")
End Function
Public Function DataCount(SQL,DataCountLast)
DataCount = conn.Execute(SQL)(0)
if DataCount = "" or isnull(DataCount) or isNumeric(DataCount) = false then DataCount = DataCountLast
End Function
Public Function SplitAbout(vin,boxoff,list,lastSplitAbout)
if isnull(vin) or vin = "" then
SplitAbout = lastSplitAbout
Exit Function
end if
Splitvin = Split(vin,boxoff)
vinUBound = UBound(Splitvin)
if list > vinUBound then
SplitAbout = lastSplitAbout
Exit Function
end if
SplitAbout = Splitvin(list)
End Function
Public Function ButtonExecute(formname,Btype,Bvalue,Exevalue,alertBox)
if not alertBox = "" then alertBox_ = ""
ButtonExecute = "<input type = '" & Btype & "' value = '" & Bvalue & "' onclick = ""javascript:" & alertBox_ & " " & formname & ".Options.value = '" & Exevalue & "';"">"
End Function
'### List 批量操作
Public Function selAnnounceList(selAnnounce)
selAnnounce = trim(Request.Form(selAnnounce))
if not (selAnnounce) = "" then
dim idReplace , idSplit , idUBound , i_ , iList_
idReplace = Replace(selAnnounce," ","")
idSplit = Split(idReplace,",")
idUBound = UBound(idSplit)
For i_ = 0 to idUBound
if not i_ = idUBound then iList = isNumber(idSplit(i_),"int",0) & "," else iList = isNumber(idSplit(i_),"int",0)
iList_ = iList_ & iList
next
else
iList_ = false
end if
selAnnounceList = iList_
End Function
'###
Public function isNumber(val,sel,isNumberLast)
if isNumeric(val) = false or len(val) > 200 or val = "" then
isNumber = isNumberLast
exit function
end if
val = cstr(val)
dim isNumberLen , val_
isNumberLen = "0123456789"
val_ = Replace(val,"-","")
select case sel
case "int"
valLen = len(val_)
for iisNum = 1 to valLen
if inStr(isNumberLen,mid(val_,iisNum,1)) = 0 then
isNumber = isNumberLast
exit function
else
isNumber = val
end if
next
case "dec"
valdec = Replace(val_,".","")
valLen = len(valdec)
for iisNum = 1 to valLen
if inStr(isNumberLen,mid(valdec,iisNum,1)) = 0 then
isNumber = isNumberLast
exit function
else
isNumber = val
end if
next
end select
if csng(isNumber) < 0 then isNumber = -(abs(isNumber)) else isNumber = abs(isNumber)
if inStrRev(isNumber,".") = 1 then isNumber = "0" & isNumber
End function
'Public function isNumber(val,sel,isNumberLast)
' if isnull(val) or val = "" then
' isNumber = isNumberLast
' exit function
' end if
'
' if inStrRev(val,"-")>1 then
' isNumber = isNumberLast
' Exit Function
' end if
'
' val_ = Replace(val,"-","")
' select case sel
' case "int"
' valLen = len(val_)
' for iisNum = 1 to valLen
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -