function delete1(url)
{
if (confirm('确定需要删除吗?'))
{
window.location.href = url;
}
}
function initOpenWindow(x, y)
{
if (opener != null)
{
self.moveTo(screen.width / 2 - x / 2, screen.height / 2 - y / 2);
self.resizeTo(x, y);
}
}
function oneMoreCheck(checkField)
{
var len = 0;
//选种个数
if (checkField != null)
{
for (i = 0; checkField.length != null && i < checkField.length; i++)
{
if (checkField[i].checked)
{
len++;
}
}
if (len == 0 && checkField.checked)
{
len++;
}
}
if (len == 0)
{
alert("没有选中任何记录!");
return false;
}
return true;
}
function oneCheck(checkField)
{
var len = 0;
//选种个数
if (checkField != null)
{
for (i = 0; checkField.length != null && i < checkField.length; i++)
{
if (checkField[i].checked)
{
len++;
}
}
if (len == 0 && checkField.checked)
{
len++;
}
}
if (len != 1)
{
alert("确认选中了一条记录!");
return false;
}
return true;
}
function checkAll(checkField)
{
if (checkField != null)
{
if (checkField.length == null)
{
checkField.checked = true;
}
for (i = 0; checkField.length != null && i < checkField.length; i++)
{
checkField[i].checked = true;
}
}
}
function unCheckAll(checkField)
{
if (checkField != null)
{
if (checkField.length == null)
{
checkField.checked = false;
}
for (i = 0; checkField.length != null && i < checkField.length; i++)
{
checkField[i].checked = false;
}
}
}
function checkOrNot(checkField, isChecked)
{
if (isChecked)
{
checkAll(checkField);
}
else
{
unCheckAll(checkField);
}
}
-----------------newsList---------------------------
--------------------------------------------
--------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Pavilionhotel.com Website Console</title>
<LINK REL="SHORTCUT ICON" HREF="/favicon.ico">
<LINK HREF="../include/default.css" REL="stylesheet" TYPE="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="${req.getContextPath()}/script/util.js"></script>
<script>
function deleteList()
{
if (oneMoreCheck(document.aform.newsIds) && confirm("确认要删除?"))
{
document.aform.action = "news!delete.action";
document.aform.target = "aniframe";
document.aform.method = "get";
document.aform.submit();
}
}
function publishList()
{
if (oneMoreCheck(document.aform.newsIds))
{
document.aform.action = "news!publish.action";
document.aform.target = "aniframe";
document.aform.method = "get";
document.aform.submit();
}
}
function stopList()
{
if (oneMoreCheck(document.aform.newsIds))
{
document.aform.action = "news!stop.action";
document.aform.target = "aniframe";
document.aform.method = "get";
document.aform.submit();
}
}
function refresh()
{
document.aform.action = "news!list.action";
document.aform.target = "_self";
document.aform.method = "get";
document.aform.submit();
}
function copyAll(t)
{
t.execCommand("Copy");
}
</script>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="5%" height="5"><img src="../images/clear.gif" height="1" width="1" alt=" " hspace="7"></td>
<td width="90%"><img src="../images/clear.gif" height="1" width="1" hspace="270" alt=" "><br></td>
<td width="5%"><img src="../images/clear.gif" height="1" width="1" alt=" " hspace="7"></td>
</tr>
<tr valign="top">
<td width="20" nowrap><br></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td height="4"></td></tr>
<tr><td><b class="h3">提示<br></b></td></tr>
<tr><td height="4"></td></tr>
<tr class="color-rule"><td height="1" colspan="2"><img src="../images/clear.gif" height="1" width="1" alt=" "></td></tr>
<tr><td height="6"></td></tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="95%">
<p class="text-medium">
下表是最新发布的文章<br>
</p>
</td>
<td width="5%"> </td>
</tr>
<tr><td height="10" colspan="2"></td></tr>
</table>
<FORM NAME="aform" ACTION="news!list.action" METHOD="post">
<input type="hidden" name="newsTypeId" value="$!{newsTypeId}"/>
<input type="hidden" name="page.pageNo" value="${page.pageNo}"/>
<input type="hidden" name="page.pageSize" value="${page.pageSize}"/>
<input type="hidden" name="page.totalPage" value="${page.totalPage}"/>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="color-tabletrim"><tr><td>
<TABLE border="0" cellpadding="0" cellspacing="1" width="100%" class="color-tabletrim">
<tbody>
<TR class="color-formbacking"><TD>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="color-tabletrim"><tr><td>
<table border="0" cellpadding="2" cellspacing="1" width="100%" class="color-tabletrim"><thead><tr class="color-tableheader"><td height="20" colspan="7" width="100%" background="../images/dialogtop.gif"><strong class="titlerev"> 文章搜索器</strong></td></tr></thead>
<tr scope="row" class="c"><td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td nowrap><font class="datasheetField">关键字</font>
<input name="keyword" type="text" value="$!{keyword}"/>
</td>
<td width="10"><font class="datasheetField"> </font></td>
<td nowrap><font class="datasheetField">开始日期</font>
<input type="text" name="sDate" size="15" value="#formatDate($!{sDate})"/>
</td>
<td width="10"><font class="datasheetField"> </font></td>
<td nowrap><font class="datasheetField">结束日期</font>
<input type="text" name="eDate" size="15" value="#formatDate($!{eDate})"/>
</td>
<td width="100%"><font class="datasheetField"> </font></td>
</tr>
</table>
</td></tr>
</table>
</TD></TR>
</table>
</TD></TR></tbody>
<tfoot><TR><TD class="color-buttonbacking" height="30" nowrap>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td><font class="datasheetField"> </font></td>
<td width="10"><INPUT TYPE="submit" class="button" value="查找"></td>
<td width="10"> </td>
<td><img src="../images/clear.gif" height="1" width="1" hspace="150" alt=" "></td>
</tr></table>
</TD></TR></tfoot>
</TABLE>
</td></tr></table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td height="17"></td></tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="color-tabletrim"><tr><td>
<TABLE border="0" cellpadding="0" cellspacing="1" width="100%" class="color-tabletrim">
<tbody><TR class="color-formbacking"><TD>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="color-tabletrim"><tr><td>
<table border="0" cellpadding="2" cellspacing="1" width="100%" class="color-tabletrim"><thead><tr class="color-tableheader"><td height="20" colspan="7" width="100%" background="../images/dialogtop.gif"><strong class="titlerev"> 文章列表</strong></td></tr></thead>
<tr class="color-columnheaders">
<th scope="col" height="20" nowrap><font class="datasheetField"><input type="checkbox" οnclick="checkOrNot(document.aform.newsIds,this.checked)"></font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 标题 </font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 状态 </font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 编撰人 </font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 发布人 </font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 创建时间 </font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 发布时间 </font></th>
<th scope="col" height="20" nowrap><font class="datasheetField"> 前台链接 </font></th>
</tr>
#foreach($news in $!{page.pageList})
<tr scope="row" class="c">
<td height="20" width="10" nowrap><font class="datasheetField"><input name="newsIds" type="checkbox" value="$!{news.id}"></font></td>
<td height="20" width="250" nowrap><font class="datasheetField">
<a href="news!edit.action?news.id=$!{news.id}&newsTypeId=$!{news.newsType.id}">$!{news.title}</a>
</font></td>
<td height="20" nowrap><font class="datasheetField">
#if($!{news.state} == 1)
√
#else
×
#end
</font></td>
<td height="20" nowrap><font class="datasheetField">$!{news.editPerson}</font></td>
<td height="20" nowrap><font class="datasheetField">$!{news.publishPerson}</font></td>
<td height="20" nowrap><font class="datasheetField">${dateUtil.format($!{news.createTime}, "yyyy-MM-dd")}</font></td>
<td height="20" nowrap><font class="datasheetField">$!{news.publishDate}</font></td>
<td height="20" nowrap><font class="datasheetField"><a href="$req.getContextPath()/front/article.action?newsId=${news.id}" target="_blank">前台预览</a></font></td>
</tr>
#end
</table></td></tr>
</table>
</TD></TR>
</tbody>
<tfoot>
<TR><TD class="color-buttonbacking" height="30" nowrap>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td><font class="datasheetField"> </font></td>
<td width="10"><INPUT TYPE="button" class="button" value="新增" οnclick="document.location.href='news!edit.action?newsTypeId=$!{newsTypeId}'"></td>
<td width="10"> </td>
<td width="10"><INPUT TYPE="button" class="button" value="发布" οnclick="publishList()"></td>
<td width="10"> </td>
<td width="10"><INPUT TYPE="button" class="button" value="禁止" οnclick="stopList()"></td>
<td width="10"> </td>
<td width="10"><INPUT TYPE="button" class="button" value="删除" οnclick="deleteList()"></td>
<td width="10"> </td>
<td nowrap align="right"><font class="datasheetField">
(共$!{page.totalPage}页)
<a href="#" οnclick="javascript:firstPage(document.aform,document.aform.elements['page.pageNo'])">首页</a>
<a href="#" οnclick="javascript:prePage(document.aform,document.aform.elements['page.pageNo'])">上一页</a>
<a href="#" οnclick="javascript:nextPage(document.aform,document.aform.elements['page.pageNo'],document.aform.elements['page.totalPage'])">下一页</a>
<a href="#" οnclick="javascript:lastPage(document.aform,document.aform.elements['page.pageNo'],document.aform.elements['page.totalPage'].value)">末页</a>
</font>
</td>
</tr></table>
</TD></TR>
</tfoot>
</TABLE>
</td></tr></table>
</FORM>
</td>
<td><br></td>
</tr>
</table><br>
<br>
<br>
<iframe name="aniframe" style="display:none"/>
</body>
</html>
---------------------------------newsEdit------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Pavilionhotel.com Website Console</title>
<LINK REL="SHORTCUT ICON" HREF="/favicon.ico">
<LINK HREF="../include/default.css" REL="stylesheet" TYPE="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../include/FCKeditor/fckeditor.js">
</script>
<script src="${req.getContextPath()}/script/util.js"></script>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="5%" height="5"><img src="../images/clear.gif" height="1" width="1" alt=" " hspace="7"></td>
<td width="90%"><img src="../images/clear.gif" height="1" width="1" hspace="270" alt=" "><br></td>
<td width="5%"><img src="../images/clear.gif" height="1" width="1" alt=" " hspace="7"></td>
</tr>
<tr valign="top">
<td width="20" nowrap><br></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td height="4"></td></tr>
<tr><td><b class="h3">提示<br></b></td></tr>
<tr><td height="4"></td></tr>
<tr class="color-rule"><td height="1" colspan="2"><img src="../images/clear.gif" height="1" width="1" alt=" "></td></tr>
<tr><td height="6"></td></tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="95%">
<p class="text-medium">
在这里维护文章信息,编辑完文章信息后,请选择"保存"按钮提交表单<br>
</p>
</td>
<td width="5%"> </td>
</tr>
<tr><td height="10" colspan="2"></td></tr>
</table>
<FORM NAME="aform" ACTION="newsSave.action" METHOD="post" οnsubmit="return validForm(this)">
<input type="hidden" name="newsId" value="$!{news.id}"/>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="color-tabletrim"><tr><td>
<TABLE border="0" cellpadding="0" cellspacing="1" width="100%" class="color-tabletrim">
<tbody><TR class="color-formbacking"><TD>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="color-tabletrim"><tr><td>
<table border="0" cellpadding="2" cellspacing="1" width="100%" class="color-tabletrim"><thead><tr class="color-tableheader"><td height="20" colspan="7" width="100%" background="../images/dialogtop.gif"><strong class="titlerev"> 文章编辑器</strong></td></tr></thead>
<tr class="color-columnheaders"><td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td nowrap><font class="datasheetField"> 标题: </font></td>
<td width="100%">
<input name="news.title" type="text" size="65" validate="string" required="true" message="请输入文章标题!" value="$!{news.title}"/>
<input type="checkbox" name="news.first" value="true" #if($!{news.first}) checked #end />
<font class="datasheetField">置顶</font></td>
</tr>
<tr>
<td nowrap><font class="datasheetField"> 类型: </font></td>
<td width="100%">
<select name="news.newsType.id">
#foreach($newsType in $newsTypes)
<option value="$!{newsType.id}" #if ($!{newsType.id} == $!{newsTypeId}) selected #end>$!{newsType.name}</option>
#end
</select>
</td></tr>
<tr>
<td nowrap><font class="datasheetField"> 内容: </font></td>
<td width="100%"></td>
</tr>
<tr>
<td nowrap><font class="datasheetField"> </font></td>
<td width="100%"><textarea name="news.content" cols="120" rows="30">$!{news.content}</textarea></td>
</tr>
<script language="javascript1.2">
var oFCKeditor = new FCKeditor( 'news.content' ) ;
oFCKeditor.BasePath = '../include/FCKeditor/' ;
oFCKeditor.Height = 400 ;
oFCKeditor.ReplaceTextarea() ;
</script>
</table>
</td></tr>
</table></td></tr>
</table>
</TD></TR></tbody>
<tfoot><TR><TD class="color-buttonbacking" height="30" nowrap>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td><font class="datasheetField"> </font></td>
<td width="10"><INPUT TYPE="submit" class="button" value="保存"></td>
<td width="10"> </td>
<td width="10"><INPUT TYPE="button" class="button" value="返回列表" οnclick="document.location.href='news!list.action'"></td>
<td width="10"> </td>
<td><img src="../images/clear.gif" height="1" width="1" hspace="150" alt=" "></td>
</tr></table>
</TD></TR></tfoot>
</TABLE>
</td></tr></table>
</FORM>
</td>
<td><br></td>
</tr>
</table><br>
<br>
<br>
</body>
</html>