<?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++) {
//Store User into MySQL DB 
$res = $db->UserEventTrack($data[$i]->prime_id,$data[$i]->address,$data[$i]->date_value,$data[$i]->time_value,$data[$i]->eng_id,$data[$i]->latitude,$data[$i]->longitude,$data[$i]->imei,$data[$i]->model_id,$data[$i]->distance,$data[$i]->event);
//Based on inserttion, create JSON response 
array_push($a,$res);     
}
echo json_encode($a); 
 ?>