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

$Zone=$_REQUEST['Zone'];
$Karat=$Mainclass->real_escapes($_REQUEST['Karat']);
$Buying_Rate=$Mainclass->real_escapes($_REQUEST['Buying']);
$Selling_Rate=$Mainclass->real_escapes($_REQUEST['Selling']);
$Date=date('Y-m-d');

/*$Check_Exist=$Mainclass->num_check('gold_rate_master',"SLN","Karat='".$Karat."' and Zone='".$Zone."' and Entry_Date='".$Date."'");
if($Check_Exist==0)
{*/

foreach ($Zone as $Zone){

	$Fields="`Karat`,`Zone`,`Buying_Rate`,`Selling_Rate`,`Entry_Date`,`Created_By`,`Creation_IP`";
	$Values="'".$Karat."','".$Zone."','".$Buying_Rate."','".$Selling_Rate."','".$Date."','".$_COOKIE['User']."','".$_SERVER['REMOTE_ADDR']."'";
	$Ins=$Mainclass->Insert_Data('gold_rate_master',$Fields,$Values);


}


$msg=0;//=====Exist=====//	
/*}
else{
	$msg=1;//=====Exist=====//
}*/
echo $msg;
?>