?? empmain_checkright.asp
字號:
<%
response.expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma","no-cache"
response.addHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<%
if trim(request.Cookies("UserName")) = "" then
response.Write("您還沒有正確登錄本系統!")
response.end
end if
%>
<%
Function fnCheckRight1(PageName,RightID)
Dim UR
Dim UR_numRows
Set UR = Server.CreateObject("ADODB.Recordset")
UR.ActiveConnection = MM_EmpMain_STRING
UR.Source = "SELECT * FROM T_User where F_Id = "& request.Cookies("ID") &" and " & PageName & " like '%" & RightID & "%'"
UR.CursorType = 0
UR.CursorLocation = 2
UR.LockType = 1
UR.Open()
if UR.eof then
response.Write("沒有權限!")
response.End
end if
End function
Function fnCheckRight()
Dim UR
Dim UR_numRows
Set UR = Server.CreateObject("ADODB.Recordset")
UR.ActiveConnection = MM_EmpMain_STRING
UR.Source = "SELECT * FROM T_User where F_Id = "& request.Cookies("ID") &" and F_IsPass=true "
UR.CursorType = 0
UR.CursorLocation = 2
UR.LockType = 1
UR.Open()
if UR.eof then
response.Write("沒有權限!")
response.End
end if
UR.close
set UR=nothing
End function
function fncheckupart(t)'檢查權限
dim uP,UP_numrows
fncheckupart=false
set uP=server.createobject("adodb.recordset")
UP.Activeconnection=MM_EmpMain_string
UP.source="select * from T_User where F_Id="&request.cookies("ID")&" and F_IsPass=true"
UP.cursortype=0
UP.cursorlocation=2
uP.locktype=1
Up.open()
if UP.eof then
else
if UP("F_Authority")=t then
fncheckupart=true
end if
end if
uP.close
set up=nothing
end function
function fncheckact(t,x)'t為權限字串名稱,x為1是只讀,2是可寫
dim up
fncheckact=false
set uP=server.createobject("adodb.recordset")
uP.Activeconnection=MM_EmpMain_string
uP.source="select * from T_User where F_Id="&request.cookies("ID")&" and F_IsPass=true "
uP.cursortype=0
uP.cursorlocation=2
uP.locktype=1
uP.open()
if not up.eof then
dim str
str=split(uP(t),",")
for i=0 to ubound(str)
if str(i)=x then
fncheckact=true
end if
next
end if
end function
function fncheckdq(str)'地區權限
dim uP,chkstr,chkstr1
fncheckdq=false
set uP=server.createobject("adodb.recordset")
uP.Activeconnection=MM_EmpMain_string
uP.source="select * from T_User where F_Id="&request.cookies("ID")&" and F_IsPass=true"
uP.cursortype=0
uP.cursorlocation=2
uP.locktype=1
uP.open()
if uP.eof then
chkstr1=""
else
chkstr1=uP("F_Region")
chkstr=split(chkstr1,",")
for i=0 to ubound(chkstr)
if chkstr(i)=str then
fncheckdq=true
exit for
end if
next
end if
uP.close
set uP=nothing
end function
function usersel(t)
Set SCode = Server.CreateObject("ADODB.Recordset")
SCode.ActiveConnection = MM_EmpMain_STRING
SCode.Source = "SELECT * FROM user where ID="&request.cookies("ID")&" and ispass=true"
SCode.CursorLocation = 2
SCode.LockType = 1
SCode.Open()
HTMLOption = "<option></option>"
if not sCODe.eof then
strOptions = SCode("F_Region")
if trim(strOptions) <> "" Then
aryOptions = split(strOptions,",")
For i = 0 to UBound(aryOptions)
HTMLOption = HTMLOption + "<option value='"&aryOptions(i)&"'>"&aryOptions(i)&"</option>"
Next
end if
End if
usersel=HTMLOption
SCode.close
set SCode=nothing
end function
sub qxover()
Set URight = Server.CreateObject("ADODB.Recordset")
URight.ActiveConnection = MM_EmpMain_STRING
URight.Source = "SELECT * FROM T_User where F_Id="&request.cookies("ID")&" and F_IsPass=true"
URight.CursorType = 0
URight.CursorLocation = 2
URight.LockType = 1
URight.Open()
URight_numRows = 0
username = URight("F_UserName")
password = URight("F_UserPass")
PayList = URight("F_ClientInformation")
EmpList = URight("F_AddStaff")
HolList = URight("F_TrackRecord")
overview = URight("F_ConsignorRecord")
user_right=URight("F_Authority")
shenf=URight("F_Region")
URight.close
set URight=nothing
end sub
Function createSel(selName,stdValue)
Set SCode = Server.CreateObject("ADODB.Recordset")
SCode.ActiveConnection = MM_EmpMain_STRING
SCode.Source = "SELECT * FROM T_Class where F_SelectName = '"& selName &"'"
SCode.CursorLocation = 2
SCode.LockType = 1
SCode.Open()
HTMLOption = "<option></option>"
strOptions = SCode("F_OptionContent")
if trim(strOptions) <> "" Then
aryOptions = split(strOptions,",")
For i = 0 to UBound(aryOptions)
if aryOptions(i) = stdValue Then
strSelected = "selected"
else
strSelected = ""
End if
HTMLOption = HTMLOption + "<option "&strSelected&" value='"&aryOptions(i)&"'>"&aryOptions(i)&"</option>"
Next
End if
createSel = HTMLOption
SCode.close
set SCode=nothing
End function
sub select_str(str,a,t)
dim str_1
str_1=split(str,",")
if a=1 then
response.write("<option />")
end if
For i=0 to UBound(str_1)
if t<>"" and t=str_1(i) then
sl="selected"
end if
response.write("<option value="&str_1(i)&" "&sl&">"&str_1(i)&"</option>")
next
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -