<?

define('SOFTPUBS_IN', true);

require(dirname(__FILE__) . '/includes/init.php');

require(ROOT_PATH.'admin/includes/functions.php');

require_once(ROOT_PATH.'includes/database.php');
$db_obj	 =	 new Database(TRUE);
if (!$db_obj->connect($glo_db_host, $glo_db_user, $glo_db_pass, $glo_db_name)){
        die("Not Connect!");
}
$db_obj->db_pre	=	$glo_db_pre;

$db_obj->query('set names utf8');

require_once(ROOT_PATH.'admin/lang/'.$glo_lang.'.php');

require_once(ROOT_PATH.'admin/includes/action.class.php');

if($is_module	=	$_GET['is_module']){
	$act	=	get_module_action($is_module);
	if(!$act){
		exit;
	}
	require_once(MODULES_DIR .$is_module.'/'. "{$act['file']}.php");
}else{
	$act			=		get_action();
	if(!$act){
		exit;
	}
	require_once(CLASS_DIR . "{$act['file']}.php");
}
$app = new $act['app'];
$app->act	=	$act;

if(!method_exists($app, $act['fun'])) {
	exit;
}else{
	$app->$act['fun']();
}


