<?php 
include '../comm/conn.php';
include '../comm/config.php';
include '../comm/checkpostandget.php';
include 'check.php';
$kword=$_GET['keyword'];
$page = !($_GET['page'])?'1':intval($_GET['page']);
$page2=($page-1)*10;
$num1=10;

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die('数据库链接出错: ' . mysql_error());
}
else
{
	mysql_query("set names gbk");
	$sql="select * from yflink";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	$num = mysql_num_rows($rs);	
	
	$sql="select * from yflink  order by linkid asc limit $page2,$num1";
	//mysql_select_db($dbname);
	//echo $sql;
	$rs = mysql_query($sql);

}	
?><!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=gb2312" />
<title>管理中心</title>
<link href="../images/style1.css" rel="stylesheet" type="text/css">
<link href="../images/sty.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE4 {color: #990000}
.STYLE5 {color: #FF0000}
-->
</style>
</head>

<?php
include("../comm/head.php");
?>
<body topmargin="5" leftmargin="0">
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="6"></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="950" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td width="440" height="30" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" /> 友情链接配置管理 <a href="addlink.php">【<span class="STYLE5">新增友情链接</span>】 </a></strong></td>
              
            </tr>
            <tr>
              <td colspan="3" valign="top"><table width="950" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="950" border="1" cellpadding="0" cellspacing="1">
                  
                    <tr>
                      <td width="84" height="30" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;ID</strong></td>
                      <td width="164" height="30" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;链接名称</strong></td>

                      <td width="460" bgcolor="#F2F2F2" class="bigtext"><div align="center"><strong>链接网址</strong></div></td>

                                            <td width="227" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;执行操作</strong></td>
                    </tr>
					<?php
					while ($row = mysql_fetch_array($rs))
					{

						echo "<tr>";
                      	echo "<td height=30 class=bigtext>&nbsp;".$row[linkid]."</td>";
                      	echo "<td height=30 class=bigtext>&nbsp;".$row[linkname]."</td>";
						echo "<td class=bigtext>&nbsp;<textarea name=adsense  cols=60 rows=1>".$row[linkurl]."</textarea></td>";
						echo "<td class=bigtext>&nbsp;<a href=chglinks.php?id=".$row[linkid]." class=link3>修改</a> <a href=dellink.php?id=".$row[linkid]." class=link3>删除</a></td>";
						echo "</tr>";
					}
					?><tr>
                      <td height="43" colspan="10" align="center">
<div id="pages">
                    <?php  
require_once("../comm/pages.php"); $page_size=10;    
  $nums=$num;     
  $sub_pages=10;   
  $pageCurrent=$_GET["page"];     
     
  $subPages=new SubPages($page_size,$nums,$pageCurrent,$sub_pages,"linklist.php?keyword=".$kword."&page=",2);
?></div></td></tr>
                  </table></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
<?php
include("footer.php");
?>
</body>
</html>
<?php mysql_close($link);?>
