<?php
	require_once '../controller/CheckLoginState.php';
?>
<html>
<head>
<title>新闻信息登记</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/add_modify.css" rel="stylesheet" type="text/css" />
<script src="../js/util.js" language="JavaScript"></script>
<script src="../js/calendar.js"></script>
<script type="text/javascript">
        function CheckForm() {
            var re = /^[0-9]+.?[0-9]*$/;
            var resc=/^[1-9]+[0-9]*]*$/ ;
            var newsTitle = document.getElementById("newsTitle").value;
            if (newsTitle == "") {
                alert("请输入新闻标题...");
                document.getElementById("newsTitle").focus();
                return false;
            }

            var newsContent = document.getElementById("newsContent").value;
            if (newsContent == "") {
                alert("请输入新闻内容...");
                document.getElementById("newsContent").focus();
                return false;
            }

            var newsDate = document.getElementById("newsDate").value;
            if (newsDate == "") {
                alert("请输入发布日期...");
                document.getElementById("newsDate").focus();
                return false;
            }

            document.forms[0].submit();
       } 
    </script>
</head>
<body>
	<div id="container">
		<div id="title">
			<img src="../images/ADD.gif" />新闻信息录入 (带*号的为必填项)
		</div>
		<div id="content">
			<form method="post" name="newsAddForm"
				action="/controller/NewsAction.php?action=add"
				enctype="multipart/form-data">
				<br />
				<p>
					新闻标题: &nbsp;
					<input id="newsTitle" class="text" type="text" style="width: 500px" value="" name="news[newsTitle]" />
					<font color=red>*</font>
				</p>
				<p>
					新闻内容: &nbsp;
					<textarea name="news[newsContent]" id="newsContent" cols="80" rows="8"></textarea>
					<font color=red>*</font>
				</p>
				<p>

					发布日期:&nbsp; <input id="newsDate" type="text" class="text" readonly id="news[newsDate]" name="news[newsDate]" onclick="setDay(this);" />
					<font color=red>*</font>
				</p>
				<p>
					新闻图片:&nbsp; <input class="text" type="file" style="width: 200px" value="" name="newsPhoto" />
				</p>
				<p>
					<input type="button" style="cursor: hand;" class="btn" value="添加" onClick="CheckForm();" />
				</p>

			</form>
		</div>
	</div>
</body>
</html>
