📄 index.jsp
字号:
<%@ page import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="edu.yinhe.mis.vo.CardVO" />
<jsp:directive.page import="edu.yinhe.system.common.*"/>
<jsp:directive.page import="edu.yinhe.system.vo.*" />
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
int totals=0,pagescount=1,currentPage=0,rowperPage=0;
int liststep = 6;//最多显示分页页数
int listbegin = 0;//开始页
String action = "/yhsoft1/admins/paike/bbs/card.html?method=browseCard&";
if (request.getAttribute("totals")!=null) totals = Integer.parseInt(request.getAttribute("totals").toString());
if (request.getAttribute("totalPages")!=null) pagescount = Integer.parseInt(request.getAttribute("totalPages").toString());
if (request.getAttribute("pageNo")!=null) currentPage = Integer.parseInt(request.getAttribute("pageNo").toString());
if(request.getAttribute("rowperPage")!=null) rowperPage = Integer.parseInt(request.getAttribute("rowperPage").toString());
int listend;
int recordbegin;
int recordend;
%>
<script type="text/javascript">
function xiugai(){
document.all.formx.action
}
</script>
<html>
<head>
<title>BBS</title>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/general.css" type=text/css rel=stylesheet>
<LINK href="../css/main.css" type=text/css rel=stylesheet>
<SCRIPT src="<%=path%>/admins/js/transport.js" type=text/javascript></SCRIPT>
<SCRIPT src="<%=path%>/admins/js/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="<%=path%>/admins/js/utils.js" type=text/javascript></SCRIPT>
<SCRIPT src="<%=path%>/admins/js/listtable.js" type=text/javascript></SCRIPT>
<SCRIPT src="<%=path%>/admins/js/login.js" type=text/javascript></SCRIPT>
</head>
<body>
<div id="closeshow" style="display: none;">
<div id="closewindow">
<div class="msg_block">
<iframe id="login_frame" name="login_frame" src="" frameborder="0"
marginheight="0" marginwidth="0" scrolling="no"
allowTransparency="true"></iframe>
</div>
</div>
<div id="graydiv"></div>
</div>
<h1><br>
<span></span></h1><h1><span>银河学院 - BBS</span>
</h1>
<DIV class=form-bbs>
<%
LoginVO voo=(LoginVO)session.getAttribute(GlobalNames.SESSION_ID);
%><%if(voo.getAccount()!=null){%><%=voo.getAccount()%><%} %><%else{%>游客<%}%> | 我的 | 帮助
</DIV>
<font style="font-weight:bold">银河学院BBS</font> >> (各级名)<br>
<p>版主:(版主名)</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<DIV class="form-page">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<td align="center">总帖数:<%= totals%></td>
<%
//得到本页的参数内容
if (pagescount < currentPage) {
currentPage = pagescount;//如果分页变量大总页数,则将分页变量设计为总页数
}
if (currentPage < 1) {
currentPage = 1;//如果分页变量小于1,则将分页变量设为1
}
listbegin = (currentPage - (int) Math.ceil((double) liststep / 2));//从第几页开始显示分页信息
if (listbegin < 1) {
listbegin = 1;
}
listend = currentPage + liststep/2;//分页信息显示到第几页
if (listend > pagescount) {
listend = pagescount + 1;
}
//显示数据部分
recordbegin = (currentPage - 1) * rowperPage;//起始记录
recordend = 0;
recordend = recordbegin + rowperPage;
//最后一页记录显示处理
if (currentPage == pagescount) {
recordend = (int) (recordbegin + rowperPage * (totals % rowperPage) * 1);
}
if (currentPage > 1) {
%><a href=/yhsoft1/admins/bbs/card.html?method=browseCard¤tPage=<%=currentPage- 1%> ><<<</a>
<% }
for (int i = listbegin; i < listend; i++){
if (i != currentPage) {//如果i不等于当前页
%>
<a href=/yhsoft1/admins/bbs/card.html?method=browseCard¤tPage=<%=i%>><%=i%></a>
<% } else { %>
<%=i%>
<% }
} if (currentPage != pagescount) {%>
<a href=/yhsoft1/admins/bbs/card.html?method=browseCard¤tPage=<%=currentPage+ 1 %> >>>></a>
<%}
%>
</table>
</DIV>
</td>
<td align="right"><a href="<%=basePath%>admins/bbs/NewCard.jsp"><img src="../images/newstips.gif"></a></td>
</tr>
</table>
<form name="formx" action="" method="post">
<DIV class=list-div id=listDiv>
<TABLE cellSpacing=1 cellPadding=3>
<TBODY>
<TR>
<TH width="50%">标题</TH>
<TH width="15%">作者</TH>
<TH width="12%">回复</TH>
<TH width="23%">最近回复</TH>
<TH>删除</TH>
<TH>修改</TH>
</TR>
<%
ArrayList list = new ArrayList();
CardVO vo = null;
list = (ArrayList) request.getAttribute("list");
for (Iterator it = list.iterator(); it.hasNext();){
vo = (CardVO) it.next();
%>
<TR onclick="">
<TD><a href="<%=basePath%>admins/bbs/card.html?method=viewCard&id=<%=vo.getID()%>" ><%if(vo.getLEVEL()==1){%><img src="../images/jing.gif" border="0"><%}%><%else if(vo.getLEVEL()==2){%><img src="../images/ding.gif" border="0"><%}%><%else if(vo.getLEVEL()==3){%><img src="../images/tui.gif" border="0"><%}%><%=vo.getCARD_TITLE()%></a></TD>
<TD align="center"><%if(vo.getSENDCARDER()==null){%>无名氏<%} %><%else{%><%=vo.getSENDCARDER()%><%} %></TD>
<TD align="center"><%=vo.getCount() %></TD>
<TD align="center">最后发表人:<%if(vo.getREVERTER()!=null){%><%=vo.getREVERTER()%><%} %><br>发表时间:<%if(vo.getLastdate()!=null){%><%=vo.getLastdate() %><%} %></TD>
<TD onclick=""><a href="<%=basePath%>admins/bbs/card.html?method=deleteCard&id=<%=vo.getID()%>" onclick="JavaScript:return confirm('您确删除此贴吗?')">删除</a></TD>
<TD><select id="jibie" name="level" onchange="update(this)"><option>--修改帖子级别--</option><option value="1_<%=vo.getID()%>">精华帖</option><option value="2_<%=vo.getID()%>" >置顶</option><option value="3_<%=vo.getID()%>" >推荐帖</option><option value="0_<%=vo.getID()%>" >取消</option></select></TD>
</TR>
<%
}
%>
</TBODY>
</TABLE>
</DIV>
</form>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right">
<DIV class="form-page">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">总帖数:<%= totals%></td><tr>
<%
//得到本页的参数内容
if (pagescount < currentPage) {
currentPage = pagescount;//如果分页变量大总页数,则将分页变量设计为总页数
}
if (currentPage < 1) {
currentPage = 1;//如果分页变量小于1,则将分页变量设为1
}
listbegin = (currentPage - (int) Math.ceil((double) liststep / 2));//从第几页开始显示分页信息
if (listbegin < 1) {
listbegin = 1;
}
listend = currentPage + liststep/2;//分页信息显示到第几页
if (listend > pagescount) {
listend = pagescount + 1;
}
//显示数据部分
recordbegin = (currentPage - 1) * rowperPage;//起始记录
recordend = 0;
recordend = recordbegin + rowperPage;
//最后一页记录显示处理
if (currentPage == pagescount) {
recordend = (int) (recordbegin + rowperPage * (totals % rowperPage) * 1);
}
if (currentPage > 1) {
%><a href=/yhsoft1/admins/bbs/card.html?method=browseCard¤tPage=<%=currentPage- 1%> ><<<</a>
<% }
for (int i = listbegin; i < listend; i++){
if (i != currentPage) {//如果i不等于当前页
%>
<a href=/yhsoft1/admins/bbs/card.html?method=browseCard¤tPage=<%=i%>><%=i%></a>
<% } else { %>
<%=i%>
<% }
}
if (currentPage != pagescount) {%>
<a href=/yhsoft1/admins/bbs/card.html?method=browseCard¤tPage=<%=currentPage+ 1 %> >>>></a>
<%}
%>
</tr>
</table>
</DIV>
</td>
</tr>
</table>
<DIV id=footer>
<BR>
版权所有 ©2005-2007 湖北银河软件开发有限公司,并保留所有权利。
</DIV>
<SCRIPT language=JavaScript>
if (Browser.isIE)
{
onscroll = function()
{
//document.getElementById('calculator').style.top = document.body.scrollTop;
document.getElementById('popMsg').style.top = (document.body.scrollTop + document.body.clientHeight - document.getElementById('popMsg').offsetHeight) + "px";
}
}
if (document.getElementById("listDiv"))
{
document.getElementById("listDiv").onmouseover = function(e)
{
obj = Utils.srcElement(e);
if (obj)
{
if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
else return;
for (i = 0; i < row.cells.length; i++)
{
if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#F4FAFB';
}
}
}
document.getElementById("listDiv").onmouseout = function(e)
{
obj = Utils.srcElement(e);
if (obj)
{
if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
else return;
for (i = 0; i < row.cells.length; i++)
{
if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
}
}
}
document.getElementById("listDiv").onclick = function(e)
{
var obj = Utils.srcElement(e);
if (obj.tagName == "INPUT" && obj.type == "checkbox")
{
if (!document.forms['listForm'])
{
return;
}
var nodes = document.forms['listForm'].elements;
var checked = false;
for (i = 0; i < nodes.length; i++)
{
if (nodes[i].checked)
{
checked = true;
break;
}
}
document.getElementById("btnSubmit").disabled = !checked;
for (i = 1; i <= 10; i++)
{
if (document.getElementById("btnSubmit" + i))
{
document.getElementById("btnSubmit" + i).disabled = !checked;
}
}
}
}
}
var xmlHttp;
function creatXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest){
xmlHttp =new XMLHttpRequest();
}
}
function update(obj){
var selected=obj.value;
creatXMLHttpRequest();
xmlHttp.open("GET","<%=path%>/admins/bbs/card.html?method=updateCard&selected="+selected,true);
xmlHttp.send(null);
}
</SCRIPT>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -