<?php

require_once("config/configDB.php"); 

$edit_id        = stripslashes($_POST['edit_id']);
$productcode    = stripslashes($_POST['productcode']);
$productname    = stripslashes($_POST['productname']);
$product_type   = $_POST['product_type'];
$qty_type   = stripslashes($_POST['qty_type']);
$purchase_rate  = stripslashes($_POST['purchase_rate']);
$gst            = stripslashes($_POST['gst']);
$hsn_code       = stripslashes($_POST['hsn_code']);
$description    = stripslashes($_POST['description']);

//productcode, productname, purchase_rate, gst, hsn_code,description, create_date, flag FROM `product_master`


$sql_update = "UPDATE product_master SET ";
$sql_update .= "productcode='$productcode',";
$sql_update .= "productname='$productname',";
$sql_update .= "product_type='$product_type',";
$sql_update .= "qty_type='$qty_type',";
$sql_update .= "purchase_rate='$purchase_rate',";
$sql_update .= "gst='$gst',";
$sql_update .= "hsn_code='$hsn_code',";
$sql_update .= "prodct_description='$description'";

$sql_update .= "WHERE id='$edit_id' ";

mysqli_query($conn,$sql_update);

$sql_update_mapping = "UPDATE product_mapping_customer SET ";
$sql_update_mapping .= "productcode='$productcode',";
$sql_update_mapping .= "productname='$productname',";
$sql_update_mapping .= "purchase_rate='$purchase_rate',";
$sql_update_mapping .= "gst='$gst',";
$sql_update_mapping .= "hsn_code='$hsn_code',";
$sql_update_mapping .= "prodct_description='$description'";

$sql_update_mapping .= "WHERE productID='$edit_id' ";

mysqli_query($conn,$sql_update_mapping);



header("Location:productMasterDashboard.php");


?>
