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

$SLN = $_REQUEST['SLN'];
$p_cate = $_REQUEST['p_cate'];
$parent_code = $_REQUEST['design_id'];
$p_name = $Mainclass->real_escapes(strip_tags($_REQUEST['p_name']));
$h_code = $Mainclass->real_escapes(strip_tags($_REQUEST['h_code']));
$g_purity = $_REQUEST['g_purity'];
$g_weight = $_REQUEST['g_weight'];

$s_name = $_REQUEST['s_name'];

$stone_weight = $_REQUEST['stone_weight'];
$d_purity = $_REQUEST['d_purity'];
$diamond_weight = $_REQUEST['diamond_weight'];
$mk_ch = $_REQUEST['mk_ch'];
$mk_ch_val = $_REQUEST['mk_ch_val'];
$wc = $_REQUEST['wc'];
$remark = $Mainclass->real_escapes(strip_tags($_REQUEST['remark']));

$count_check = $Mainclass->num_check("gold_products_master", "SLN", "ParentId='" . $parent_code . "'");
$newcount = $count_check + 1;
$Productid = $parent_code . "-" . $newcount;

$m = date('m');
$y = date('y');
$barcode = $Productid . $m . $y;

$DateTime=date('Y-m-d H:i:s');
$IP = $_SERVER['REMOTE_ADDR'];
$Added_By = $_COOKIE['User'];

$stone_value = $stone_weight;
$diamond_value = $diamond_weight;

$table = "gold_products_master";

$Fields = "GoldWeight='$g_weight', StoneValue='$stone_value', DiamondValue='$diamond_value', MakingChargesValue='$mk_ch_val', WastedCost='$wc', Updated_On='$DateTime', Updated_By='$Added_By'";

$condition = "SLN='".$SLN."'";

$result = $Mainclass->Update_Data($table, $Fields, $condition);


?>
