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

$SLN = $_REQUEST['SLN'];
$form_type = $_REQUEST['form_type'];

$stone_array = $_REQUEST['s_name'];
$stone_data = '';
foreach ($stone_array as $stone) {
    $stone_data .= "," . $stone;
}
$s_name = ltrim($stone_data, ",");
$no_stones = $_REQUEST['no_stones'];
$stone_value = $_REQUEST['stone_value'];

$total_stone_value = $no_stones*$stone_value;

$diamond_type = $_REQUEST['diamond_type'];
$quality = $_REQUEST['quality'];
$color = $_REQUEST['color'];
$type = $_REQUEST['type'];
$no_diamonds = $_REQUEST['no_diamonds'];
$diamond_value = $_REQUEST['diamond_value'];
$diamond_carat = $_REQUEST['diamond_carat'];

$total_diamond_price = $no_diamonds*$diamond_value*$diamond_carat;


$sol_diamond_type = $_REQUEST['sol_diamond_type'];
$sol_quality = $_REQUEST['sol_quality'];
$sol_color = $_REQUEST['sol_color'];
$sol_type = $_REQUEST['sol_type'];
$sol_no_diamonds = $_REQUEST['sol_no_diamonds'];
$sol_diamond_value = $_REQUEST['sol_diamond_value'];
$solitaire_carat = $_REQUEST['solitaire_carat'];

$total_sollitaire_price = $sol_no_diamonds*$sol_diamond_value*$solitaire_carat;

if($form_type=="Stone"){

$Mainclass->Update_Data("gold_temp_product_master","StoneName='".$s_name."',No_Stone='".$no_stones."',Stone_Value='".$stone_value."',total_stone_value='".$total_stone_value."'","SLN='".$SLN."'");

}

if($form_type=="Diamond"){

$Mainclass->Update_Data("gold_temp_product_master","Diamond_Creation_Type
='".$diamond_type."',DiamondQuality='".$quality."',DiamondColor='".$color."',DiamondType='".$type."',No_Diamond='".$no_diamonds."',Diamond_Value='".$diamond_value."',Diamond_Carat='".$diamond_carat."',total_diamond_price='".$total_diamond_price."'","SLN='".$SLN."'");
	
}


if($form_type=="Solitaire"){

$Mainclass->Update_Data("gold_temp_product_master","Solitaire_Creation_Type
='".$sol_diamond_type."',SolitaireQuality='".$sol_quality."',SolitaireColor='".$sol_color."',SolitaireType='".$sol_type."',No_Solitaire='".$sol_no_diamonds."',Solitaire_Value='".$sol_diamond_value."',sollitaire_Carat='".$solitaire_carat."',total_diamond_price='".$total_sollitaire_price."'","SLN='".$SLN."'");
	
}



?>