📄 listforclient.asp
字号:
<%
'////////////////////////////////////////////////////////////////
'/////文 件 名:/list.asp
'/////程序名称:短消息程序+通知程序
'/////所属模块:公共
'/////输入接口:1、Session变量:
'///// <1>:Session("id"):当前用户名称
'///// <2>:oconn:系统数据库连接
'///// <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
oconn.execute "update [user] set online='t',utime='" & shijian & "' where vname='" & Session("id") & "'"
oconn.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",oconn,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") & "'",oconn,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 & "'",oconn,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 + -