<?php 
function userlist($wapid,$type){
$start = ($_GET['page']-1)*15;
if($start < 0){$start = 0;}
if($_GET['serid'] != NULL ){
	$sql="SELECT id,name,nc,pass,sex,qianm,head,email,admin,vip,sid,site,xid,site_u FROM user WHERE site_u='{$wapid}' AND id='".user2('id',$_GET['serid'],WAPID)."'";
}else{
	$sql="SELECT id,name,nc,pass,sex,qianm,head,email,admin,vip,sid,site,xid,site_u FROM user WHERE site_u='{$wapid}' ORDER BY id DESC LIMIT ".$start.",15";
}

$result = mysql_query($sql);
if($result && mysql_num_rows($result)>0){
while(list($id,$name,$nc,$pass,$sex,$qianm,$head,$email,$admin,$vip,$sid,$site,$xid,$site_u)=mysql_fetch_row($result)){
$html .= '<a href="userinfo.php?uid='.user('xid','id',$id).'">'.$nc.'</a>[ID:'.$xid.']<br>';
 }
	}else{
	$html='暂无用户';
	}
	if($type == 'list'){
		return '<div class="content">'.$html.'</div>';
	}else{
		if($_GET['serid'] != NULL){
		return '1';
		}else{	
		return mysql_num_rows(mysql_query("SELECT * FROM user WHERE site_u='{$wapid}';"));
			}
		}
	}