国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - ASP教程 - 用ASP實現(xiàn)分級權限控制

用ASP實現(xiàn)分級權限控制

2019-10-10 10:29asp教程網(wǎng) ASP教程

用ASP實現(xiàn)分級權限控制 本文實現(xiàn)的是一個帳務管理系統(tǒng)中分級權限的控制,程序使用ASP和javascript編寫,在裝有IIS4.0的win NT服務器上運行,速度快,易維護。 權限級別劃分如下: ①、院長和財務科長:不能輸入,可以無限制查詢、

用ASP實現(xiàn)分級權限控制  
  本文實現(xiàn)的是一個帳務管理系統(tǒng)中分級權限的控制,程序使用ASP和javascript編寫,在裝有IIS4.0的win  NT服務器上運行,速度快,易維護。
權限級別劃分如下:
①、院長和財務科長:不能輸入,可以無限制查詢、統(tǒng)計;
②、副院長:不能輸入,可以查詢、統(tǒng)計其分管部門的帳務;
③、部門領導:不能輸入,可以查詢、統(tǒng)計本部門的帳務;
④、會計:能輸入各部門的帳務(一個會計有時要做幾個部門的帳),只能查詢、統(tǒng)計自己輸入的帳務。
涉及的數(shù)據(jù)庫和字段如下
①、JK_USER數(shù)據(jù)庫及字段:id(序列號),bmid(部門號),username(用戶名),pwd(口令),right(權限值);
②、BM數(shù)據(jù)庫及字段:id(序列號)  ,bmid(部門號);
③、JZPZ數(shù)據(jù)庫及字段:id(序列號),bm(部門),  zgs(子公司),xmz(項目組),xm(項目),sr(收入),zc(支出),szfx(收支方向),szxs(收支形式),
rq(日期),jbr(經(jīng)辦人),lrr(錄入人),szsm(收支說明);  
④、ZGS數(shù)據(jù)庫及字段:id(序列號),zgs(子公司)name(公司名),bmid(部門編號)。
1.首先進行用戶身份合法性驗證
  將用戶提交的用戶名和口令與數(shù)據(jù)庫JK_USER中的字段對照對照,以確定其合法性,只有合法的用戶(系統(tǒng)管理員為其開過戶)才可以進入,合法用戶有

四種權限級別,分別賦予“1”、“2”、“3”、“4”四種權限值。(程序略)。
2.憑證記帳(分級權限控制)
  憑證記帳功能是專為會計人員服務的,其他人不可以使用,如以非會計人員身份進入憑證錄入界面時,只有“查詢記帳憑證”功能按鈕可見,其它功能

按鈕不可見。錄入的憑證先存放在一個臨時表里,稱為“未記帳憑證庫”,只有運行“憑證記帳”功能后才進入“憑證庫”在“未記帳憑證庫”中的憑證可以

修改。部分程序如下:
'非會計人員進入,不顯示“憑證記帳”和“保存未記帳憑證”功能按鈕
if  (thisPage.firstEntered)  then  
if  session("tright")<>  "1"  then  
button1.hide
button2.hide
end  if
…………
'自動填寫時間和操作人
Textbox7.value=year(date)  &  "-"  &  month(date)  &  "-"  &  day(date)
Textbox9.value  =session("username")  
set  cnn1=server.CreateObject("adodb.connection")
set  rst1=server.CreateObject("adodb.recordset")
cnn1.CursorLocation=3
cnn1.ConnectionTimeout  =30
cnn1.Open  "DSN=jky"
rst1.Open  "select  *  from  bm  ",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
RST1.MoveFirst  
Id=rst1.Fields("id")
do  while  not  rst1.EOF
Listbox3.addItem  rst1.Fields("bmName"),cint(rst1.Fields("id"))
“Response.Write  rst1.Fields("bmname")  &  rst1.Fields("id")
rst1.MoveNext  
loop
end  if
rst1.Close
rst1.Open  "select  zgsname  from  zgs  where  bmid="  &  id,cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
rst1.MoveFirst  
do  while  not  rst1.EOF
Listbox4.addItem  cstr(rst1.Fields("zgsname"))
rst1.MoveNext  
loop
end  if
rst1.Close
cnn1.close
call  writerst
end  if
end  function
………………
'憑證記帳
sub  button2_onclick
dim  s
s=Listbox1.selectedIndex
Response.Write  s
end  sub
sub  listbox3_onchange
dim  id,i
i=Listbox4.getCount()
do  while  i>-1
call  Listbox4.removeItem(i)
i=i-1
loop
id=listbox3.getValue  (listbox3.selectedIndex)
set  cnn2=server.CreateObject("adodb.connection")
set  rst2=server.CreateObject("adodb.recordset")
cnn2.CursorLocation=3
cnn2.ConnectionTimeout  =30
cnn2.Open"DSN=jky"
rst2.Open  "select  zgsName  from  zgs  where  bmid="  &  id,cnn2,1,1,adcmdtext
if  rst2.RecordCount  >0  then
RST2.MoveFirst  
do  while  not  rst2.EOF
Listbox4.addItem  cstr(rst2.Fields("zgsName"))
rst2.MoveNext  
loop
end  if
rst2.Close
cnn2.Close
end  sub
sub  button2_onclick
set  cnn5=server.CreateObject("adodb.connection")
cnn5.CursorLocation=3
cnn5.ConnectionTimeout  =30
cnn5.Open"DSN=jky"
cnn5.Execute  "insert  into  jzpz(bm,zgs,xmz,xm,sr,zc,szfx,szxs,rq,jbr,lrr,szsm)  select  bm,zgs,xmz,xm,sr,zc,szfx,szxs,rq,jbr,

lrr,szsm  from  wjzpz  where  lrr=“"  &  session("username")  &  "“"
cnn5.Execute  "delete  from  wjzpz  where  lrr=“"  &  session("username")  &  "“"
end  sub
3.數(shù)據(jù)查詢(分級權限控制)
以憑證的字段為條件進行查詢,在供選條件前有一方框供打“√”,其中“部門“條件必選(程序自動加上),部門內(nèi)容由程序根據(jù)用戶的權限自動

從數(shù)據(jù)庫中調(diào)用相應值,分公司內(nèi)容根據(jù)所屬部門自動調(diào)整,部分程序如下:
……………
'根據(jù)權限值進入相應的查詢界面
……………
function  thisPage_onenter()
set  cnn1=server.CreateObject("adodb.connection")
set  rst1=server.CreateObject("adodb.recordset")
cnn1.CursorLocation=3
cnn1.ConnectionTimeout  =30
cnn1.Open  "dsn=jky"
select  case  session("Tright")
case  "3"“副院長
rst1.Open  "select  bm.bmName  from  jk_user  ,bm  where  JK_user.bmid=bm.id  and  jk_user.username  =“"&  session("username") 

&  "“",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
RST1.MoveFirst  
do  while  not  rst1.EOF
Listbox1.addItem  cstr(rst1.Fields("bmName"))
rst1.MoveNext  
loop
end  if
rst1.Close
rst1.Open  "select  zgsname  from  zgs  ",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
rst1.MoveFirst  
do  while  not  rst1.EOF
Listbox2.addItem  cstr(rst1.Fields("zgsname"))
rst1.MoveNext  
loop
end  if
rst1.Close
cnn1.close
Checkbox1.setChecked  (true)
case  "2"“部門經(jīng)理
Listbox1.addItem  session("bm")
rst1.Open  "select  zgsname  from  zgs  where  bmid="  &  session("bmid"),cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
rst1.MoveFirst  
do  while  not  rst1.EOF
Listbox2.addItem  cstr(rst1.Fields("zgsname"))
rst1.MoveNext  
loop
end  if
rst1.Close
cnn1.close
Checkbox1.setChecked  (true)
“Checkbox1.0  
case  "1"“會計  
rst1.Open  "select  bmName  from  bm  ",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
RST1.MoveFirst  
do  while  not  rst1.EOF
Listbox1.addItem  cstr(rst1.Fields("bmName"))
rst1.MoveNext  
loop
end  if
rst1.Close
rst1.Open  "select  zgsname  from  zgs  ",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
rst1.MoveFirst  
do  while  not  rst1.EOF
Listbox2.addItem  cstr(rst1.Fields("zgsname"))
rst1.MoveNext  
loop
end  if
rst1.Close
cnn1.close
case  "4"“院長  
rst1.Open  "select  bmName  from  bm  ",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
RST1.MoveFirst  
do  while  not  rst1.EOF
Listbox1.addItem  cstr(rst1.Fields("bmName"))
rst1.MoveNext  
loop
end  if
rst1.Close
rst1.Open  "select  zgsname  from  zgs  ",cnn1,1,1,adcmdtext
if  rst1.RecordCount  >0  then
rst1.MoveFirst  
do  while  not  rst1.EOF
Listbox2.addItem  cstr(rst1.Fields("zgsname"))
rst1.MoveNext  
loop
end  if
rst1.Close
cnn1.close
end  select  
end  if
…………
end  function
'按照權限查詢憑證
sub  button1_onclick
dim  rst2,cnn2,str,i
dim  bm(1),zgs(1),xmz(1),xm(1),szfx(1),szxs(1),rq(2),jbr(1)
bm(0)=Checkbox1.getChecked()
if  bm(0)  then
bm(1)=Listbox1.getText(Listbox1.selectedIndex  )
str="  and  bm=“"  &  bm(1)  &  "“"
end  if
zgs(0)=Checkbox2.getChecked()
if  zgs(0)  then
zgs(1)=Listbox2.getText(Listbox2.selectedIndex  )
str=str  &  "  and  zgs  =“"&  zgs(1)  &  "“"
end  if
xmz(0)=Checkbox3.getChecked()
if  xmz(0)  then
xmz(1)=trim(txtxmz.value  )
str=str  &  "  and  xmz  like  “%"  &  xmz(1)  &  "%“"
end  if
xm(0)=Checkbox4.getChecked()
if  xm(0)  then
xm(1)=trim(tztxm.value  )
str=str  &  "  and  xm  like  “%"  &  xm(1)  &  "%“"
end  if
szfx(0)=Checkbox5.getChecked()
if  szfx(0)  then
szfx(1)=Listbox3.getText(Listbox3.selectedIndex  )
str  =str  &  "  and  szfx  =“"  &  szfx(1)  &  "“"
end  if
szxs(0)=Checkbox6.getChecked()
if  szxs(0)  then
szxs(1)=Listbox4.getText(Listbox4.selectedIndex  )
str  =str  &  "  and  szxs  =“"  &  szxs(1)  &  "“"
end  if
jbr(0)=Checkbox8.getChecked()
if  jbr(0)  then
jbr(1)=trim(txtjbr.value  )
str  =str  &  "  and  jbr  like  “%"  &  jbr(1)  &  "%“"
end  if
set  cnn2=server.CreateObject("adodb.connection")
set  rst2=server.CreateObject("adodb.recordset")
cnn2.CursorLocation=3
cnn2.ConnectionTimeout  =30
cnn2.Open  "dsn=jky"
Response.Write  "<table  border=“1“  cellPadding=0  cellSpacing=0  width=“650“  height=“33“  >"
Response.Write  "<tr>"
Response.Write  "<td  width=“100%“  colspan=“6“  height=“44“  align=“middle“  bgcolor=lightblue>"
Response.Write  "<p  align=“center“><b><font  color=“#000084“>記  帳  憑  證  列  表"
Response.Write  "</font></b></p></td></tr>  "
Response.Write  "<tr>"
Response.Write  "<td  width=“15%“  bgcolor=lightsteelblue>"
Response.Write  "部  門</td>"
Response.Write  "<td  width=“20%“bgcolor=lightsteelblue>"
Response.Write  "子公司</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightsteelblue>"
Response.Write  "項目組</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightsteelblue>"
Response.Write  "項目名/合同號</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightsteelblue>"
Response.Write  "收入金額(萬元)</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightsteelblue>"
Response.Write  "支出金額(萬元)</td></tr>"
if  session("Tright")="1"  then
“Response.Write  "AAAAAAAA"
rst2.Open  "select  *  from  jzpz  where  id>0  and  lrr=“"  &  session("username")  &  "“"  &  str  ,cnn2,1,1,adcmdtext
else
“Response.Write  "FFFFFFFFFFFFF"
rst2.Open  "select  *  from  jzpz  where  id>0  "  &  str  ,cnn2,1,1,adcmdtext
end  if
if  rst2.RecordCount  >0  then
rst2.MoveFirst
rst2.PageSize  =20
rst2.AbsolutePage  =1
i=0
do  while  not  rst2.EOF  and  i<  rst2.PageSize  
Response.Write  "<tr>"
Response.Write  "<td  width=“15%“  bgcolor=lightgrey>"&  rst2.Fields("bm")&  "</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightgrey>"&  rst2.Fields("zgs")&  "</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightgrey>"&  rst2.Fields("xmz")&  "</td>"
Response.Write  "<td  width=“15%“  bgcolor=lightgrey><a  href=“FMjz1.asp?Id="&  rst2.Fields("id")  &  "“ 

target=“_blank“>"  &  rst2.Fields("xm")&  "</a></td>"
Response.Write  "<td  width=“5%“  bgcolor=lightgrey>"&  rst2.Fields("sr")&  "</td>"
Response.Write  "<td  width=“5%“  bgcolor=lightgrey>"&  rst2.Fields("zc")&  "</td>"
Response.Write  "</tr>"
i=i+1
rst2.MoveNext  
loop
end  if
Response.Write  "</table>"
Response.Write  "</div>"
j=  rst2.PageCount
Response.Write  "<P  align=center><b>共有頁數(shù):  "  
for  i=1  to  j
Response.Write  "<a  href=“Fmjzpzck1.asp?ID="  &  i  &  "“  target=“_blank“>"  &  i  &  "</a>"  &  "  "
if  j  mod  10=  0  then
Response.Write  "<br>"
end  if
next  
Response.Write  "</b></p>"
rst2.Close
cnn2.Close  
…………
end  sub
  應用以上程序,可以根據(jù)用戶的權限,按照用戶的要求實行訂制查詢,該系統(tǒng)在win  NT、IIS4.0和win98、PWS上運行通過。  

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 日韩电影中文字幕 | 欧美三级影院 | 狠狠色狠色综合曰曰 | 99亚洲精品 | 亚洲国产中文字幕 | 欧美在线高清 | 毛片入口 | 日本免费视频 | 久久中文字幕一区 | 日韩精品无码一区二区三区 | 国产视频亚洲 | 国产成人91 | 91麻豆精品国产91久久久更新资源速度超快 | 毛片一级片| 欧美三区二区一区 | 爱色av网站 | 久久成人精品视频 | 欧美一级特黄aaaaaa | 黄网站在线观看 | av在线播放网 | 亚洲视频在线观看免费 | 亚洲一区二区在线 | 亚洲在线一区 | 在线成人www免费观看视频 | 成人av免费观看 | 亚洲视频免费 | 成人久久久 | 日韩有码av | 黄色电影免费在线观看 | 欧美精品亚洲精品日韩精品 | 精品黄色国产 | 亚洲精品久久久久久久久久久久久 | 精品视频免费在线 | 国产一区在线免费观看 | 久久久久久毛片免费播放 | 成人福利网站 | 国产精品国产精品国产专区不片 | 黄色片在线免费观看 | 中文字幕成人影院 | 亚洲欧美中文日韩在线v日本 | 91精品久久 |