<?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(); 

$dc = new DB_Connect();         
$link1 = $dc->connect();
$json = $_REQUEST["invJSON"];
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();
// print_r($data);
// exit;
$sale_person = $data["uid"];

$part_List = $data["part_List"];
$retailer_code=$data["retailer_code"];



//// get retailer basic details

//// store in db
$res = $db->createINV($sale_person,$retailer_code,$part_List);
//Based on inserttion, create JSON response     
array_push($a,$res);

echo json_encode($a);

/*
	

*/
 
?>