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

$making_charge_percent = $_REQUEST['making_charge_percent'];
$stone_percent = $_REQUEST['stone_percent'];
$diamond_percent = $_REQUEST['diamond_percent'];
$solitaire_percent = $_REQUEST['solitaire_percent'];
$order = $_REQUEST['order'];

$fetch_details_data = $Mainclass->Fetch_multiple_data("gold_billing_order_details","SLN,total_making_charge,stone_price,diamond_price,solitaire_price","Order_No='".$order."'");

foreach ($fetch_details_data as $details_data) {

$SLN = $details_data['SLN'];

$making_charge = $details_data['total_making_charge'];
$stone_price = $details_data['stone_price'];
$diamond_price = $details_data['diamond_price'];
$solitaire_price = $details_data['solitaire_price'];

$making_discount = $making_charge*($making_charge_percent/100);
$stone_discount = $stone_price*($stone_percent/100);
$diamond_discount = $diamond_price*($diamond_percent/100);
$solitaire_discount = $solitaire_price*($solitaire_percent/100);

$Mainclass->Update_Data("gold_billing_order_details","making_discount_percent='".$making_charge_percent."',making_discount_amt='".$making_discount."',stone_discount_percent='".$stone_percent."',stone_discount_amt='".$stone_discount."',diamond_discount_percent='".$diamond_percent."',diamond_discount_amt='".$diamond_discount."',solitaire_discount_percent='".$solitaire_percent."',solitaire_discount_amt='".$solitaire_discount."'","SLN='".$SLN."'");

}



?>