<?php
include_once 'db_functions.php';     
$db = new DB_Functions();  

$ei = $_REQUEST['eid'];    
$users = $db->mappedLocation($ei);     
$a = array();     
$b = array(); 
 
 if ($users != false){ 
   while($row = mysql_fetch_array($users)) {
		//// get parent id info
	  $p_res = $db-> getLocationDetail($row["location_id"]);
	  $p_row = mysql_fetch_array($p_res);
	
	$b["pid"] = $row["location_id"];
  	$b["name"] = $p_row["name"];
  	$b["city"] = $p_row["city"];
  	$b["state"] = $p_row["state"];	
	array_push($a,$b);
   }
   	echo json_encode($a);
 }

?>