<html><hand>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=<?php echo CHARSET;?>">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta HTTP-EQUIV="Content-Language" CONTENT="<?php echo CHARSET;?>">
<script language='JavaScript' src='admin/img/admin.js'></script>
<link href="admin/img/style.css" rel="stylesheet" type="text/css">
<?php 
if(!defined('IN_ADMIN')) exit('Access Denied');
switch ($action){
	case 'add':
?>
<table width='100%' cellpadding=3 cellspacing=1 class=td1>
<form name='myform' method='post' Action='<?=SCRIPT_NAME;?>?file=news&action=add'>
<tr class=td4><td colspan=2><strong>添加新闻</strong></td></tr>
<tr class=td2><td width='10%'><strong>标题</strong></td>
<td width='90%'><input name=info[title] maxlength=40 value="" style='height:18px;width:150px'> 最长40个字</td></tr>
<tr class=td2><td width='10%'><strong>新闻分类</strong></td>
<td width='90%'>
<select name="info[ssfl]">
<?php if(is_array($fl) && !empty($fl)){
		foreach ($fl as $v) {
		echo '<option value='.$v["id"].'>'.$v["title"].'</option>';
 }
}?>
 </select></td></tr>
<tr class=td2><td width='10%'><strong>作者</strong></td>
<td width='90%'><input name=info[zz] maxlength=20 value="讯腾网络" style='height:18px;width:150px'></td></tr>
<tr class=td2><td width='10%'><strong>来源</strong></td>
<td width='90%'><input name=info[ly] maxlength=20 value="讯腾网络" style='height:18px;width:150px'></td></tr>
<tr class=td2><td><strong>内容</strong></td>
<td><?php $editor->Create();?></td></tr>
<tr class=td2><td></td>
<td><input type=submit value=' 提 交 ' name='dosubmit'></td></tr>
</form>
</table>
<?php 	
	break;
	case 'list':
	?>
<table width='100%' cellpadding=2 cellspacing=1 border=0 align=center class=td1>
<form method='post' Action='<?=SCRIPT_NAME;?>?file=news&action=del'>
<tr Class=td4><td colspan='8'><b>新闻管理</b></td></tr>
<tr align=center Class=td3><td width='3%'></td>
<td width=*>新闻标题</td>
<td width='15%'>分类</td>
<td width='15%'>时间</td>
<td width='4%'>作者</td>
<td width='4%'>查看</td>
<td width='10%'>操作</td></tr>
<?php 
if(is_array($n) && !empty($n)){
	foreach($n as $ns){ 
	?>
<tr align=center class=td2 onMouseMove="this.className='td3'" onMouseOut="this.className='td2'">
<td><?=$ns['id']?></td>
<td><?=$ns['title']?></td>
<td><?php echo $news->gettype($ns['ssfl']);?></td>
<td><?=date('Y-m-d',$ns['time'])?></td>
<td><?=$ns['zz']?></td>
<td><?=$ns['hist']?>次</td>
<td><span class=Font5><a href="?file=news&action=edit&id=<?=$ns['id']?>">修改</a> | <a href="?file=news&action=del&id=<?=$ns['id']?>">删除</a></span></td>
</tr>
<?php }}?>

</table>
<table width='100%' border=0 cellspacing=0 cellpadding=5 style='border-top:1px #C4D8ED solid'><tr><td align=center class=td2><?=$dispage;?></td></tr></table>

<?php 	
	break;
	case 'edit':
	?>
	<table width='100%' cellpadding=3 cellspacing=1 class=td1>
<form name='myform' method='post' Action='<?=SCRIPT_NAME;?>?file=news&action=edit'>
<input type="hidden" name=id value=<?=$ns['id']?>>
<tr class=td4><td colspan=2><strong>修改新闻</strong></td></tr>
<tr class=td2><td width='10%'><strong>标题</strong></td>
<td width='90%'><input name=info[title] maxlength=40 value="<?=$ns['title'];?>" style='height:18px;width:150px'> 最长40个字</td></tr>
<tr class=td2><td width='10%'><strong>新闻分类</strong></td>
<td width='90%'>
<select name="info[ssfl]">

<?php if(is_array($fl) && !empty($fl)){

		foreach ($fl as $v) {
		if($ns['ssfl'] == $v["id"]){
			echo '<option value='.$v["id"].' selected>'.$v["title"].'</option>';
		}else{
			echo '<option value='.$v["id"].'>'.$v["title"].'</option>';
		}
		
 }
}?>
 </select></td></tr>
<tr class=td2><td width='10%'><strong>作者</strong></td>
<td width='90%'><input name=info[zz] maxlength=20 value="<?=$ns['zz'];?>" style='height:18px;width:150px'></td></tr>
<tr class=td2><td width='10%'><strong>来源</strong></td>
<td width='90%'><input name=info[ly] maxlength=20 value="<?=$ns['ly'];?>" style='height:18px;width:150px'></td></tr>
<tr class=td2><td><strong>内容</strong></td>
<td><?php $editor->Create();?></td></tr>
<tr class=td2><td></td>
<td><input type=submit value=' 提 交 ' name='dosubmit'></td></tr>
</form>
</table>
	<?php 
	break;
}
?>