<?php 
function site_list($start,$limit){
         $sql = "SELECT id,name,pass,nc,sex,email,vip,admin,xid,site,stitle,time FROM user WHERE site='YES' LIMIT {$start},{$limit}";
         $result = mysql_query($sql);
         if($result && mysql_num_rows($result)>0){
            while(list($id,$name,$pass,$nc,$sex,$email,$vip,$admin,$xid,$site,$stitle,$time)=mysql_fetch_row($result)){
            $html.='<a href="siteInfoView.php?id='.$id.'&">'.$stitle.'</a><br>[TIME:'.date("Y/m/d H:i:s",$time).'.ID:'.$id.']<br>';
             }
	    }else{
	     $html='暂无用户';
	    }
	    mysql_free_result($result);

	    return '<div class="content">'.$html.'</div>';
     }
function nums(){
         $sql = "SELECT count(*) FROM user WHERE site ='YES'";   
	     $result = mysql_query($sql); 
	     list($num) = mysql_fetch_row($result);
		  return $num;
		 }
function start($limit,$page){
           if($page<=0||$page==NULL){
		   $page=1;
		   }
           $list_nums=($page-1)*$limit;
            return $list_nums;
         }
		 $start=start(15,$_GET['page']);
		 $nums =nums();
		 $url='?action=site_list&';
$html = '<div class="title">注册子站管理</div>'.site_list($start,15).page($nums,15,$url,NULL,'view').' 
 <div class="mylink">
	<a href="../../admin/wap_admin_cg.php?">管理后台</a>|<a href="../../index.php?">首页</a>
	 </div>';