<?php



define('IN_PHPQUAN', true);

require_once dirname(__FILE__) . '/include/common.php';



$_REQUEST['act'] = $_REQUEST['act'] ? trim($_REQUEST['act']) : 'index' ;

$menu = $_REQUEST['menu'] ? trim($_REQUEST['menu']) : 'config';

switch ($_REQUEST['act'])

{

	case 'index':

		include tpl('index');

	break;



	case 'top':

		include tpl('top');

	break;



	case 'left':

		include tpl('left');

	break;



	case 'right':

		$sql = "SELECT * FROM {$table}admin WHERE userid='$_SESSION[adminid]'";

		$row = $db->getRow($sql); 

		$admin['lastip']    = $row['lastip'];

		$admin['lastlogin'] = date('Y年m月d日', $row['lastlogin']);

		

		$juan_num    = $db->getOne("SELECT COUNT(*) FROM {$table}juan");

		$user_juan_num    = $db->getOne("SELECT COUNT(*) FROM {$table}juan_user");

		$user_juan_off    = $db->getOne("SELECT COUNT(*) FROM {$table}juan_user where offdate>0");

		$member_num  = $db->getOne("SELECT COUNT(*) FROM {$table}member");

		$com_num     = $db->getOne("SELECT COUNT(*) FROM {$table}com");

		include_once PHPQUAN_ROOT . 'include/version.inc.php';		
		$seo['title'] = '管理中心';

		include tpl('right');

	break;



	case 'clear_caches':

		$phpchche = clear_caches('phpcache');

		$compiled = clear_caches('compiled');

		$sqlcache = clear_caches('sqlcache');

		if($phpcache && $compiled && $sqlcache) echo '1';

		show('清理缓存成功');

	break;

}

?>