<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
	if(!$module->roleid_check('yp',$_roleid))showmsg_nourl($lang['RETURN_NOPRI']);
?>
<!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>
<title>新闻管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/template/js/admin.js"></script>
<script language="javascript" src="admin/template/js/css.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">新闻管理</a></li>
			<?php if($ypid){?><li><a href="?file=yp&mod=yp&action=news_add&ypid=<?php echo $ypid;?>">添加新闻</a></li><?php }?>
		</ul>
	</div>
	<div class="main">
		<div class="search">
			<form action="?" method="get" name="search">
			<input type="hidden" name="mod" value="<?php echo isset($mod)?$mod:'yp';?>"> 
			<input type="hidden" name="ypid" value="<?php echo $ypid;?>"> 
			<input type="hidden" name="file" value="<?php echo isset($file)?$file:'yp';?>"> 
			<input type="hidden" name="action" value="<?php echo isset($action)?$action:'news';?>"> 
				<fieldset>
					<legend>搜索新闻</legend>
						新闻标题：
						<input type="text" name="k" size="35" value="<?php echo isset($k) && !empty($k)?htmlspecialchars(stripslashes($k)):'';?>" />
						<input type="submit" class="button" value="开始查找" />
				</fieldset>
			</form>
		</div>
		<table cellspacing="0" class="datalist" id="list" width="98%">
		<tr>			
			<th width="5%" class="firstcol">反选</th>
			<th width="29%">标题</th>
			<th width="24%">黄页名称</th>
			<th width="16%">发布时间</th>
			<th width="11%">点击率</th>
			<th width="15%">管理</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<?php if($result){foreach($result as $val){?>
		<tr>
		  <td width="5%" align="center"><input type="checkbox" checked="checked" name="id[]" value="<?php echo $val['id'];?>" class="checkbox" /></td>
		  <td width="29%" align="center"><a href="yp/web/shownews.php?id=<?php echo $val['id'];?>" target="_blank"><?php echo $val['title'];?></a></td>
		  <td width="24%" align="center"><a href="<?php echo $val['ypurl'];?>" title="<?php echo $val['ypname'];?>" target="_blank"><?php echo $val['ypname'];?></a></td>
			<td width="16%" align="center"><?php echo date('Y-m-d H:i:s',$val['inputtime']);?></td>
			<td width="11%" align="center"><?php echo $val['clicks'];?>次</td>
			<td width="15%" align="center"><a href="?mod=yp&file=yp&action=news_edit&id=<?php echo $val['id'];?>"><u>编辑</u></a></td>
		</tr>
		<?php }?>
		<tr>
			<td align="center"><input type="checkbox" name="chkall2" value="1" checked="checked" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="5">
			<input type="button" onclick="if(confirm('确实要删除所选信息?'))this.form.submit();" class="submit" value="批量删除" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="6">目前尚未发布任何新闻...</td></tr>	
		<?php }?>
		<tr><td colspan="6"><?php echo $yp->pagestring;?></td></tr>
		</table>
	</div>
</div>
</body>
</html>