<body background="">
<?php include("../../include/dbconnect.php"); 


if($cnf=="Yes")
{
	if(empty($bcode)) 
	{
		echo("Customer not selected, Please select Customer and resubmit<br>");
		exit;
	}

	if($record=='0')
	{
		echo("Product and Order No not selected, Please select Product and resubmit<br>");
		exit;
	}



	$sdate = $schedule_date;
	$sc_dt = substr($sdate,6,4).'-'.substr($sdate,3,2).'-'.substr($sdate,0,2);
	
	$sdate = $due_date;
	$d_date = substr($sdate,6,4).'-'.substr($sdate,3,2).'-'.substr($sdate,0,2);
	
	$result = mysql_query("select drawing_no,order_no,order_date,rate,prodcode,order_qty from orders where record='$record' ") or die(mysql_error());
	$row = mysql_fetch_row($result);
	$drawing_no = $row[0];
	$order_no=$row[1];
	$ord_date=$row[2];
	$ord_rate=$row[3];
	$prodcode =$row[4];
	$ord_qty=$row[5];

	
	$query="insert into orders values('$bcode','$prodcode','$drawing_no','$order_no','$ord_date','$ord_qty','$order_qty','','$order_qty','$ord_rate','$schedule_no','$sc_dt','$d_date','','','','','','','','','','','Y','','','','','','','','$month','$year','$plan_type','','$tentative_qty','',NULL)";
	
	mysql_query($query) or die (mysql_error());
	
	
}

?>
<br>
<br><br><font size=1><center><a href= "input2.php">Make another Entry</a></center></font>
<br><br><font size=1><center><a href= "../../index.html">Return to index page</a></center></font>
