<?php
include("db_connection.php");
$Mainclass=new DB_Controller();

$Get_Product=mysqli_query($Mainclass->dbh,"SELECT SLN,Product_Code FROM dealer_gold_stock_master WHERE Dealer_Code='GP'");
while($Ft_Pro=mysqli_fetch_assoc($Get_Product))
{
	
	$Get_Barcode=mysqli_fetch_assoc(mysqli_query($Mainclass->dbh,"SELECT Barcode FROM gold_products_master WHERE Productid='".$Ft_Pro['Product_Code']."'"));
	//echo $Ft_Pro['Product_Code']." - ".$Get_Barcode['Barcode']."<br>";
	$Upd=mysqli_query($Mainclass->dbh,"UPDATE dealer_gold_stock_master SET Barcode='".$Get_Barcode['Barcode']."' WHERE SLN='".$Ft_Pro['SLN']."' AND Product_Code='".$Ft_Pro['Product_Code']."'");
	//echo $Upd="UPDATE dealer_gold_stock_master SET Barcode='".$Get_Barcode['Barcode']."' WHERE SLN='".$Ft_Pro['SLN']."' AND Product_Code='".$Ft_Pro['Product_Code']."'";
}
echo "DONE";
?>