<?php
require_once("../../global/checkuser1.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>关键字内容</title>
<link rel="stylesheet" href="index.css" />
<script src="../../global/jquery-latest.min.js"></script>
<script src="content.js"></script>
<script>
 function setCookie(sName,sValue,expireHours) {
  var cookieString = sName + "=" + escape(sValue);
  //;判断是否设置过期时间
  if (expireHours>0) {
    var date = new Date();
    date.setTime(date.getTime + expireHours * 3600 * 1000);
    cookieString = cookieString + "; expire=" + date.toGMTString();
  }
  document.cookie = cookieString+";path=/";
 }
function initselect(){
var ve = document.getElementById("channell").value;
var st = document.getElementById("channel");
for(var i=0;i<st.options.length;i++){
  if(ve==st.options[i].value){
       st.selectedIndex = i;
       break;
  }
}
}
function initselect2(){
var vee = document.getElementById("userr").value;
var ste = document.getElementById("user");
for(var i=0;i<ste.options.length;i++){
  if(vee==ste.options[i].value){
       ste.selectedIndex = i;
       break;
  }
}
}
</script>
</head>

<body>
<div class="bigdiv">
<table cellspacing="0" cellpadding="0" style="font-size:14px;line-height:25px;"><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;<a href="updateall.php">检查收录状态</a>&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;margin-left:20px;display:inline;border:2px solid #337abb;border-top:1px solid #337abb;border-bottom:none;background:#337abb;"><a style="color:#FFF;" href="../content/index.php" onclick="setCookie('B','11')">文章收录检测</a></li>
<li style="float:left;width:100px;text-align:center;"><a  href="../paiming/index.php" onclick="setCookie('B','12')">关键字排名</a></li>
<li style="float:left;width:100px;text-align:center;border-left:2px solid #337abb;color:#ccc;">关键字生成</li>
</ul></div>
<div class="list">
<?php
if(isset($_GET["channel"])){?>
<input type="hidden" id="channell" name="channell" value="<?=$_GET['channel']?>"/>
<input type="hidden" id="userr" name="userr" value="<?=$_GET['user']?>"/>
<?php } ?>
<table cellspacing="0" cellpadding="0"><tr style="background:#d3edf9;"><td style="width:35%;border-left:none;">文章标题</td><td>所属关键字</td>
<form action="" method="get" id="sform">
<td><select id="channel" name="channel">
<option value="">所属频道</option>
<?php
require_once("../../global/connect.php");
$channel=mysql_query("select * from channel");
while($crow=mysql_fetch_array($channel)){?>
<option value="<?=$crow['name']?>"><?=$crow['name']?></option>
<?php
}
?>
</select></td>
<td><select id="user" name="user">
<option value="">发布人</option>
<?php
$user=mysql_query("select * from user");
while($urow=mysql_fetch_array($user)){?>
<option value="<?=$urow['name']?>"><?=$urow['name']?></option>
<?php
}
?>
</select></td></form>
<td>相似度</td><td>加入日期</td><td>收录状态</td><td class="g">操作</td></tr>
</table>
<script>initselect();initselect2();</script>
<table cellspacing="0" cellpadding="0">
<?php
ob_start();
require_once("../../global/page.class.php");
$where="";
$channel="";
$user="";
$sqlchannel="";
$sqluser="";
if(isset($_GET["channel"])){
$type=$_GET["channel"];
$user=$_GET["user"];
$snum=0;
if($_GET["channel"]!=""){
if($snum>0)
$sqlchannel="and channel='$_GET[channel]'";
else{
$sqlchannel="where channel='$_GET[channel]'";
$snum +=1;
}
}
if($_GET["user"]!=""){
if($snum>0)
$sqluser="and user='$_GET[user]'";
else{
$sqluser="where user='$_GET[user]'";
$snum +=1;}
}
$where=$sqlchannel.$sqluser;
}
$pageSize=15;
$total=mysql_num_rows(mysql_query("SELECT * FROM content $where")); 
pageft($total,$pageSize,1,1,1,9,20,0);
$sql="SELECT * FROM  content $where order by id DESC limit $firstcount,$pageSize";
$sql=mysql_query($sql);
ob_end_clean();
if($sql){
while($row=mysql_fetch_array($sql)){
echo "<tr><td style=\"width:35%;border-left:none;text-align:left;\">&nbsp;<a target=\"_blank\" href=\"$row[url]\">".$row["arctitle"]."</a><a href='http://www.baidu.com/s?wd=$row[url]' target='_blank'>(百度)</a></td><td>".$row["belong"]."</td><td>".$row["channel"]."</td><td>".$row["user"]."</td><td>".$row["similar"]."</td><td>".$row["adddate"]."</td>";
if($row["soulustate"]=="yes")
echo "<td><img src='../../images/yes.gif'</td>";
if($row["soulustate"]=="no")
echo "<td><img src='../../images/no.gif'</td>";
echo "<td class='g'><a href=\"function.php?mod=delete&id=$row[id]\">[删除]</a></td></tr>";
}}else
echo "<tr><td style='width:100%;text-align:center;color:red;'>没有符合该要求的记录!</td></tr>";
ob_end_flush();
?>
</table>
<div>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $pagenav;?></div>
<div style="width:100%;height:10px;"></div>
<div style="width:98%;margin:auto;overfollow:hidden;border:2px solid #ccc;line-height:25px;font-size:14px;">
&nbsp;&nbsp;&nbsp;&nbsp;功能使用帮助说明：<br />
&nbsp;&nbsp;1、此功能用于检测文章收录情况，可批量检测。<br />
&nbsp;&nbsp;2、可通过所属频道、发布人对记录进行筛选。<br />
&nbsp;&nbsp;3、点击文章标题可打开文章页面，点击百度可以打开百度页面核对收录情况。
</div>
</div>
</div>
</body>
</html>
