📄 index_bbscontent.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-color: #B1DB99;
}
.STYLE5 {font-size: 14px}
-->
</style>
<!--#include file = "inc/conn.asp" -->
<!--#include file = "CheckLogin.asp" -->
<!--#include file = "inc/zhuru.asp" -->
<%
Dim strID
strID = Request.QueryString("ID")
If strID = "" Then
Response.Write("对不起,参数错误!")
Response.End
End If
%>
<%
Dim strType ,rs1 ,strSql1
Set rs1 = Server.CreateObject("ADODB.RecordSet")
strType = Request.QueryString("Type")
If strType = "Add" And strID <> "" Then
Dim strTitle ,strContent ,strPostTime ,strPoster , strLastUpdateTime , strLastUpdateUser
strTitle = Request.Form("Title")
strContent = Request.Form("Content")
strPostTime = Now()
strPoster = Session("UserName")
strLastUpdateTime = strPostTime
strLastUpdateUser = strPoster
strSql1 = "INSERT INTO BBS (Title,Content,PostTime,Poster,LastUpdateTime,LastUpdateUser,ParentID) Values('"& strTitle &"','"& strContent &"','"& strPostTime &"','"& strPoster &"','"& strLastUpdateTime &"','"& strLastUpdateUser &"',"& strID &")"
rs1.open strSql1,conn,3,1
Dim rs2
Set rs2 = Server.CreateObject("ADODB.RecordSet")
strSql = "UPDATE BBS SET LastUpdateUser = '"& strLastUpdateUser &"', LastUpdateTime = '"& strLastUpdateTime &"' WHERE ID = " & strID
rs1.open strSql,conn,3,1
End If
%>
<%
Dim rs ,strSql ,Num ,pageNum ,page ,loopNum
If Session("UserType") = "学生" Then
strSql = "SELECT * FROM BBS WHERE ParentID = "& strID &" OR ID = " & strID & " ORDER BY PostTime ASC"
ElseIf Session("UserType") = "教师" Then
strSql = "SELECT * FROM BBS WHERE ParentID = "& strID &" OR ID = " & strID & " ORDER BY PostTime ASC"
ElseIf Session("UserType") = "管理员" Then
strSql = "SELECT * FROM BBS WHERE ParentID = "& strID &" OR ID = " & strID & " ORDER BY PostTime ASC"
Else
Response.Write("对不起,您没有权限进入此页面!")
Response.End
End If
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open strSql,conn,1,1
If Not rs.EOF Then
%>
</head>
<%
If rs.recordcount > 0 Then
rs.pagesize = 14
Num = rs.recordcount
pageNum = rs.pagecount
page = Request.QueryString("page")
If page <> "" Then
page = Cint(page)
ElseIf page < 1 Then
page = 1
Else
page =1
End If
If page < 1 then
page =1
End If
If page*rs.pagesize >Num and Not ((page-1)*rs.pagesize <Num) Then
page = 1
End If
rs.absolutepage = page
If page <> pageNum Then
LoopNum = rs.pagesize
Else
LoopNum = Num - (page-1)*rs.pagesize
End If
%>
<body topmargin="5" leftmargin="5">
<table width="700">
<tr bgcolor="#66FF99">
<td colspan="3" background="images/Down_bg.gif" bgcolor="#00CC00"><div align="center">总共找到<%=Num%>条记录 <a href="index_bbsContent.asp?page=1">首页</a> <a href="index_bbsContent.asp?page=<%=page-1%>">上一页</a> <a href="index_bbsContent.asp?page=<%=page+1%>">下一页</a> <a href="index_bbsContent.asp?page=<%=pageNum%>">尾页</a> 页次:<%=page%>/<%=pagenum%> 共<%=pageNum%>页</div></td>
</tr>
<% For i = 1 to LoopNum %>
<tr bgcolor="#72C479">
<td width="102" bgcolor="#72C479">作者:<%=rs("Poster").value%></td>
<td width="521" >标题:<%=rs("Title").value%></td>
<%If Session("UserType") = "教师" Or Session("UserType") = "管理员" Then %> <td width="61" ><a href="DelBBS.asp?ID=<%=rs("ID").value%>&ParentID=<%=strID%>" onclick='return confirm("您确定要删除此信息吗?")'>删除</a></td><%End If%>
</tr>
<tr bgcolor="#FFFFFF">
<td width="102" bgcolor="#72C479"> </td>
<td colspan="2" bgcolor="#72C479" ><%=rs("Content").value%><Br>
<%If Session("UserName") <> rs("Poster").value Then %><div align="right"><a href="Add_Msg.asp?ManTo=<%=rs("Poster").value%>">给<%=rs("Poster").value%>发短信息</a></div><%End If%></td>
</tr>
<% rs.movenext
Next %>
<tr bgcolor="#66FF99">
<td colspan="3" background="images/Top_bg.gif" bgcolor="#00CC00"><div align="center">总共找到<%=Num%>条记录 <a href="index_bbsContent.asp?page=1">首页</a> <a href="index_bbsContent.asp?page=<%=page-1%>">上一页</a> <a href="index_bbsContent.asp?page=<%=page+1%>">下一页</a> <a href="index_bbsContent.asp?page=<%=pageNum%>">尾页</a> 页次:<%=page%>/<%=pagenum%> 共<%=pageNum%>页</div></td>
</tr>
</table>
<%
Else
Response.Write("记录为空!")
End If
Else
Response.Write("记录为空!")
End If
%>
<table width="378">
<form id="form1" name="form1" method="post" action="Index_BBSContent.asp?Type=Add&ID=<%=strID%>">
<tr bgcolor="#66C06D">
<td colspan="4" background="images/Down_bg.gif" bgcolor="#66C06D" ><div align="center">发表回复</div></td>
</tr>
<tr bgcolor="#66C06D">
<td width="67">标题:</td>
<td width="299" colspan="3"><input type="text" name="Title" /> </td>
</tr>
<tr bgcolor="#66C06D">
<td colspan="4"><textarea name="Content" cols="50" rows="6"></textarea> </td>
</tr>
<tr bgcolor="#66C06D">
<td colspan="4" align="center"><input name="Submit2" type="reset" value="清空" /> <input type="submit" name="Submit" value="提交" /></td>
</tr>
<tr >
<td colspan="4" background="images/Top_bg.gif" bgcolor="#00CC00"> </td>
</tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -