<?php
@session_start();
include('checkstate.php');
include('../inc/function.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>ETW国际案例演示</title>
<link rel="stylesheet" href="media/css.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/modifykeyrank.js"></script>
</head>

<body>
<div id="main">
     <div id="top"><a href="loginout.php" title="退出">退出</a></div>
     <div id="menu"><ul>
         <li><a href="index.php">管理首页</a></li><li><a href="allcompany.php">案例企业</a></li><li><a href="keymanage.php">关键字</a></li><li><a href="accountmangage.php">帐户管理</a></li>
     </ul></div>
     
     <div id="center">
        <div id="left">
        <div class="title"><strong>行业分类案例</strong></div>
            <div class="grade"><ul>
              <li><a href="allcompany.php?id=1"><img src="img/grade_img1.jpg" />上市公司</a></li>
              <li><a href="allcompany.php?id=2"><img src="img/grade_img2.jpg" />龙头企业</a></li>
              <li><a href="allcompany.php?id=3"><img src="img/grade_img3.jpg" />中小型企业</a></li>
            </ul></div>
        </div>
        
        <div id="right">
          <div class="location"><strong>当前位置 : 管理首页 >> 关键词排名管理</strong></div>
          <div id="content">
           <div class="name">  <a href="allcompany.php">添加关键词</a> | <a href="seomanage.php">添加搜索引擎</a></div>
           <div style="float:left; width:100%;"><form action="keymanage.php" method="post">输入关键词查询<input type="text" name="search" /> <input type="submit" name="submit" value="查询" />  </form>
           </div>
   <table width="794" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666" class="tables">
  <tr>
    <th width="41" scope="col">序号</th>
    <th width="155" scope="col">关键词</th>
    <th width="206" scope="col">搜索引擎</th>
    <th width="248" scope="col">网址(http://)</th>
    <th width="132" scope="col">关键词排名</th>
  </tr>
  <?php if(@$_POST['search']){
            $searchstr="where keyword like '%".$_POST['search']."%' ";
        }else{
            $searchstr="";
		}
        
		 $nums=25;
		 $count=sql_select("select count(*) from keyrank ".$searchstr);
		 $pages=ceil($count[0][0]/$nums);
		 if(@$_GET['page']){
		      $page=$_GET['page']; $start=($page-1)*$nums;
		}else{
		    $page=1;$start=0;
		}	  
        $i=1;
        $sql="select * from keyrank ".$searchstr." order by companyid desc";
		$result=mysql_query($sql);
		while($row=mysql_fetch_array($result)){?>
  <tr>
    <td><?php echo $i; ?></td>
    <td><?php echo $row['keyword']; ?></td>
    <td><?php echo getenginename($row['searchid']); ?></td>
    <td><?php echo geturl($row['companyid']); ?></td>
    <td><input type="hidden" name="keyid" id="keyid<?php echo $i; ?>" value="<?php echo $row['id'];?>" /><input type="text" id="rank<?php echo $i; ?>" name="rank" size="3" value="<?php echo $row['rank']; ?>" /> <input type="button" name="button" value="修改"  onclick="modifykeyrank('keyid<?php echo $i; ?>','rank<?php echo $i; ?>')" /></td>
  </tr>
  <?php   $i++; } ?>
  <tr><td colspan="5"><span style=" float:right; text-align:right; padding-right:30px; font-size:12px;"><?php if($page==1) { echo "首页 | 上一页";}else{
           echo "<a href='?page=1'>首页</a> | <a href='?page=".($page-1)."'>上一页</a>";  }
      if($page<$pages){
           echo " | <a href='?page=".($page-1)."'>下一页</a> | <a href='?page=".$pages."'>末页</a>";  }else{
            echo " | 下一页 | 末页";
        }
		echo  "   (第".$page."页/共".$pages."页)";
	  
	  ?></span></td></tr>
</table>
  
          </div>
        </div>
     </div>
     
     <div id="foot"><P>copy right &copy; 2008-2009  <font color="#990000">ETW International</font></P></div>
</div>
</body>
</html>
