<?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); 
for($i=0; $i<count($data) ; $i++) {
//Store User into MySQL DB 
$res = $db->save_stock($data[$i]->retailer_name,$data[$i]->feature_phone,$data[$i]->smart_phone,$data[$i]->collection_amt,$data[$i]->collection_mode,$data[$i]->image_name,$data[$i]->image);

//Based on inserttion, create JSON response     
  
 array_push($a,$res);  
 }
 //////////////
 
  //Post JSON response back to Android Application 
 echo json_encode($a); 

   
 ?>
 