<?php
header ("Content-Type:text/xml");
include "start.php";
echo "<psync>";
//---------------------------------------------------------------------------------------------------------
  
//===========================Product================================================  
  
          
    $query_sync=" INSERT INTO
                    t_".$key_table_prefix."_collection_header
                    (
					
					device_id  ,
					coh_doc_no  ,
					
					coh_coh_id  ,
					coh_customer_code  ,
					coh_customer_name  ,
					coh_customer_address_billing  ,
					coh_customer_address_delivery  ,
					coh_customer_gst_no  ,
					
					coh_date  ,
					
					coh_description  ,
					
					coh_total_amount  ,
					coh_rounding_amount  ,
					coh_total_amount_rounded  ,
					
					
					coh_payment_mode  ,
					coh_payment_text  ,
					
					
					
					coh_latitude  ,
					coh_longitude  ,
					
					coh_status  ,
					coh_closing_batch,
					
					created_date ,
					modified_date ,
					
					client_id 
                    )
                    VALUES
                    (
	                    
					
					'".$_REQUEST["device_id"]."',
					'".$_REQUEST["coh_doc_no"]."',
					
					'".$_REQUEST["coh_id"]."',
					'".$_REQUEST["coh_customer_code"]."',
					'".$_REQUEST["coh_customer_name"]."',
					'".$_REQUEST["coh_customer_address_billing"]."',
					'".$_REQUEST["coh_customer_address_delivery"]."',
					'".$_REQUEST["coh_customer_gst_no"]."',
					
					'".$_REQUEST["coh_date"]."',
					'".$_REQUEST["coh_description"]."',
					
					'".$_REQUEST["coh_total_amount"]."',
					'".$_REQUEST["coh_rounding_amount"]."',
					'".$_REQUEST["coh_total_amount_rounded"]."',
					
					'".$_REQUEST["coh_payment_mode"]."',
					'".$_REQUEST["coh_payment_text"]."',
					
					'".$_REQUEST["coh_latitude"]."',
					'".$_REQUEST["coh_longitude"]."',
					
					'".$_REQUEST["coh_status"]."',
					'".$_REQUEST["coh_closing_batch,"]."',
					
					
					'".$_REQUEST["created_date"]."',
					'".$_REQUEST["modified_date"]."',
				
	                    '".$client_id."'
                    )
                    ON DUPLICATE KEY UPDATE
				
					coh_coh_id ='".$_REQUEST["coh_id"]."',
					
					coh_customer_code='".$_REQUEST["coh_customer_code"]."',
					coh_customer_name='".$_REQUEST["coh_customer_name"]."',
					coh_customer_address_billing='".$_REQUEST["coh_customer_address_billing"]."',
					coh_customer_address_delivery='".$_REQUEST["coh_customer_address_delivery"]."',
					
					coh_customer_gst_no='".$_REQUEST["coh_customer_gst_no"]."',
					
					coh_date='".$_REQUEST["coh_date"]."',
					
					coh_description='".$_REQUEST["coh_description"]."',
					
					coh_total_amount='".$_REQUEST["coh_total_amount"]."',
					coh_rounding_amount='".$_REQUEST["coh_rounding_amount"]."',
					coh_total_amount_rounded='".$_REQUEST["coh_total_amount_rounded"]."',
					
					coh_payment_mode='".$_REQUEST["coh_payment_mode"]."',
					coh_payment_text='".$_REQUEST["coh_payment_text"]."',
					
					coh_latitude='".$_REQUEST["coh_latitude"]."',
					coh_longitude='".$_REQUEST["coh_longitude"]."',
					
					coh_status='".$_REQUEST["coh_status"]."',
					coh_closing_batch='".$_REQUEST["coh_closing_batch"]."',
					
					
					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>";
?>