<?php
/**
 *  index.php
 *
 * @copyright			(C) 2005-2010 NewsTeng Inc.
 * @license				This is NOT a freeware, use is subject to license terms
 * @lastmodify			2010-12-16
   $Id: index.php 2 2010-12-16 10:59:13Z xuchao $
 */
defined('IN_XTCMS') or exit('No permission resources.');
base::load_app_class('admin', 'admin', 0);

class index extends admin {

	private $db;
	/**
	 * 析构函数
	 */
	public function __construct() {
		parent::__construct();
	}

	public function init() {
		$userinfo = $this->get_userinfo();
		include $this->admin_tpl('index');
	}

	public function right() {
		$this->love_db = base::load_model('love_model');

		$total_info = $this->love_db->count();	//信息总数

		$todaytime = strtotime(date('Y-m-d', SYS_TIME));	//今日信息数
		$today_info = $this->love_db->count("`postdate` > '$todaytime'");

		$mysql_version = $this->love_db->get_version();	//mysql版本

		$mysql_table_status = $this->love_db->get_table_status();
		$mysql_table_size = $mysql_table_index_size = '';
		foreach($mysql_table_status as $table) {
			$mysql_table_size += $table['Data_length'];
			$mysql_table_index_size += $table['Index_length'];
		}
		$mysql_table_size = sizecount($mysql_table_size);
		$mysql_table_index_size = sizecount($mysql_table_index_size);
		include $this->admin_tpl('right');
	}
}
?>