<?php
header ("Content-Type:text/xml");
include "start.php";
echo "<psync>";
//---------------------------------------------------------------------------------------------------------
  
//===========================Product================================================  
  
                               
  
    $query_sync="INSERT INTO
                    t_".$key_table_prefix."_product
                    (
                    pdt_code,
                    pdt_name,
                    pdt_barcode,
                    pdt_category_code,
                    pdt_uom,
                    pdt_price,
                    pdt_price_2,
                    pdt_price_3,
                    pdt_price_4,
                    pdt_price_5,
                    
                    pdt_cost,
                    pdt_gst_code,
                    pdt_gst_mode,
                    
                    pdt_balance,
                    pdt_supplier,
                    pdt_brand,
                    
				
				pdt_select_size,
				pdt_select_color,
				pdt_select_pattern,
				
                    pdt_category_1,
                    pdt_category_2,
                    pdt_category_3,
                    
                    pdt_status,
                    
                    created_date,
                    modified_date,
                    
                    client_id
                    )
                    VALUES
                    (
                    '".$_REQUEST["code"]."',
                    '".$_REQUEST["name"]."',
                    
                    '".$_REQUEST["barcode"]."',
                    '".$_REQUEST["category_code"]."',
                    
                    '".$_REQUEST["uom"]."',
                    '".$_REQUEST["price"]."',
                    '".$_REQUEST["price_2"]."',
                    '".$_REQUEST["price_3"]."',
                    '".$_REQUEST["price_4"]."',
                    '".$_REQUEST["price_5"]."',
                    
                    '".$_REQUEST["cost"]."',
                    '".$_REQUEST["gst_code"]."',
                    '".$_REQUEST["gst_mode"]."',
                    
                    '".$_REQUEST["balance"]."',
                    '".$_REQUEST["supplier"]."',
                    '".$_REQUEST["brand"]."',
                    
				
				'".$_REQUEST["select_color"]."',
				'".$_REQUEST["select_size"]."',
				'".$_REQUEST["select_pattern"]."',
				
                    '".$_REQUEST["category_1"]."',
                    '".$_REQUEST["category_2"]."',
                    '".$_REQUEST["category_3"]."',
                    
                    '".$_REQUEST["status"]."',
                    
                    '".$_REQUEST["created_date"]."',
                    '".$_REQUEST["modified_date"]."',
                    
                    
                    
                    '".$client_id."'
                    )
                    ON DUPLICATE KEY UPDATE
                    pdt_name = '".$_REQUEST["name"]."',
                    pdt_barcode = '".$_REQUEST["barcode"]."',
                    pdt_category_code = '".$_REQUEST["category_code"]."',
                    
                    pdt_uom = '".$_REQUEST["uom"]."',
                    pdt_price = '".$_REQUEST["price"]."',
                    pdt_price_2 = '".$_REQUEST["price_2"]."',
                    pdt_price_3 = '".$_REQUEST["price_3"]."',
                    pdt_price_4 = '".$_REQUEST["price_4"]."',
                    pdt_price_5 = '".$_REQUEST["price_5"]."',
                    
                    pdt_cost = '".$_REQUEST["cost"]."',
                    pdt_gst_code = '".$_REQUEST["gst_code"]."',
                    pdt_gst_mode = '".$_REQUEST["gst_mode"]."',
                    pdt_balance = '".$_REQUEST["balance"]."',
                    pdt_supplier = '".$_REQUEST["supplier"]."',
                    pdt_brand = '".$_REQUEST["brand"]."',
				
				pdt_select_size = '".$_REQUEST["select_size"]."',
				pdt_select_color = '".$_REQUEST["select_color"]."',
				pdt_select_pattern = '".$_REQUEST["pdt_select_pattern"]."',
				
                    pdt_category_1 = '".$_REQUEST["category_1"]."',
                    pdt_category_2 = '".$_REQUEST["category_2"]."',
                    pdt_category_3 = '".$_REQUEST["category_3"]."',
                    
                    pdt_status = '".$_REQUEST["status"]."',
                    created_date = '".$_REQUEST["created_date"]."',
                    modified_date = '".$_REQUEST["modified_date"]."'
                    
                    
                    
                    
                    ;
                    ";
    $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>";
?>