📄 list.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
response.write("<html><head><title>短消息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>")
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
response.write("</head><script language=javascript>function reloadthis()" + vbcrlf +"{")
if request("op")="cmdSendmsg" then
response.write("window.location.href='list.asp';}")
else
response.write("window.location.reload(true);}")
end if
response.write("window.setTimeout('reloadthis()'," & Session("RefreshTime")*1000 & ");")
%>
function sms(toname)//发送短消息
{
var a=open("../message/message.asp?opFlag=cmdSend&sendto=" + toname ,"", "left=200,width=400,height=200,top=100");
/*
if(msg!=null)
{
document.all.vtext.value=msg
document.all.vname.value=toname
document.all.op.value='cmdSendmsg'
document.all.msgform.submit()
}
*/
document.all.selectxx.selectedIndex=0
};
function smss()//群发消息
{
return_value=showModalDialog("../public/userlist.asp?muilt=yes","","dialogWidth:25;dialogHeight:16;dialogTop:250;dialogLeft:260;status:no;scrollbars:no;help:no");
if((typeof(return_value)=="undefined") ||(return_value=="*") || (return_value==""))
return;
else
{
var str1="";
var str2="";
tmpstr=return_value.split("*");
str1=tmpstr[0];
str2=tmpstr[1];
sms(str1);
}
};
</script>
<body name=mainb scroll=no style="background:#000000;" bgcolor="#000000" leftmargin="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" class=vtext>
<tr bgcolor=ffffff>
<td name=sel nowrap align="right" >
<select name="selectxx" id="selectxx" style="<%=session("vinputtext")%>;display:none;font-size:12px;width:120" onChange="javascript:sms(document.all.selectxx.value);" >
<option style="background:4444ff; color:white">--在线<%=online%>人--</option>
<%=onname%>
<option style="background:4444ff;color:white">--离线<%=offline%>人--</option>
<%=offname%>
</select>
<a href="javascript:smss()"><font color="#FFFFFF"><img src="../images/man.gif" width="16" height="16" border="0" alt="消息群发" align="absmiddle">
</font></a></td>
</tr>
</table>
<div id="Layer1" align="center"
onMouseOver="if(document.readyState=='complete'){document.all.selectxx.style.display='';if(document.activeElement.name!='selectxx') document.all.selectxx.focus()}"
onMouseOut="if(document.readyState=='complete'){document.all.selectxx.style.display='none'}" style="background:0;border:0 solid #888888;position:absolute; width:120px; height:17px; z-index:1; left:1px; top: 1px">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class=vtext>
<tr bgcolor=ffffff>
<td align=center><font color="#FFFFFF" style="font-size:12px" >--在线<b><%=online%></b>人--</font></td>
</tr>
</table>
</div>
<%
response.write("<form name=tempform method=post action=../mail/mailbox.asp?mailbox=recived target=main></form><form style='display:no' name='msgform' method='post' action='../main/list.asp'> <input type='hidden' name='vtext'> <input type='hidden' name='vname'> <input type='hidden' name='op'></form>")
response.write("<script language=javascript>var xx;function checkmsg(){window.clearTimeout(xx);")
'检测收到的短消息
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
response.write("};xx=window.setTimeout('checkmsg()',1000);</script>")
%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -