<%@ page language="java" contentType="text/html; charset=GB2312"
	pageEncoding="GB2312"%>
<%@ page import="com.wxpn.tutorial.servlet.News"%>
<%if (session.getAttribute("userName") == null) {
				response.sendRedirect("login.jsp");
			}%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title>新闻-阅读</title>
<script language="JavaScript"><!--
function validateCompose(){ 
	var MB_TITLE = document.frmCompose.MB_TITLE.value;
	var MB_CONTENT = document.frmCompose.MB_CONTENT.value;
	if (MB_TITLE ==""){
		alert("必须填写标题！");
		return false;
	}
	if (MB_CONTENT ==""){
		alert("必须填写内容！");
	return false;
	}
	return true;
}
-->
</script>
</head>
<body>
<div align=center><%if (request.getAttribute("msg") == null) {

			%> 还没有任何新闻。 <%} else {
				News msg = (News) request.getAttribute("msg");

				%>
<form name="frmCompose" method="POST"
	action="UpdateNewsServlet"
	onSubmit="javaScript:return validateCompose();"><br>
<table border="1" width="75%" cellspacing="0" cellpadding="0"
	bordercolorlight="#000000" bordercolordark="#FFFFFF">
	<tr>
		<td width="75%" colspan=2 bgcolor="#0000FF" height="35" align=center><b><font
			color="#FFFFFF">修改新闻</font></b></td>
	</tr>

	<tr>
		<td bgcolor="#FCFCFC" width="20%" valign="top"></td>
		<td bgcolor="#FCFCFC" width="80%"></td>
	</tr>
	<tr>
		<td align=center bgcolor="#FCFCFC">作者：&nbsp;</td>
		<td align=left bgcolor="#FCFCFC"><%=msg.getAuthor()%> &nbsp;&nbsp;&nbsp;发表于<%=msg.getStrCompose_date()%></td>
	</tr>
	<tr>
		<td bgcolor="#FCFCFC" align=center>标题：&nbsp;</td>
		<td bgcolor="#FCFCFC" align=left><input type="text" name="MB_TITLE"
			value="<%=msg.getTitle()%>"></td>
	</tr>
	<tr>
		<td align=center bgcolor="#FCFCFC">内容：&nbsp;</td>
		<td align=left bgcolor="#FCFCFC"><textarea rows="8" name="MB_CONTENT"
			cols="34"><%=msg.getContent()%></textarea></td>
	</tr>
	<tr>
		<td align=center bgcolor="#FCFCFC">更新发布时间：&nbsp;</td>
		<td align=left bgcolor="#FCFCFC"><input type="radio" value="true"
			name="newtime">是<input type="radio" value="newtime" name="false">否</td>
	</tr>
	<tr>
		<td width="100%" align=center colspan="2" height="50"><input
			type="hidden" name="id" value="<%=msg.getId()%>"> <input
			type="submit" value="提交" name="submit">&nbsp;&nbsp; <input
			type="reset" value="重置" name="reset"></td>
	</tr>
	<%}

		%>
</table>
</form>
</div>
</body>
</html>
