📄 user_msg.asp
字号:
i=0
do while not rs.eof
i=i+1
%>
<tr>
<td height="25" align="center" bgcolor="#FFFFFF"><a href="user_msg.asp?action=view_msg&id=<%=rs("id")%>">
<%if len(rs("msg_title"))>13 then%>
<span title="<%=rs("msg_title")%>"><%=left(rs("msg_title"),13)%>……</span>
<%else%>
<%=rs("msg_title")%>
<%end if%>
</a></td>
<%if request.QueryString("sql")<>"outbox" then%>
<td height="25" align="center" bgcolor="#FFFFFF"><%if rs("is_read")=false then%>
<img src="../images/new_msg.gif" alt="该条短信还没有查阅" width="18" height="12">
<%end if%></td>
<%end if%>
<td height="25" align="center" bgcolor="#FFFFFF"><%=rs("msg_time")%></td>
<%if request.QueryString("sql")<>"outbox" then%>
<td height="25" align="center" bgcolor="#FFFFFF"><a href="user_msg.asp?action=del_msg&id=<%=rs("id")%>" title="<%=rs("msg_title")%>" onclick="javascript:{if(confirm('确定要删除该条短信吗?')){return true;}return false;}">删除</a></td>
<%end if%>
</tr>
<%
if i>=maxpage then exit do
rs.movenext
loop
%>
</table>
<table width="450" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post">
<tr>
<td align="center"><font face="Webdings">7</font> <%if currentpage>1 then%><a href="user_msg.asp?sql=<%=request.Querystring("sql")%>"><%end if%>首页<%if currentpage>1 then%></a><%end if%>
<%if currentpage>1 then%><a href="user_msg.asp?page=<%=currentPage-1%>&sql=<%=request.Querystring("sql")%>"><%end if%>上一页<%if currentpage>1 then%></a><%end if%>
<%if cint(currentpage)<totalpage then%><a href="user_msg.asp?page=<%=currentPage+1%>&sql=<%=request.Querystring("sql")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a><%end if%>
<%if cint(currentpage)<totalpage then%><a href="user_msg.asp?page=<%=totalpage%>&sql=<%=request.Querystring("sql")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a><%end if%> <font face="Webdings">8</font> 共有<span class="f3"><%=totalhow%></span>条 <span class="f3"><%=currentPage%></span>/<span class="f3"><%=totalpage%></span>页
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%
for j=1 to totalpage
%>
<option value="user_msg.asp?page=<%=j%>&sql=<%=request.Querystring("sql")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select></td>
</tr>
</table>
<%
end if
if request.QueryString("action")="del_msg" then
conn.execute"delete from webmessage where id="&request.Querystring("id")&""
response.write"<script language=javascript>alert('短信删除成功');location.href = '"&filename&"';</Script>"
response.end
end if
%>
<%end sub%>
<%
sub send_msg()
if isnull(max_send)=false then
if cint(max_send)-cint(total_send)<=0 then
response.write"<script language=javascript>alert('用户每天最多允许发送"&max_send&"条站内短信');history.back();</Script>"
response.end
end if
end if
%>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form2" method="post" action="user_msg.asp?action=save_msg">
<tr>
<td align="center"><table width="450" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" colspan="2">短信标题:
<input name="msg_title" type="text" class="input2" id="msg_title" size="50" maxlength="50"></td>
</tr>
<tr>
<td width="65" height="25">短信正文: </td>
<td><textarea name="msg_body" cols="50" rows="8" class="input3" id="msg_body"></textarea></td>
</tr>
<tr>
<td height="25" colspan="2">验证代码:
<input name="vcode" type="text" class="input2" id="vcode" size="4" maxlength="4">
<img src="../inc/vcode.asp"></td>
</tr>
<tr align="center">
<td height="40" colspan="2"><input name="image" type="image" src="../images/img19.gif" width="48" height="20"></td>
</tr>
</table>
<table width="450" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</form>
</table>
<%end sub%>
<%
sub save_msg()
call myobj.chkrq()
if isnull(max_send)=false then
if cint(max_send)-cint(total_send)<=0 then
response.write"<script language=javascript>alert('用户每天最多允许发送"&max_send&"条站内短信');history.back();</Script>"
response.end
end if
end if
if request.form("msg_title")="" then
response.write"<script language=javascript>alert('短信标题不能为空');history.back();</Script>"
response.end
end if
if myobj.ChkLen(request.form("msg_title"))>50 then
response.write"<script language=javascript>alert('短信标题不能大于50个字符,汉字占两个字符');history.back();</Script>"
response.end
end if
if request.form("msg_title")="" then
response.write"<script language=javascript>alert('短信正文不能为空');history.back();</Script>"
response.end
end if
if UCase(request.form("vcode"))<>session("vcode") then
response.write"<script language=javascript>alert('验证代码错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where (id is null)",conn,1,3
rs.addnew
rs("msg_title")=request.form("msg_title")
rs("msg_body")=request.form("msg_body")
rs("from_userid")=request.cookies("userid")
rs("to_userid")="@admin@"
rs.update
rs.close
%>
<table width="450" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">短信发送成功,请等待管理员查阅后回复</td>
</tr>
</table>
<%end sub%>
<%
sub view_msg()
call myobj.chkrq()
if request.querystring("id")="" then
response.write"<script language=javascript>alert('无法获取短信ID值');history.back();</Script>"
response.end
end if
if myobj.ChkNum(request.querystring("id"))=false then
response.write"<script language=javascript>alert('短信ID值类型错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where id="&request.QueryString("id")&"",conn,1,1
if rs.eof then
call nr()
response.write"<script language=javascript>alert('该条短信并不存在');history.back();</Script>"
response.end
else
msg_title=rs("msg_title")
msg_body=rs("msg_body")
msg_time=rs("msg_time")
end if
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where id="&request.QueryString("id")&"",conn,1,3
if rs("to_userid")<>"@admin@" then
rs("is_read")=true
rs.update
end if
rs.close
%>
<table width="450" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="25" align="left" bgcolor="#F7F7F7">短信标题:<%=msg_title%></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#F7F7F7">接收时间:<%=msg_time%></td>
</tr>
<tr>
<td height="25" align="left" bgcolor="#FFFFFF"><%=myobj.formatbody(msg_body)%></td>
</tr>
</table>
<%end sub%>
<!--尾-->
<%
sub del_msg()
call myobj.chkrq()
if request.querystring("id")="" then
response.write"<script language=javascript>alert('无法获取短信ID值');history.back();</Script>"
response.end
end if
if myobj.ChkNum(request.querystring("id"))=false then
response.write"<script language=javascript>alert('短信ID值类型错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from webmessage where id="&request.QueryString("id")&"",conn,1,1
if rs.eof then
call nr()
response.write"<script language=javascript>alert('该条短信并不存在');history.back();</Script>"
response.end
end if
rs.close
conn.execute"delete from webmessage where id="&request.Querystring("id")&""
response.write"<script language=javascript>alert('短信删除成功');location.href = 'user_msg.asp';</Script>"
response.end
end sub
%>
</td>
</tr>
</table>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -