<?php
require_once(dirname(__FILE__) . "/../../../adbcon.php");
require_once(dirname(__FILE__) . "/../tool_functions.php");

$area = $_POST['area'];
$areas = array();
$q = "select * from cyprus_locations where 1=1 ";
if($area != "") {
	$q .= " and acode='$area' ";
}
$q .= "order by location asc;";

//echo $q;

$r = @mysql_query($q);
if($r && mysql_num_rows($r) > 0) {
	while ($row = mysql_fetch_assoc($r)) {
		$areas [] = array('lcode' => $row['lcode'], 'location' => stripslashes($row['location']));
	}
}
echo json_encode($areas);
?>