?? listforclient.asp
字號:
<%
'////////////////////////////////////////////////////////////////
'/////文 件 名:/list.asp
'/////程序名稱:短消息程序+通知程序
'/////所屬模塊:公共
'/////輸入接口:1、Session變量:
'///// <1>:Session("id"):當前用戶名稱
'///// <2>:Session("conn"):系統數據庫連接
'///// <3>:Session("conn2"):系統郵件數據庫連接
'///// <4>:Session("num"):收件箱中暫存郵件數
'///// 2、Request 變量:
'///// <1>:Request("op"):操作標志
'///// <2>:Request("vtext"):短消息內容
'///// <3>:Request("vname")短消息接受者列表
'///// 3、Include File:
'///// <1>:css.asp 樣式表
'/////創建日期:2002-2002-6-24
'/////創 建 人:羅向東
'/////修改記錄:
'///// 2002-7-24 羅向東 代碼歸整
'////////////////////////////////////////////////////////////////
Option Explicit
Dim temptime,fromYear,fromMonth,fromSecond,fromDay,fromMinute,fromHour,x(5),fixstr,t,i,te,strr,online,offline,onname,offname,Record,shijian,shijian1,shijian2,RefreshTime
'on error resume next
'更新在線列表
function fmt(str,width)
fmt=right(string(width,"0") & str ,width)
end function
temptime = now()
fromYear = year(temptime)
fromMonth = fmt(month(temptime),2)
fromDay = fmt(day(temptime),2)
fromMinute= fmt(Minute(Time()),2)
fromHour = fmt(Hour(Time()),2)
shijian=fromYear & fromMonth & fromDay & fromHour & fromMinute
x(1)=cint(fromMinute)-3
x(2)=cint(fromHour)
x(3)=cint(fromDay)
x(4)=cint(fromMonth)
x(5)=cint(fromYear)
if x(1)<0 then
x(1)=x(1)+60
x(2)=x(2)-1
if x(2)<0 then
x(2)=x(2)+24
x(3)=x(3)-1
if x(3)<0 then
x(3)=x(3)+30
x(4)=x(4)-1
if x(4)<0 then
x(4)=x(4)+12
x(5)=x(5)-1
end if
end if
end if
end if
for i=5 to 1 step -1
shijian1=shijian1+fmt(x(i),2)
next
shijian1=left(fromYear,2)+shijian1
Session("conn").execute "update [user] set online='t',utime='" & shijian & "' where vname='" & Session("id") & "'"
Session("conn").execute "update [user] set online='f' where utime<'" & shijian1 & "'"
'讀取人員在線狀態列表
set Record = Server.CreateObject("ADODB.Recordset")
Record.open "select [vname],[online] from [user] order by hudpnumber",Session("conn"),1,1
online=0
offline=0
while not Record.eof
if Record("online")="t" then
online=online+1
onname=onname & "<option value='" & Record("vname") & "'>" & Record("vname")
else
offline=offline+1
offname=offname & "<option style='color:gray' value='" & Record("vname") & "'>" & Record("vname")
end if
Record.movenext
wend
Record.close
'檢測收到的短消息
Record.open "select * from message where vread='f' and vname='" & Session("id") & "'",Session("conn"),1,1
while not Record.eof
strr="var a=open('../message/message.asp?opFlag=cmdRecived&id=" & Record("id") & "','','width=400,height=200,top=100,left=200');"
response.write(strr)
Record.movenext
wend
Record.close
'檢測新郵件
Dim nu
Record.open "select iread from recived"+Session("id")+" where iread='f'",Session("conn2"),1,1
nu=cint(Record.recordcount)
if Session("num")< nu then
strr=strr+" if(confirm('"+Session("id")+",您的信箱有了新郵件!')){document.all.tempform.submit()};"
Session("num")=nu
response.write(strr)
end if
Record.Close
Record.open "select * from remind where vstate='未提醒' and vowner='" + Session("id") +"' and vremindtime<='" & fromYear & "-" & fromMonth & "-" & fromDay & " " & fromHour & ":" & fromMinute & "'",Session("conn"),1,3
nu=cint(Record.recordcount)
if nu>0 then
strr=vbcrlf & " alert('" & Session("id") & ",您的一項日程安排時間到了。\n\n時間:" & Record("vtime") & "\n標題:" & Record("vtitle") & "\n內容:" & Record("vtext") & "');"
Record("vstate")="<font color=blue>已提醒</font>"
Record.update
response.write(strr)
end if
Record.Close
set Record=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -