<?

//將頁面處理值送回主模組	

function main_page()
{	
	global $action;
	
	//流程控制
	switch ($action)
	{       		
		
	        //預設畫面(提示報名注意事項)
   		default:
      		$buffer = step0();      		
      		break;
	}	
	
	return $buffer;
}

//預設頁面
function step0()
{
	global $page,$temp_array,$uid;		
	
	$buffer = "<br>";
	
	$array['{TOP1_A}'] = "熱　情";
	$array['{TOP1_B}'] = "智　慧";
	$array['{TOP1_C}'] = "科　技";
	
	$buffer .= read_and_parser("top1.php",$array);
	unset($array);
	
	/*程式開始*/
	//----------------------------------------------------------------------	
	
	$array['{MIDDLE_PANEL_TITLE}'] = '繳　費　紀　錄　查　詢';
	$array['{MIDDLE_PANEL_CONTENT}'] = file_get_contents('require/pay_detail.htm');
	
	/*查詢繳費紀錄*/
	
	$temp_array[0] = $uid -930000;	
	$info = sql_b("SELECT name , amount , remind , pay_ok ,pay_time  FROM member WHERE id = '$temp_array[0]");


	/*設定替換資料*/
	
	$temp_ccc[] = $uid;
	$temp_ccc[] = $info[0][0];
	$temp_ccc[] = $info[0][1];
	$temp_ccc[] = $info[0][2];
	$info[0][2] == 1 ? $temp_ccc[] = "繳費完成! 謝謝您!" : $temp_ccc[] = "您還沒有繳費唷，記得要快快去繳!";
	$info[0][4] == '0000-00-00 00:00:00' ? $temp_ccc[] = "(尚無資料)" : $temp_ccc[] = $info[0][4];
	
	/*執行替換*/
	
	$temp_a = $array['{MIDDLE_PANEL_CONTENT}'];
	
	for($i=0;$i<sizeof($temp_ccc);$i++)
	{
		$temp_a = str_replace('{' . ($i+1) . '}',$temp_ccc[$i],$temp_a);
	}
	$array['{MIDDLE_PANEL_CONTENT}']= $temp_a;
	
	
	/*套 Template*/		
	if($uid=='SATURN') $array['{MIDDLE_PANEL_CONTENT}'] = '您必須先 <a href="module.php?page=member_login">登入系統</a>，才能夠執行這個動作唷！';	
	$buffer .= read_and_parser("middle.php",$array);
	unset($array);	
	
	return $buffer;
}
?>