<?php
header ("Content-Type:text/xml");
include "start.php";
echo "<psync>";
//---------------------------------------------------------------------------------------------------------
  
//===========================Product================================================  
  
  
  
    $query_sync="INSERT INTO
                    t_".$key_table_prefix."_return_item_addon
                    (
					
					
			 		rtd_rtd_id,
					rtd_rti_id,
					rtd_header_id,
					device_id, 
					
			 		rtd_doc_no ,
			 		rtd_addon_code, 
			 		
			 		rtd_addon_name,
			 		rtd_price,  
			 		rtd_cost, 
			 		rtd_quantity,
			 		rtd_uom,
					rtd_total_amount,  
			 		
					created_date ,					
					modified_date ,
					client_id 
                    )
                    VALUES
                    (
	                    
					'".$_REQUEST["rtd_id"]."',
					'".$_REQUEST["rtd_rti_id"]."',
					'".$_REQUEST["rtd_header_id"]."',
					'".$_REQUEST["device_id"]."', 
					
			 		'".$_REQUEST["rtd_doc_no"]."' ,
			 		'".$_REQUEST["rtd_addon_code"]."', 
			 		'".$_REQUEST["rtd_addon_name"]."',
			 		
					'".$_REQUEST["rtd_price"]."',  
			 		'".$_REQUEST["rtd_cost"]."', 
			 		'".$_REQUEST["rtd_quantity"]."',
			 		'".$_REQUEST["rtd_uom"]."',
					
			 		
					
					
			 		'".$_REQUEST["rtd_total_amount"]."',  
			 		
					'".$_REQUEST["created_date"]."' ,					
					'".$_REQUEST["modified_date"]."' ,
					'".$client_id."' 
					
                    )
                    ON DUPLICATE KEY UPDATE
				
					rtd_rti_id ='".$_REQUEST["rtd_rti_id"]."',
					rtd_header_id ='".$_REQUEST["rtd_header_id"]."',
					rtd_doc_no ='".$_REQUEST["rtd_doc_no"]."',
					rtd_addon_code='".$_REQUEST["rtd_addon_code"]."', 
					
					rtd_addon_name='".$_REQUEST["rtd_addon_name"]."',

					rtd_price='".$_REQUEST["rtd_price"]."',  
					rtd_cost='".$_REQUEST["rtd_cost"]."', 
					rtd_quantity='".$_REQUEST["rtd_quantity"]."',
					rtd_uom='".$_REQUEST["rtd_uom"]."',
					
					
					rtd_total_amount='".$_REQUEST["rtd_total_amount"]."',  
					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>";
?>