<?php
/****************优客365网址导航系统 商业版********************/
/*                                                            */
/*  Youke365.com (C)2017 Youke365 Inc.                        */
/*  This is NOT a freeware, use is subject to license terms   */
/*  优客365网址导航系统是商业软件,使用于商业用途请购买授权    */
/*  V1.0 2017                                                 */
/*  技术支持：1513773524@qq.com                               */
/*  官方网址：http://www.youke365.com                         */
/*  官方论坛：http://bbs.youke365.com                         */                           
/**************************************************************/

require('common.php');


$pagetitle = '管理首页';
$tempfile = 'main.html';

$server = array();
$server['datetime'] = date('Y-m-d　H:i:s');
$server['software'] = $_SERVER['SERVER_SOFTWARE'];
$server['php_version'] = PHP_VERSION;
$server['mysql_version'] = $DB->version();
$server['smarty_version'] = Smarty::SMARTY_VERSION;
$server['soft_version'] = SYS_VERSION.' Build '.SYS_RELEASE;

$server['globals'] = get_phpcfg('register_globals');
$server['safemode'] = get_phpcfg('safe_mode');
$server['rewrite'] = apache_mod_enabled('mod_rewrite') ? '<font color="#008800">√</font>' : '<font color="#FF0000">×</font>';


if (function_exists('memory_get_usage')) {
	$server['memory_info'] = get_real_size(memory_get_usage());
}


//授权检测，请勿删除
$auth_status = file_get_contents(YOUKE365_UPDATE_URL.'?a=client_check&u='.$site_url);


//检测新版

$get_news_version = file_get_contents(YOUKE365_UPDATE_URL.'?a=check&u='.$site_url.'&v='.SYS_VERSION);

if(SYS_VERSION < $get_news_version && $get_news_version!= 'error'){
  $news_version = '<span style="color:red">发现新版 v'.$get_news_version.'</span>';
}





function get_phpcfg($varname) {
	switch ($result = get_cfg_var($varname)) {
		case 0 :
			return '<font color="#FF0000">×</font>';
			break;
		case 1 :
			return '<font color="#008800">√</font>';
			break;
		default :
			return $result;
			break;
	}
}

$smarty->assign('news_version',$news_version);
$smarty->assign('auth_status',$auth_status);
$smarty->assign('login_user', $myself['user_email']);
$smarty->assign('login_time',  $myself['login_time']);
$smarty->assign('login_ip',  $myself['login_ip']);
$smarty->assign('login_count', $myself['login_count']);
$smarty->assign('server',  $server);
$smarty->assign('stat', get_stats());
unset($server);

smarty_output($tempfile);
?>
