您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
网络寻呼机数据库版显示历史消息history.asp
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 13:57:08
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>历史消息</title>
<script language="JavaScript">
<!--



function CheckAll(form)  {
  for (var i=0;i<document.checkboxform1.length;i++)    {
    var e = document.checkboxform1[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked;
   }
  }
  
  // 检查是否选择了记录
function checkbox1(form)
{
    var theLength;
    var i,j;

    theLength = form.id.length;
    i = 0;
    j = 0;

    while(i<theLength){
        if (form.id[i].checked)
            j ++ ;
        i ++ ;
    }

    if (j==0 && !form.id.checked){
        alert("请先选择删除记录");
        return false ;
    }
    return true ;
}

// 单击“删除”按钮时触发
function del(form)
{
     if (!checkbox1(form)){
        return false;
    }
    else
        if (confirm('您确信要删除这些记录吗')){
        window.location.href="DeleteMessage.asp?page=<%=clng(page)%>"}
}
  -->
  </SCRIPT>
</head>

<body>
<br><br><%
set conn=server.createobject("adodb.connection")
    Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
    DBPath = "Data Source=" & Server.MapPath( "webuser.mdb" )

    conn.Open Provider & DBPath
    username=session("username")
    
    if username<>"" then
    sql="select * from talks where fromname='"& username & "'or toname='"& username & "' order by adddate desc"
    
    Set rs = Server.Createobject("ADODB.Recordset")
    
    rs.open sql,conn,3,3
    rs.pagesize=15
    Page = CLng(Request("Page"))
    If Page < 1 Then Page = 1
    If Page > rs.PageCount Then Page = rs.PageCount

%>

<table border="0" cellspacing="0"  width=590  cellpadding="0" align=center height="75">
  <tr>
    <td width="100%" height="24"><font size="2">查看我的历史消息(<b><font color="#FF0000">聊天记录仅保存一周内容,请自行备份</font></b>)</font></td>
  </tr>
  <% if rs.eof or rs.bof then %>
  <tr>
    <td width="100%" height="20"><font color="#FF0000">没有你的历史纪录,赶快和大家交流</font>!!!</td>
  </tr>
  <% else %>
  
  <tr>
    <td width="100%" align="center">
    <form action=history.asp name=f1>    
                  <% If Page <> 1 Then %>             
                      <a href=history.asp?Page=1> 第一页</A>          
                      <A HREF=history.asp?Page=<%=(Page-1)%>>上一页</A>             
                 <% End If             
                 If Page <> rs.PageCount Then  %>            
                      <A HREF=history.asp?Page=<%=(Page+1)%>>下一页</A>             
                      <A HREF=history.asp?Page=<%=rs.PageCount%>>最后一页</A>              
                 <% End if %>            
                      页次:<font COLOR="Red"><%=Page%>/<%=rs.PageCount%></font>       
                           <input type=text size=4 maxlength=4 name=page>    
            </form>
</td>
  </tr>
  <tr>
    <td  ><% show rs, Page %></td>
  </tr>
  <% end if %>
  <tr>
    <td width="100%" height="16">
    
    <%
   Sub show( rs, Page )
       rs.AbsolutePage =page              
       count=rs.pagesize              
%>
<FORM name="checkboxform1" onsubmit="return del(checkboxform1)" method=post action="DeleteMessage.asp?page=<%=clng(page)%>">
   <table border="0" cellspacing="0"  width="590" cellpadding="0" align=center>
      <%  
       do while not rs.eof and count>0                
      %>
    <tr bgcolor="#D8D3CD">
      <td height="20">&nbsp;<input type="checkbox" name="id" value="<%=rs("id")%>">&nbsp;<b><%=rs("fromname")%></b>&nbsp;于<%=rs("adddate")%>传呼&nbsp;<b><%=rs("toname")%></b></td></tr>
    <tr>
      <td height=22><%
       word=replace(rs("word"),vbcrlf,"<br>")  
       response.write word %>
      </td>
     </tr>
        <%
        count=count-1
        rs.movenext
        loop
        %>
     <tr>
       <td >
         <input type="checkbox" id="check1" name="chkall" value="on" onclick="CheckAll(this.form)"><label for="check1">点击复选框或汉字可全选全清</label> &nbsp;
         <input type="submit" value="删除选中的数据" name="shanchu"></td>
        </tr>
</table>
</form>
<% end sub  %>
    </td>
  </tr>
</table>
<%
sql="select adddate,id from talks"

set obj=conn.execute(sql)
if not obj.eof then
do whil

[1] [2] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |