<?php

	include "library.php";

	include forms_library;

	include ad_forms_library;


	$cxn = start_code();

    exit_if_search_bot();

    exit_if_session_expired( $cxn );


	$source = val( $_GET, "source" );

	if ($source != "")
	{
    	$_SESSION['source'] = $source;

    	log_hits( $source, $cxn );
	}
	

    if ($source != "")
	    page_header( sitename.": Search Jobs", $cxn, true );
	else
        page_header( "Search Jobs", $cxn, true );


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

//    write_city_list_update_function();
        

    if (! low_res_screen())
        echo "<br><br>";



	$cities = build_dropdown_list( "australian_cities", $cxn );


	$_SESSION['search_attempt'] = "1";


		// NOTE: use different field names to the profile edit screen otherwise going to edit profile will bring values into the search screen
		
	$type = val( $_SESSION, "stype" );
	$city = val( $_SESSION, "scity" );
	$postcode = val( $_SESSION, "spostcode" );
	$search_for_word = val( $_SESSION, "skeywords" );

                                                                    // box-shadow: 10px 10px 5px #888888;
	echo "<form name='form' action='".url_encode( "search_jobs_init.php" )."' method='POST'><table ><tr><td width='5%'>&nbsp;</td><td valign='top'><table style='border: 1px solid #bbbbbb; border-radius: 10px; background: ".table_background.";'>\n";

//    $types = "<option></option><option>Paid</option><option>Volunteer</option>";
//
//	form_dropdown( "Job type", "type", $types, $type );

	form_dropdown( "City", "city", $cities, $city );
	
	if (! low_res_screen())
	{
    	form_text( "Postcode", "postcode", "8", $postcode );

    	form_text( "Search&nbsp;for&nbsp;word", "keywords", "25", $keywords );
	}
	else
	{
    	form_textz( "Postcode", "postcode", "8", $postcode );

    	form_textz( "Search for word", "search_for_word", "25", $search_for_word );
	}

	echo "<tr><td width=18%></td><td colspan=2>".watermark( "Leave fields blank if they are not important to your search criteria&nbsp;&nbsp;&nbsp;" )."</td></tr>";		

	echo "<tr><td></td><td width='20%'><br>";

	show_green_button_submit( "Search", 90 );
	
	echo "</td></tr>";

    echo "<tr><td></td><td></td><td></td></tr>";

    echo "</table></td><td></td><td align='right' rowspan=8 valign='top'>";
  
	$color_scheme = val( $_SESSION, 'color_scheme' );
  


//    	show_ads_medium_skyscraper();


    echo "</td><td width='5%'>&nbsp;</td></tr>";

    echo "<tr><td colspan=3>";
    
    echo "<br><br>";
    
    
//        if (val( $_SESSION, "id" ) == "")

//    		show_ads( $cxn );		

//    	else
//   		show_double_ads( $cxn );

    echo "</td></tr>";

//        echo "</table>";

    echo "<tr><td colspan='3' align='center'>";


    if (! low_res_screen())    
    	show_ads_large_banner_arj( $cxn );		

//        if (val( $_SESSION, "id" ) == "")

//    	else
//    		show_double_ads( $cxn );
		
    echo "</td></tr>";

	echo "</table></form>";

	echo "<br>";

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

?>