<?php

/*
*	Copyright VeryIDE,2007-2010
*	http://www.veryide.com/
*
*	$Id: api/index.php,v2.5 19:47 2009-04-01 Lay $
*/

//载入依赖库以及配置
require '../include/global.php';

require '../function/client.php';
	
$do = getgpc('do');

switch ($do){
	
	//用户表下载
	case "admins":
	
		//连接数据库
        System :: connect();
	
		$subject= '用户列表';
		$report= '用户名	QQ	电话号码	电子邮箱	个人主页'.chr(13);
		
		$sql="SELECT * FROM `sys:admin` order BY id desc";
		$result = System :: $db -> getAll( $sql );
	
		foreach( $result as $row ){
			
			$report.= $row['account'].'	'.$row["qq"].'	'.$row["phone"].'	'.$row["email"].'	'.$row["blog"].chr(13);
			
		}
		
		//关闭数据库
        System :: connect();
	
	break;

}

//判断登录
if( $_SESSION['Manager']['id'] && $report ){		
	report( $subject, $report );
}
	
?>