<?php include('session.php'); 

	error_reporting(E_ALL);
	ini_set("display_errors", 1);

?>	



<?php			
	$array_AA = explode("\n", file_get_contents('A1_data_input/_menu_level01.txt'));
	$menu_level_ONE = array_values(array_filter($array_AA , "trim"));

	for ($c = 1; $c <= 5; $c++) 
	{
		${"menu_level_ONE_" . $c}= $menu_level_ONE[$c-1]; 		//echo "menu_level_ONE_" . $c . " = "  . ${"menu_level_ONE_" . $c}  . "<br>";
	}

	//$menu_level_ONE_1 = $menu_level_ONE[0];		//echo "menu_level_ONE_1 = $menu_level_ONE_1 <br>";
	//$menu_level_ONE_2 = $menu_level_ONE[1];		//echo "menu_level_ONE_2 = $menu_level_ONE_2 <br>";
	//$menu_level_ONE_5 = $menu_level_ONE[4];		//echo "menu_level_ONE_5 = $menu_level_ONE_5<br>";



	$array_BB = explode("\n", file_get_contents('A1_data_input/_menu_level02.txt'));
	$menu_level_TWO = array_values(array_filter($array_BB , "trim"));

	for ($c = 1; $c <= 22; $c++) 
	{
		${"menu_level_TWO_" . $c}= $menu_level_TWO[$c-1]; 		//echo "menu_level_TWO_" . $c . " = "  . ${"menu_level_TWO_" . $c}  . "<br>";
	}

	//$menu_level_TWO_1 = $menu_level_TWO[0];		//echo "menu_level_TWO_1 = $menu_level_TWO_1 <br>";
	//$menu_level_TWO_2 = $menu_level_TWO[1];		//echo "menu_level_TWO_2 = $menu_level_TWO_2 <br>";
	//$menu_level_TWO_7 = $menu_level_TWO[6];		//echo "menu_level_TWO_17 = $menu_level_TWO_17 <br>";
?>





<?php $PageA_From="_index"; ?>

<?php
//****** PART A: Get white list from txt **********************************//		
	$array_C = explode("\n", file_get_contents('A1_data_input/_link_names.txt'));
	$link_names = array_values(array_filter($array_C , "trim"));

	for ($c = 1; $c <= 23; $c++) 
	{
		${"link_names_" . $c}=$link_names[$c-1]; 		//echo "link_names_" . $c . " = "  . ${"link_names_" . $c}."<br>";
	}

	//$link_names_1 = $link_names[0];		//echo "link_names_1 = $link_names_1 <br>";
	//$link_names_2 = $link_names[1];		//echo "link_names_2 = $link_names_2 <br>";
	//$link_names_9 = $link_names[8];		//echo "link_names_9 = $link_names_9 <br>";

	//echo "link_names_22 = $link_names_22 <br>";
	//echo "link_names_23 = $link_names_23 <br>";
?>


<?php
//****** PART B: Get uri from the url *******************************//	


//echo "page=" . $_GET['page'] . "<br>";	

	if (isset($_GET['page']) && !empty($_GET['page']) )
	{																	
		$index_get_sub_page=$_GET['page'];  	//echo "index_get_sub_page=" . $index_get_sub_page . "<br>";								 
	}
	else
	{
		$index_get_sub_page="CA-01_Team_Members";  			//echo "empty!="  . "<br>";						 
	}
	//echo"<font face='Verdana' style='font-size: 9pt' color=red> <br> index_get_sub_page= $index_get_sub_page <br> </font> ";

	
//****** PART C: url parameter general filtering *************************************//	
	//NO NEED url parameter general filtering, because no database entry.



//****** PART C: uri matching ********************************************************//
	//echo "TEST3 > link_names_1:" . $link_names_1. "<br>";

	for ($d = 1; $d <= 23; $d++) 
	{
		${"LN_" . $d}=substr(${"link_names_".$d}, 0,-1); 		//echo "LN_" . $d . " = "  . ${"LN_" . $d}."<br>";
	}

	//echo "LN_22 = $LN_22 <br>";
	//echo "LN_23 = $LN_23 <br>";

	$FW_url= "($LN_1|$LN_2|$LN_3|$LN_4|$LN_5|$LN_6|$LN_7|$LN_8|$LN_9|$LN_10|$LN_11|$LN_12|$LN_13|$LN_14|$LN_15|$LN_16|$LN_17|$LN_18|$LN_19|$LN_20|$LN_21|$LN_22|$LN_23)";

		
	if (preg_match("/^$FW_url$/", "$index_get_sub_page")) 
	{
		$countF_url=1;
	}
	else
	{
		$countF_url=0;
	}
		//echo"<font face='Verdana' style='font-size: 8pt' color=red> countF_url=$countF_url <br> </font> ";

		
	if ($countF_url== 0 ) 
	{
		$index_get_sub_page="Z_under_construction"; 
		//echo"<font face='Verdana' style='font-size: 8pt' color=brown> set to home! </font> ";
	}


		
//****** PART D: final defination for $index_get_sub_page ****************************//	
	$DISPAY= "$index_get_sub_page" . ".php";
	//echo"<font face='Verdana' style='font-size: 9pt' color=green> <br> $DISPAY <br> </font> ";	


?>	



 <!----- PART E: Display screen width and height --------------------------------------->
 
	<script>
		var w = window.innerWidth;
		var W= "Current Width: " + w ;

		var h = window.innerHeight;
		var H= "Current Height: " + h ;
	</script>


	<div align="center">
		<div class="show_size" style="display:block;">
			<?php 
				$ScreenWidth ="<script>document.writeln(W);</script>";
				$ScreenHeight ="<script>document.writeln(H);</script>";


				if (isset($_GET['WH']) && !empty($_GET['WH']) )
				{																	
					$index_get_WH=$_GET['WH'];  									 
				}
				else
				{
					$index_get_WH=0;  									 
				}


				if ($index_get_WH==1 )
				{																	
					echo $ScreenWidth." and " . $ScreenHeight ;
				}
			?>	
		</div>
	</div>

