/*
	@author:	Krzysztof Prugar
	@desc:		Javascript for restaurant_home.php
*/

$(document).ready(function() 
{
	// Must hide the dialog message on load
	$("#disable_online_orders").hide();
	//alert('this is a test');
	// This will display a message to the customer when they land at the location store.
	/*
	$.get("get_status.php", function(data)
	{
		//alert("Data Loaded: " + data);
		// Gets the status returned from get_status.php so javascript can use the results
		if(data == 0 )
		{
			$("#disable_online_orders").load("message.php").dialog(
			{
				resizable: false,
				height:400,
				width: 400,
				modal: true,
				buttons: 
				{
					Ok: function() 
					{
						$(this).dialog('close');
					}
				}
			});
		
		}
 	});
 	*/
 	
 	$.ajax({
		url: "get_status.php",
		data: "id="+restaurantID,
		type: 'GET',
		dataType: 'json',
		success: function(data) 
		{
			//alert("Data Loaded: " + data);
			if(data == 0 )
			{
				$("#disable_online_orders").load("message.php").dialog(
				{
					resizable: false,
					height:400,
					width: 400,
					modal: true,
					buttons: 
					{
						Ok: function() 
						{
							$(this).dialog('close');
						}
					}
				});
			
			}
		},
		error: function(e, xhr, setting, exception)
		{
			//alert(e + '   ' + xhr + '   ' + setting + '   ' + exception );
		}
	});
});
