<?php
header ("Content-Type:text/xml");
include "start.php";
echo "<psync>";
//---------------------------------------------------------------------------------------------------------
  

  
    $query_sync="INSERT INTO
                    t_".$key_table_prefix."_internal_inventory_transaction
                    (
					
					device_id  ,
					iit_device_iit_id  ,
					iit_date  ,
					iit_location_code  ,
					iit_product_code  ,
					
					iit_type  ,
					iit_user  ,
					iit_quantity  ,
				
					created_date ,
					modified_date ,
					client_id 
                    )
                    VALUES
                    (
	                    
					
					'".$_REQUEST["device_id"]."',
					'".$_REQUEST["iit_id"]."',
					
					'".substr($_REQUEST["created_date"],0,10)."',
					
					
					'".$_REQUEST["iit_location_code"]."',
					'".$_REQUEST["iit_product_code"]."',
					
					'".$_REQUEST["iit_type"]."',
					'".$_REQUEST["iit_user"]."',
					'".$_REQUEST["iit_quantity"]."',
					
					
					'".$_REQUEST["created_date"]."',
					'".$_REQUEST["modified_date"]."',
					
	                    '".$client_id."'
                    )
                    ON DUPLICATE KEY UPDATE
					
					iit_location_code='".$_REQUEST["iit_location_code"]."',
					iit_product_code='".$_REQUEST["iit_product_code"]."',
					iit_type='".$_REQUEST["iit_type"]."',
					iit_user='".$_REQUEST["iit_user"]."',
					iit_quantity='".$_REQUEST["iit_quantity"]."' ,
					created_date='".$_REQUEST["created_date"]."', 
					modified_date='".$_REQUEST["modified_date"]."', 
					client_id = '".$client_id."'
					
                    ;
                    ";
    $result_sync = mysqli_query($dbconn,$query_sync) or die("Error ".mysqli_error($dbconn));
    
               
			
			
			
			
			
			                     
echo "<upload>
";
echo "<status>SUCCESS</status>
";
echo "<message>".str_replace("&","&amp;","Upload Successful")."</message>
";
echo "</upload>
";

         


//---------------------------------------------------------------------------------------------------------
echo "</psync>";
?>