<?php 
include_once 'db_functions.php'; 
$db = new DB_Functions(); 
$json = $_POST["usersJSON"];

if (get_magic_quotes_gpc()){ 
		$json = stripslashes($json); 
	}
	if (get_magic_quotes_gpc()){ 
		$json1 = stripslashes($json1); 
	}
//Decode JSON into an Array 
$data = json_decode($json); 

//Util arrays to create response JSON 
$a=array();
$b=array();

$ei = $_REQUEST[eid];
for($i=0; $i<count($data) ; $i++) {
//Store User into MySQL DB 
$res = $db->postsale($data[$i]->imei,$data[$i]->cust_name,$data[$i]->contact_no,$data[$i]->state,$data[$i]->city,$data[$i]->sync_date,$ei,$data[$i]->productname,$data[$i]->serial_no);


//Based on inserttion, create JSON response     
  
 array_push($a,$res);  
    
 }
 //////////////

 
 
  //Post JSON response back to Android Application 
 echo json_encode($a); 

 ?>
 