<?php 
include_once 'db_functions.php'; 
$db = new DB_Functions(); 
$json = $_POST["usersJSON"];
if (get_magic_quotes_gpc()){ 
	$json = stripslashes($json); 
	}
//Decode JSON into an Array 
$data = json_decode($json); 
//Util arrays to create response JSON 
$a=array();

//$ei = $_REQUEST[eid];
for($i=0; $i<count($data) ; $i++) {
//echo $data[$i]->name;
//Store User into MySQL DB 
$res = $db-> RetailerPost($data[$i]->name,$data[$i]->city,$data[$i]->state,$data[$i]->latitude,$data[$i]->longitude);
//Based on inserttion, create JSON response     
array_push($a,$res);
}
echo json_encode($a); 
 ?>