<?php 
require_once 'conn.php';
require_once 'function.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
<title><?=$site['sitename']?></title>
<meta name="keywords" content="<?=$site['keywords']?>"/>
<meta name="description" content="<?=$site['description']?>"/>

<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="open.css">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
function squrl(id){
  $.get("user_squrl.php", { id: id },
  function(data){
    alert(data);
	
  });
}

function gourl(str){
window.open(str);
}
</script>
</head>
 
<body>  
<?php 
require_once 'head.php';
?>
<div class="container">
  <div class="box">  	
  
   <!-- 友情链接板块 -->
   <div class="row">
	   <form action="" method="get">
		 <table class="table table-bordered  table-responsive ">
	
				
				<tr>
				  <td width="80">价格</td>
				  <td>
					  <input name="sell" type="text" value="1" size="5"> 元
				  </td>		 
				</tr>
				
				<tr>
				  <td></td>
				  <td>
					 <button  class="btn btn-success" >筛选</button>
				  </td>		 
				</tr>				
		 </table>
	   </form>
	   <table class="table table-bordered  table-responsive biaoge">
		   <tr>
			  <td>站点名称</td>
			  <td>站点url</td>
			  <td>售价</td>
			  <td>百度收录</td>
			  <td>百度权重</td>			  
			  <td>联系微信</td>
			  <td>联系QQ</td>
			 
			</tr>
			
			<?php 

				// Page分页函数 
					$page = $_GET["page"]; 
					$sell = $_GET["sell"]; 
					
			        if($sell){
					$m="where sell = '$sell' ";
					}else{
					$m="where sell >= 1";
					}
					function Page($rows,$page_size,$sell){ 
					global $page,$select_from,$select_limit,$pagenav,$sell;
					$page_count = ceil($rows/$page_size); 
					if($page <= 1 || $page == '') $page = 1; 
					if($page >= $page_count) $page = $page_count; 
					$select_limit = $page_size; 
					$select_from = ($page - 1) * $page_size.','; 
					$pre_page = ($page == 1)? 1 : $page - 1; 
					$next_page= ($page == $page_count)? $page_count : $page + 1 ; 
					$pagenav .= "第 $page/$page_count 页 共 $rows 条记录 "; 
					$pagenav .= "<a href='?page=1&sell=$sell'>首页</a> "; 
					$pagenav .= "<a href='?page=$pre_page&sell=$sell'>前一页</a> "; 
					$pagenav .= "<a href='?page=$next_page&sell=$sell'>后一页</a> "; 
					$pagenav .= "<a href='?page=$page_count&sell=$sell'>末页</a>"; 
					$pagenav.="　跳到<select name='topage' size='1' onchange='window.location=\"?sell=$sell&page=\"+this.value'>\n"; 
					for($i=1;$i<=$page_count;$i++){ 
					if($i==$page) $pagenav.="<option value='$i' selected>$i</option>\n"; 
					else $pagenav.="<option value='$i'>$i</option>\n"; 
					}
					$pagenav.="</select>"; 
					} // Page分页函数 
					// 使用示例 
					
					$num=query("select count(id) from url_data $m");												
					Page($num[0],5,$baidu,$quanzhong); 
					
					$sql = "select * from url_data $m order by id desc limit $select_from $select_limit"; 					
					$arr = listquery($sql);						
					foreach ($arr as $v) {
			
			?>	
			<tr>
			  <td onClick="gourl('http://<?=$v['url']?>');"><?=$v['sitename']?></td>
			  <td onClick="gourl('http://<?=$v['url']?>');"><?=$v['url']?></td>
			  <td><font color="red"><?=$v['sell']?></font></td>
			  <td><?=$v['baidu']?></td>
			  <td><?=$v['quanzhong']?></td>
			  <td>
			  <?php 
			  $src=$v['weixin'];
			  if($src){
			  echo '<img src="'.$src.'" />';
			  }
			  ?>
			  </td>
			  <td><a href="http://wpa.qq.com/msgrd?v=3&uin=<?=$v['qq']?>&site=www.ttlinkw.com&menu=yes" class="l" target="_blank"><img src="http://wpa.qq.com/pa?p=1:<?=$v['qq']?>:4" title="QQ" /></a></td>			 
			</tr>			
		   <?php
			}
			?>
		</table>
		
   </div>
   <!-- 友情链接板块 -->
   
   <div class="row">
		
	<?php
		echo $pagenav;           
	?>

	</div>
	
	 
	 
	<?php 
	require_once 'foot.php';
	?>
	
	<!--我的代码结束-->
  </div>
</div>

	<!--txl2u--><!--3r9fw-->	 
</div>
</body>
</html>

