<?php
/*
 * Copyright(C). D-cube,Inc. All Rights Reserved.
 */

/*
 * @file		EnvInfo.class.php
 * @brief		環境情報クラス
 * @date		2006.12.17
 */

require_once(CLASS_DIR."/PageRender.class.php");
require_once(CLASS_DIR."/adodb/GroupManager.class.php");

class EnvInfo extends PageRender
{
	function makePage()
	{
		$this->assign("TOPIC_PATH","<a href=\"./index.php?mode=3\">bitcube管理TOP</a> &gt; bitcube情報");
		
		$dao = new GroupManager();
		$group_array = $dao->getGroupList();
		$this->assign("group_array",$group_array);
		
		preg_match("/([0-9]+)/",shell_exec("du -s \"".SYSTEM_PATH."\" "),$bitcube_kb);
		preg_match("/([0-9]+)/",shell_exec("du -s \"".LOG_DIR."/\" "),$log_kb);
		
		$this->assign("username",$_SESSION["auth_username"]);
		$this->assign("db_type",DB_TYPE);
		$this->assign("db_host",DB_HOST);
		$this->assign("db_user",DB_USER);
		$this->assign("db_name",DB_NAME);
		$this->assign("bitcube_size",$bitcube_kb["0"] * 1024);
		$this->assign("log_size",$log_kb["0"] * 1024);
		$this->assign("template",TEMPLATE);
		
		$this->template = "EnvInfo.tpl";
	}
	
	function render()
	{
		$this->makePage();
		$this->renderPage();
	}
}
