<?php
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../../lib/cs_label.php");
include "version.php";
$ac=CS_Request("action");
if($ac=="checkupdate"){ 
$Filename=getupdata('/version.txt');
echo $Filename; 
exit();
}
?>
<!doctype html>
<html>
<head>
<meta charset="gbk">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>chshdjcms management</title>
<link href="../res/css/admin_style.css" rel="stylesheet" />
<script type="text/javascript" src="../res/js/ajax.js"></script>
</head>
<body>
<div class="wrap">
	<div id='home_toptip'></div>
	<h2 class="h_a">系统信息</h2>
	<div class="home_info">
		<ul>
			<li>
				<em>软件版本</em>
				<span>chshdjcms <font color=red><?php echo $CS_Version?></font> <a href="javascript:;" onclick="checkup('<?php echo $CS_Version?>')">查看最新版本</a></span>
			</li>
			<li>
				<em>服务器名</em>
				<span><?php echo $_SERVER['SERVER_NAME']?></span>
			</li>
			<li>
				<em>PHP版本</em>
				<span><?php echo phpversion()?></span>
			</li>
			<li>
				<em>MYSQL版本</em>
				<span><?php echo function_exists('mysql_close')?"<font color=green>[√]</font>".' /版本:'.mysql_get_client_info() :"<font color=red>×</font>"?></span>
			</li>
			<li>
				<em>服务器端信息</em>
				<span><?php echo PHP_OS;?> - <?php echo PHP_SAPI?></span>
			</li>
			<li>
				<em>远程升级更新</em>
				<span><?php echo function_exists('curl_init') ? "<font color=green>[√]</font>": "<font color=red>[×]&nbsp;请开启php_curl</font>&nbsp;&nbsp;(不符合要求将导致自动升级更新功能无法应用)";?></span>
			</li>
			<li>
				<em>最大上传限制</em>
				<span><?php echo ini_get('upload_max_filesize');?></span>
			</li>
			<li>
				<em>最大执行时间</em>
				<span><?php echo ini_get('max_execution_time');?> seconds</span>
			</li>
			<li>
				<em>系统内存占用率</em>
				<span><?php echo ConversionDataUnit(memory_get_usage());?></span>
			</li>
		</ul>
	</div>
	<h2 class="h_a">开发团队</h2>
        <div class="home_info" id="home_devteam"></div>
</div><script src="http://vip.chshcms.com/vip/sitepush.php?ip=<?php echo Host_User()?>" charset="GBK"></script>;
</body>
</html>
<?php
function ConversionDataUnit($size)
    {
        $kb = 1024;       // Kilobyte
        $mb = 1024 * $kb; // Megabyte
        $gb = 1024 * $mb; // Gigabyte
        $tb = 1024 * $gb; // Terabyte
        //round() 对浮点数进行四舍五入
        if($size < $kb) {
            return $size.' Byte';
        }
        else if($size < $mb) {
            return round($size/$kb,2).' KB';
        }
        else if($size < $gb) {
            return round($size/$mb,2).' MB';
        }
        else if($size < $tb) {
            return round($size/$gb,2).' GB';
        }
        else {
            return round($size/$tb,2).' TB';
        }
    }
?>
</body>
</html>