<?php
if (empty($_SESSION["admin"])) redirect("index.php?e=1");
if (!empty($_POST["btnSave"])) {
		
$sql="delete from price_master where ring_number='".$_GET["ring_number"]."'";
mysql_query($sql);
for($i = 1; $i < 9; $i++){
	if (pdbfx("price_value".$i)!='') {
		$sql="Insert into price_master(ring_number,metal_id,price_value)";
		$sql.="values ('".$_GET["ring_number"] ."',".$i.",'".pdbfx("price_value".$i) ."')";
		mysql_query($sql);
	}
}



	echo("<script language='javascript' type='text/javascript'>");
	echo("window.opener.navigate(window.opener.document.location.href);");
	echo("</script>");




}

if ($_GET["ring_number"]!='') //Price
{
$sql = "SELECT * from metal_master";
$cmdMetal = mysql_query($sql);


$sql = "SELECT * from price_master where ring_number=".$_GET["ring_number"];
$cmd = mysql_query($sql);

}



?>
