<?

$keyword = $_POST['keyword'];

$keyword=trim($keyword);
if($keyword){
	$wheres=" AND (NewsID like '%$keyword%' or Title like '%$keyword%') ";
}
//??????
$sql="select count(*) from news where 1 $wheres";
$rs=$DB->query($sql);
$pageSize=30;
$totalRecord=$DB->result($rs,0,0);
$totalPage=@ceil($totalRecord/$pageSize);
if(!$page)$page=1;
$offset=($page-1)*$pageSize;
//??
$sql = "select * from news where 1 $wheres order by dtCreate desc limit $offset,$pageSize";
$result = $DB->query($sql);
$pageList = GetPageList($_SERVER[PHP_SELF],"page","15",$totalPage,$page);
$PNum = $DB->num_rows($result);
?>
	<div class="note">

<h3>新闻列表</h3>
			<?
	if($PNum){
?>
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			
<tbody>
	        <? while($NewsInfo=$DB->fetch_array($result)){?>
			
				<tr class="text-c">
				
				
					<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="article_edit('??','/news/show.php?NewsID=<?=$NewsInfo[NewsID]?>','<?=$NewsInfo[NewsID]?>')" title="??"><?=$NewsInfo[Title]?></u></td>
				

				
					<td><?=$NewsInfo[dtCreate]?></td>
				
				
				</tr>
				       <? }?>
			</tbody>
		</table>
	
	
      <?	}else{
			   echo "<center><br><br>没有相关记录<br><br></center>";
			}
?>
<br>    
<? 
$DB->close();

?>
</div>