<?php
require_once("../global/checkuser2.php");
?>
<!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>news</title>
<link rel="stylesheet" href="index.css" />
</head>

<body>
<div class="bigdiv">
<table cellspacing="0" cellpadding="0" style="font-size:14px;"><tr><td style="text-align:left;border-left:none;">您的位置：<a href="index.php">行业网络动态</a></td><td style="text-align:right;border-left:none;"><a href="add.php">添加新闻</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>
<div style="float:left;width:100%;border-bottom:2px solid #337abb;height:25px;font-size:14px;line-height:25px;"><ul>
<li style="float:left;width:100px;text-align:center;border:2px solid #337abb;border-top:1px solid #337abb;border-bottom:none;background:#337abb;margin-left:20px;display:inline;"><a href="index.php" style="color:#FFF;">行业网络动态</a></li>
</ul></div>
<div class="list">
<table cellspacing="0" cellpadding="0"><tr style="background:#d3edf9;"><td style="border-left:none;">日期</td><td style="width:25%;">新闻标题</td><td style="width:40%;">新闻网址</td><td class='g'>操作</td></tr></table>
<table cellspacing="0" cellpadding="0">
<?php
ob_start();
require_once("../global/page.class.php");
require_once("../global/connect.php");
$pageSize=15;
$total=mysql_num_rows(mysql_query("SELECT * FROM news")); 
pageft($total,$pageSize,1,1,1,9,20,0);
$sql="SELECT * FROM  news order by id DESC limit $firstcount,$pageSize";
$sql=mysql_query($sql);
if($sql){ob_end_clean();
while($row=mysql_fetch_array($sql)){
$url="http://".str_replace("http://","",$row["url"]);
echo "<tr><td style='border-left:none;'>".$row["date"]."</td><td style=\"width:25%;text-align:left;\">&nbsp;".$row["name"]."</td><td style=\"width:40%;text-align:left;word-break:break-all;\">&nbsp;<a target='_blank' href='$url'>".$row["url"]."</a></td><td class='g'><a href=\"function.php?mod=delete&id=$row[id]\">[删除]</a></td></tr>";
}}else
echo "<tr><td style='width:100%;color:red;border-left:none;text-align:center;'>没有符合该要求的记录!</td></tr>";
ob_end_flush();
?>
</table>
<div>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $pagenav;?></div>
</div>
</div>
</body>
</html>
