<?	
	session_start();
	
	/*這一行強制讓錯誤都不顯示*/
	if(!file_exists("module/" . $page . ".php"))  header("Location: session.php");
	
	/*引入自訂函式庫*/
	include "function.php";	
	
	/*檢查登入狀態*/
	if(!$uid||!$page) header("Location: session.php");	
	
	/*引入目標頁*/
	include "module/" . $page . ".php";	
	
	/*引入左右頁面*/
	include "left_panel.php";
	include "right_panel.php";
	
	/*取出標題列*/
	$temp = sql_b("select display_name from modules where module_name = '$page' ");	
	$title = $temp[0][0];
	if(!$title)
	{	
		$title = "ICIM' 2004•國際資訊管理研討會";
	}
	else
	{
		$title = "ICIM' 2004•國際資訊管理研討會 - " . $title;
	}
	
	/*準備 parser */
	$array['{TITLE_TEXT}'] = $title;
	$array['{LEFT_CONTENT}'] = left_panel();
	$array['{RIGHT_CONTENT}'] = right_panel();
	$array['{MIDDLE_CONTENT}'] = main_page();	

	/*檢查登出入狀態*/	
	
	if($uid=='SATURN')
	{
		$X='member_login';
		$Y='我要登入';
	}
	else
	{
		$X='member_logout';
		$Y="我要登出 (編號:$uid)";
	}
		
	$array['{LOGIN_STATUS_URL}'] = $X;
	$array['{LOGIN_STATUS}'] = $Y;
	
	$buffer = read_and_parser("template.htm",$array);	

	echo $buffer;
?>