📄 user_msg.asp
字号:
<!--#include file="../chklogin.asp"-->
<%
'################登陆状态及网吧用户判断#########################
if request.cookies("userid")="" then '如果账号值为空,视为没登陆,转到登陆页
Response.Redirect ("login.asp")
else '否则视为已登陆
if request.cookies("u_type")=3 then '如果是网吧用户
if request.cookies("center")<>1 then '并且没有登陆管理中心
Response.Redirect ("login.asp?action=center") '转到网吧管理中心登陆
end if
end if
end if
'################登陆状态及网吧用户判断#########################
set rs=server.createobject("adodb.recordset")
rs.open "select * from setup where id=1",conn,1,1
website_name=rs("website_name")
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from setup where id=1",conn,1,1
website_name=rs("website_name")
max_send=rs("max_send")
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where from_userid='"&request.cookies("userid")&"' and datediff(d,msg_time,getdate())=0",conn,1,1
total_send=cint(rs.recordcount)
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where to_userid='"&request.cookies("userid")&"' and is_read=0",conn,1,1
new_msg_count=cint(rs.recordcount)
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where to_userid='"&request.cookies("userid")&"' order by is_read,id desc",conn,1,1
inbox_count=cint(rs.recordcount)
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where from_userid='"&request.cookies("userid")&"' order by id desc",conn,1,1
outbox_count=cint(rs.recordcount)
rs.close
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=website_name%> - 用户管理中心</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #FF6600;
}
-->
</style>
<link href="../images/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function tourl(form1_url){
location=form1_url;
for(var i=0;i<document.form1.elements.length;i++){
document.form1.elements[i].options[0].selected=true
}
}
</script>
</head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<!--#include file="header.asp"-->
<table width="776" height="450" border="0" align="center" cellpadding="0" cellspacing="0" class="t1">
<tr>
<td width="260" height="36" rowspan="2" background="../images/img22.gif"><img src="../images/img29.gif" width="220" height="36"></td>
<td width="9" height="36" rowspan="2" valign="top"><img src="../images/1_04.jpg" width="9" height="36"></td>
<td height="11" background="../images/1_05.jpg"></td>
</tr>
<tr>
<td height="25"><a href="index.asp">用户管理中心</a> - <a href="user_msg.asp">站内短信</a> -
<%if request.querystring("action")="" and request.QueryString("sql")="" then%>收件箱<%end if%><%if request.querystring("action")="" and request.QueryString("sql")="outbox" then%>已发送<%end if%>
<%if request.querystring("action")="send_msg" then%>撰写短信<%end if%></td>
</tr>
<tr>
<td width="260" align="center" valign="top"><table width="240" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img18.gif" width="23" height="21"></td>
<td align="left"><a href="index.asp"><strong>管理首页</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img25.gif" width="23" height="21"></td>
<td align="left"><strong><a href="user_data.asp">修改资料</a></strong></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img26.gif" width="23" height="21"></td>
<td align="left"><a href="user_cz.asp"><strong>影卡充值</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img27.gif" width="23" height="21"></td>
<td align="left"><strong>站内短信←</strong></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img28.gif" width="23" height="21"></td>
<td align="left"><a href="user_filmfav.asp"><strong>影片收藏</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img16.gif" width="23" height="21"></td>
<td align="left"><a href="login.asp?action=logout"><strong>退出登陆</strong></a></td></tr>
</table>
</td>
<td valign="top" background="../images/1_24.jpg"> </td>
<td align="center" valign="top">
<!--头-->
<table width="450" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" align="center"></td>
</tr>
</table>
<table width="450" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="270" height="25" align="center"><%if isnull(max_send)<>true then%>每天最多发<%=max_send%>条,今天还可发送<%if cint(max_send)-cint(total_send)<=0 then%>0<%else%><%=cint(max_send)-cint(total_send)%>条<%end if%><%end if%></td>
<td width="60" rowspan="2" align="center"><a href="user_msg.asp?action=send_msg"><img src="../images/msg_write1.gif" width="40" height="40" border="0"></a></td>
<td width="60" rowspan="2" align="center"><a href="user_msg.asp"><img src="../images/msg_inbox1.gif" width="40" height="40" border="0"></a></td>
<td width="60" rowspan="2" align="center"><a href="user_msg.asp?sql=outbox"><img src="../images/msg_send1.gif" width="40" height="40" border="0"></a></td>
</tr>
<tr>
<td height="25" align="center">未读<%if new_msg_count>0 then%><span class="f3"><%end if%><%=new_msg_count%><%if new_msg_count>0 then%></span><%end if%>条 / 收件箱<%=inbox_count%>条 / 已发送<%=outbox_count%>条</td>
</tr>
</table>
<%
action_e=request.Querystring("action")
Select Case action_e
Case ""
Call main()
Case "send_msg"
Call send_msg()
Case "save_msg"
Call save_msg()
Case "view_msg"
Call view_msg()
Case "del_msg"
Call del_msg()
end select
%>
<%
sub main
if request.QueryString("sql")="" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where to_userid='"&request.cookies("userid")&"' order by is_read,id desc",conn,1,1
end if
if request.QueryString("sql")="outbox" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where from_userid='"&request.cookies("userid")&"' order by id desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="100" align="center" bgcolor="#F7F7F7"><%if request.querystring("sql")<>"outbox" then%>
收件箱中没有任何短信
<%else%>
没有任何已发送的短信
<%end if%></td>
</tr>
</table>
<%
else
maxpage=10 '每页最大显示数
dim totalhow '数据库中的总记录数
dim totalpage '总共页数
dim CurrentPage '当前处于的页数
currentPage=request.Querystring("page")
totalhow=rs.recordcount
if totalhow mod maxpage=0 then
totalpage= totalhow \ maxpage
else
totalpage = totalhow \ maxpage +1
end if
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPage>totalhow then
if (totalhow mod MaxPage)=0 then
currentpage= totalhow \ MaxPage
else
currentpage= totalhow \ MaxPage + 1
end if
end if
if (currentPage-1)*MaxPage<totalhow then
rs.move (currentPage-1)*MaxPage
else
currentPage=1
end if
%>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="25" align="center" bgcolor="#F7F7F7">标题</td>
<%if request.QueryString("sql")<>"outbox" then%>
<td align="center" bgcolor="#F7F7F7">状态</td>
<%end if%>
<td align="center" bgcolor="#F7F7F7"><%if request.querystring("sql")<>"outbox" then%>接收<%else%>发送<%end if%>时间</td>
<%if request.QueryString("sql")<>"outbox" then%>
<td align="center" bgcolor="#F7F7F7"> 操作 </td>
<%end if%>
</tr>
<%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -