<!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=UTF-8" />
<title>广告管理</title>
<link href="../css/admin_css.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div>
<table border="1" width="100%">
<?php
if ($action=='add' ||$action=='m') {
	$action=='add' ? $action_str= '?action=n_ins' :  $action_str= '?action=n_up&id='.$id ;
	print <<<EOT
	<tr align="center"><td>
<form action="$action_str" method="POST" enctype="multipart/form-data">
 	标题:<input type="text"  value="$n_title"  name="n_title" size="65" ></br>
 	内容:
 	<textarea name="n_content"  rows="10" cols="50">$n_content</textarea></br>
 	<input type="submit" value=" 完 成 " >
	</form>
	</td>
</tr>
	</table>
EOT;
}
else{
	print <<<EOT
	<tr>
<td colspan="5">
<a href="?action=add">发布新公告</a></td>
</tr>
<tr align="center">
<td width="5%"><b>I D</b></td>
<td width="55%"><b>标 题</b></td>
<td width="10%"><b>发布人</b></td>
<td width="20%"><b>发布时间</b></td>
<td><b>操作</b></td>
</tr>
EOT;

	while ($List =  sql_return($query,'FetchRow')){
		$n_id = $List['n_id'];
		$n_title = $List['n_title'];
		$n_content = $List['n_content'];
		$n_name = $List['u_name_2'];
		$n_uptimes = date('Y-m-d',$List['n_uptimes']);
		print <<<EOT
<tr>
<td>$n_id</td>
<td  align="left"><a href="?action=m&id=$n_id">$n_title</a></td>
<td>$n_name</td>
<td>$n_uptimes</td>
<td ><a href="?action=m&id=$n_id">修改</a>  <a href="?action=del&id=$n_id">删除</a></td>
</tr>
<tr>
<td colspan="5">$n_content</td>
</tr>
EOT;
}
print <<<EOT
</table>

EOT;
}
?>

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