<?php

    include "library.php";

	$cxn = start_code( false, true );

//    process_external_entry_point( $cxn );


	page_header( "City/region links", $cxn );
    

//    if (query_num_rows($result) > 0)
//    {
//		if ($data['flag_file_name'] != "")
//			echo "&nbsp;&nbsp;<img src='/flags/".$data['flag_file_name']."' height=42>";
//    }
    
  
  
//    echo "<span class='redpgheading'>City links</span><br>";


	$query = "SELECT * FROM ".common_data_database_name.".full_list_cities_regions WHERE country = 'Australia' ORDER BY city_region_etc";
	

    $result = run_query( $query, $cxn );

    $last_heading_letter = "";
    
	for ($i=0; $i < query_num_rows( $result ); $i++)
	{
    	$data = get_row( $result );

        if ($data['city_region_etc'] != "")
        {
            if ($last_heading_letter != substr( $data['city_region_etc'], 0, 1))
            {
                echo "<br>";
                
                $last_heading_letter = strtoupper( substr( $data['city_region_etc'], 0, 1) );
                
                echo black( $last_heading_letter."<br>" );
            }
        }
        
        $city_links_country = $data['country'];

        if ($subdomain_page == "true")
            echo "<a class='glink' href=\"".$data['country']."_".$data['city_region_etc'].".php\">".$data['city_region_etc']."</a><br>";
        else
            echo "<a class='glink' href=\"/country/".$city_links_country."/".$data['country']."_".$data['city_region_etc'].".php\">".$data['city_region_etc']."</a><br>";
            
            
            // make tap targets large enough
            
        if (low_res_screen())
            echo "<br><br>";
    }

    echo "<br><br><br><br><br>";




    echo "</body>";
	
    echo "</html>";

?>
