<?
class index extends action
{
	function frame()
	{
		$this->init_tpl();
		$this->tpl->display('index.frame.html');	
	}
	
	function default_page()
	{
		global $glo_site_version,$_ADMIN_LANG;
		$this->init_tpl();
		//gd 
		$gd = get_gd_version();
		$sys_info	=	array();
		if ($gd == 0){
        $gd_str = 'N/A';
    	}else{
        if ($gd == 1){
            $gd_str = 'GD1';
        }else{
            $gd_str = 'GD2';
        }
        $gd_str .= ' (';

        // check  type for image
		  if ($gd && (imagetypes() & IMG_JPG) > 0){
            $gd_str .= ' JPEG';
        }if ($gd && (imagetypes() & IMG_GIF) > 0){
            $gd_str .= ' GIF';
        }
        if ($gd && (imagetypes() & IMG_PNG) > 0){
            $gd_str .= ' PNG';
        }
        $gd_str .= ')';
    	}	
		/* system message */
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['gd_version'],'value'=>$gd_str);
//		 $sys_info[]   = array('name'=>$_ADMIN_LANG['operating_system'],'value'=>PHP_OS.' ('.$_SERVER['SERVER_ADDR'].')');
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['operating_system'],'value'=>PHP_OS);
		 $sys_info[]	= array('name'=>$_ADMIN_LANG['web_server'],'value'=>$_SERVER['SERVER_SOFTWARE']);
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['php_version'],'value'=>PHP_VERSION);
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['mysql_version'],'value'=>mysql_get_server_info($this->db->linkID));
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['zlib_support'],'value'=>function_exists('gzclose') ? $_ADMIN_LANG['yes']:$_ADMIN_LANG['no']);
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['time_zone'],'value'=>function_exists("date_default_timezone_get") ? date_default_timezone_get() : $_ADMIN_LANG['unnecessarily_set']);
		 $sys_info[]   = array('name'=>$_ADMIN_LANG['socket_support'],'value'=>function_exists('fsockopen') ? $_ADMIN_LANG['yes']:$_ADMIN_LANG['no']);	

		 /* upload max */
	    $sys_info[] 	= array('name'=>$_ADMIN_LANG['maximum_upload'],'value'=>ini_get('upload_max_filesize'));
		 $sys_info[]	= array('name'=>$_ADMIN_LANG['system_coding'],'value'=>SIT_CHARSET);
		 
		 
		 $this->tpl->out['sys_info']	=	$sys_info;
		
		
		//online
		 	require_once(ROOT_PATH.'includes/glo_stat.php');
			$stat_obj	=	new stat();
			$online_num	=	$stat_obj->stat_online_num();
			$this->tpl->out['online_num']	=	$online_num;

		//visits  for today 
			$today_num	=	$this->db->getNumber("SELECT COUNT(access_time) as count FROM {$this->db->db_pre}stats WHERE FROM_UNIXTIME(access_time,'%Y-%m-%d')='".date('Y-m-d')."'");
			$this->tpl->out['today_num']	=	$today_num;

		$this->tpl->out['glo_site_version']	=	$glo_site_version;
	  	$this->tpl->display('index.default_page.html');	
	
		 
	}
	
	function info()
	{
		$this->init_tpl();
		$this->tpl->display('index.info.html');	
	}

	function top()
	{
		$this->init_tpl();
		$this->tpl->display('index.top.html');	
	}
	
	function drag()
	{
		$this->init_tpl();
		$this->tpl->display('index.drag.html');
	}

}
