<?php 
//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
include_once 'db_functions.php'; 
$db = new DB_Functions(); 
$json = $_REQUEST["soJSON"];
if (get_magic_quotes_gpc()){ 
	$json = stripslashes($json); 
}
//Decode JSON into an Array 
$data = json_decode($json,true);  
//Util arrays to create response JSON 
$a=array();
$uname = $data["uname"];
$uid = $data["uid"];
$location_code = $data["retailerCode"];
$prodList = $data["prodList"];


//// get retailer basic details

//// store in db
$res = $db-> createSO($location_code,$uid,$uname,$prodList);
//Based on inserttion, create JSON response     
array_push($a,$res);

echo json_encode($a); 
?>