<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!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=gb2312" />
<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">
	$(document).ready(function(){
		$('#timeid').val(<?php echo intval((time()-$timeid)/(3600*24));?>);
	});
</script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" <?php echo !isset($status) || $status?'class="on"':'';?>>企业新闻</a></li>
			<li><a href="?file=yellowpages&action=news&status=0" <?php echo isset($status) && $status==0?'class="on"':'';?>>待审新闻</a></li>	
		</ul>
	</div>
	<div class="main">
		<div class="search">
			<form action="?" method="get" name="search">
			<input type="hidden" name="file" value="<?php echo $file;?>"> 
			<input type="hidden" name="action" value="<?php echo $action;?>">
				<fieldset>
					<legend>搜索留言</legend>
						<input name='status' type='radio' class="radio" value='1' onclick="location='?file=<?php echo $file;?>&action=<?php echo $action;?>&status=1'"  <?php echo $status==1?'checked':'';?>><a href='?file=<?php echo $file;?>&action=<?php echo $action;?>&status=1'>已审核</a>
						&nbsp;
						<input name='status' type='radio' class="radio" value='0' onclick="location='?file=<?php echo $file;?>&action=<?php echo $action;?>&status=0'" <?php echo $status=='0'?'checked':'';?>><a href='?file=<?php echo $file;?>&action=<?php echo $action;?>&status=0'>未审核</a>
						&nbsp;						
						<select name="timeid" id="timeid">
							<option value="0">时间段</option>
							<option value="1" >1 天内</option>
							<option value="2" >2 天内</option>
							<option value="3" >3 天内</option>
							<option value="7" >1 周内</option>
							<option value="14" >2 周内</option>
							<option value="30" >1 月内</option>
							<option value="60" >2 月内</option>
							<option value="90" >3 月内</option>
							<option value="180" >6 月内</option>
							<option value="365" >1 年内</option>
						</select>
						关键字：
						<input type="text" name="k" size="35" value="<?php echo $k?htmlspecialchars(stripslashes($k)):'';?>" />
						<input type="submit" class="button" value="开始查找" />
				</fieldset>
			</form>
		</div>
		<table cellspacing="0" class="datalist" id="list">
		<tr>	
			<th width="4%" class="firstcol">删除</th>
			<th width="21%">公司名</th>
			<th width="31%">新闻标题</th>
			<th width="11%">发布时间</th>
			<th width="11%">更新时间</th>
			<th width="11%">状态</th>
			<th width="6%">点击</th>
			<th width="5%">评论</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="4%" align="center"><input type="checkbox" name="id[]" value="<?php echo $val['id'];?>" /></td>
			<td width="21%" align="center"><?php echo $val['company'];?></td>
			<td width="31%" align="center"><?php echo $val['title'];?></td>
			<td width="11%" align="center"><?php echo date('Y-m-d',$val['inputtime']);?></td>
			<td width="11%" align="center"><?php echo date('Y-m-d',$val['updatetime']);?></td>
			<td width="11%" align="center"><?php echo $val['status']?'已审核 <a href="'.ADMIN_FILE.'?file=yellowpages&action=news_lock&status=0&id='.$val['id'].'"><u>待审</u></a>':'待审核 <a href="'.ADMIN_FILE.'?file=yellowpages&action=news_lock&status=1&id='.$val['id'].'"><u>审核</u></a>';?> </td>
			<td width="6%" align="center"><?php echo $val['clicks'];?></td>
			<td width="5%" align="center"><?php echo htmlspecialchars($val['comments']);?></td>
		</tr>
		<?php }?>
		<tr>
			<td width="4%" align="center">
		 	<input type="checkbox" name="chkall2" value="1" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="7" align="left">			
			<input type="radio" class="radio" value="news_delete" checked="checked" name="do" />删除 
			&nbsp;&nbsp;
			<input type="radio" class="radio" value="news_unlock"  name="do" />审核
			&nbsp;&nbsp;
			<input type="radio" class="radio" value="news_lock" name="do" />待审
			&nbsp;&nbsp;
			<input type="button" value="执行操作" class="button" name="do_delete" class="dosubmit" onclick="if(confirm('确定进行所选操作吗?')){this.form.submit();}" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="8"> 还没有任何企业新闻...</td></tr>	
		<?php }?>
		<tr>
			<td colspan="8"><?php echo $pages;?></td>
		</tr>
		</table>
	</div>
</div>
</body>
</html>