网络寻呼机数据库版显示消息showmessage.asp

 1<html>
 2<head>
 3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 4<title>显示自己的信息</title>
 5<script language="javascript">   
 6<!--   
 7function checks(theform1){   
 8if (theform1.word.value=="")   
 9{   
10alert("请随便说几句。");   
11theform1.word.focus();   
12return false;   
13}   
14  
15return true; }   
16  
17//-->   
18</script>
19</head>
20<body>
21<br/><br/>   

username=session("username")
Set conn=server.createobject("adodb.connection")
Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath = "Data Source=" &amp; Server.MapPath( "webuser.mdb" )

conn.Open Provider &amp; DBPath

set rs=server.createobject("adodb.recordset")

sql="select id,fromname,toname,word,adddate,isread from talks where toname='"&amp; username &amp;"'and isread=0 order by adddate"

rs.open sql,conn,3,3
rs.pagesize=1
Page = CLng(Request("Page"))
If Page &lt; 1 Then Page = 1
If Page &gt; rs.PageCount Then Page = rs.PageCount

1  
2<form action="SubmitMessage.asp" method="post" name="form" onsubmit="return checks(form)">
3<table align="center" border="1" bordercolor="#111111" cellspacing="1" id="AutoNumber1" style="border-collapse: collapse" width="550">
4<tr>
5<td colspan="2" height="14" width="437"><b><font size="3">发送短消息</font></b></td>
6</tr>
7<tr>
8<td colspan="2" height="8" width="437">
9<table border="0" id="AutoNumber2" width="540">   

if rs.eof or rs.bof then

1<tr>
2<td width="100%">```
3 response.write"目前没有你的消息" 
4```</td>
5</tr>   

else

1<tr>
2<td width="100%">```
3 show rs,page
4```</td>
5</tr>
6<tr>
7<td width="100%">   

Sub Show( rs, Page )
rs.AbsolutePage = Page

1  
2<table border="0" cellpadding="0" cellspacing="0" width="534">   

For iPage = 1 To rs.PageSize

1<tr>
2<td colspan="2"><font color="red">```
3=rs("fromname")
4```</font>于```
5=rs("adddate")
6```传呼于你</td>
7</tr>
8<tr>
9<td colspan="2">   

word=replace(rs("word"),vbcrlf,"<br/>")
response.write word

 1</td>
 2</tr>
 3<tr>
 4<td width="82">回复对象</td>
 5<td width="452">
 6<input =rs("fromname")="" ```="" name="userid" readonly="" size="15" type="text" value="```"/>
 7</td>
 8</tr>
 9<tr>
10<td valign="top" width="82">回复信息</td>
11<td width="452">
12<textarea cols="40" name="word" rows="5"></textarea>
13</td>
14</tr>
15<tr>
16<td width="82"> </td>
17<td width="452">输入的汉字不要超过<font color="#FF0000">200</font>个汉字</td>
18</tr>   

sql="update talks set isread=-1 where id="&amp;rs("id")
conn.execute(sql)
rs.movenext
If rs.EOF Then Exit For
Next

1  
2</table>
3</td>
4</tr>
5<tr>
6<td width="100%">   

If Page &lt;&gt; rs.PageCount Then

1<a =(page+1)="" ```="" href="showmessage.asp?Page=```">下一条</a>   

End If

1</td>
2</tr>
3</table>   

end sub

 1</td>
 2</tr>
 3<tr>
 4<td align="center" colspan="2" width="444">
 5<input name="B1" type="submit" value="传呼"/>  <input name="B2" type="reset" value="重写"/>    
 6<input name="B3" onclick="Javascript:window.close()" type="button" value="关闭窗口"/>
 7</td>
 8</tr>
 9</table>
10</form>   

end if
rs.close
set rs=nothing
conn.close
set conn=nothing

1</body>
2</html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus