<?php
include("../../include/dbconnect.php");?>
<title>Product Master Creation</title>
<body background="blater01.gif" topmargin=0>
<center>
<table cellpadding=0 cellspacing=4 width=590>
<tr>
<td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font ><b>Product Code Creation</b></font></td>
</tr><tr valign="top"><td colspan=2>
<font >&nbsp;</font>
</td>
</tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="590">

<form method="Post" action="entry.php">  
<?

$prodcode1=$group.$firstsub.$application.$machinery.$material.$subcontract.$finish;

$result = mysql_query("select name from buy where bcode ='$bcode1'  ") or die(mysql_error());
$row = mysql_fetch_row($result);
$bname = $row[0];


$result = mysql_query("select bcode,prodcode from product where bcode ='$bcode1' and prodcode ='$prodcode1' ") or die(mysql_error());
$row = mysql_fetch_row($result);
if(empty($row))
{
		
		?>
		<tr><td><font class="sbd">&nbsp;</font><b>Customer</b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="50" readonly name="bname" value=<? echo("'$bname'");?> ></td></tr>		
		
		<tr><td><font class="sbd">&nbsp;</font><b>Product Name</b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="50" readonly name="prodname" value=<? echo("'$prodname1'");?> ></td></tr>
		
		<tr><td><font class="sbd">&nbsp;</font><b>Alloted Product Code </b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="15"  readonly name="prodcode" value=<? echo($prodcode1);?> ></td></tr>
		
		<tr><td><font class="sbd">&nbsp;</font><b>Excise Tariff </b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" readonly name="tariff" value=<? echo($tariff1);?> ></td></tr>
		
		<tr><td><font class="sbd">&nbsp;</font><b>Product Code at Customer end</b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="25" readonly name="cust_prodcode" value=<? echo($cust_prodcode1);?>></td></tr>
		
		<tr><td><font class="sbd">&nbsp;</font><b>Drawing No / Part No</b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="25" readonly name="drawing_no" value=<? echo($drawing_no1);?>></td></tr>
		
				<tr><td><font class="sbd">&nbsp;</font><b>Labour Rate</b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="25" readonly name="labour_rate" value=<? echo($labour_rate1);?>></td></tr>

		<tr><td><font class="sbd">&nbsp;</font><b>Packing</b></font></td><td>   
		<input type="text"    onKeyPress="return event.keyCode!=13"   size="25" readonly name="packing" value=<? echo($packed);?>></td></tr>
<input type="hidden" name="bcode"  value="<? echo($bcode1)?>">
<input type="hidden" name="group1"  value="<? echo($group)?>">
<input type="hidden" name="firstsub1"  value="<? echo($firstsub)?>">
<input type="hidden" name="application1"  value="<? echo($application)?>">
<input type="hidden" name="machinery1"  value="<? echo($machinery)?>">
<input type="hidden" name="material1"  value="<? echo($material)?>">
<input type="hidden" name="subcontract1"  value="<? echo($subcontract)?>">
<input type="hidden" name="finish1"  value="<? echo($finish)?>">

  <tr> 
    <td align="right" width="326" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Confirm Product</b></font></td>
    <td width="319" > 
  <tr> 
    <td width="319" ></td>
    <td width="319" > <input type="radio"    onKeyPress="return event.keyCode!=13"   name="upd" value = "Yes"> <font class="sbd"><b>Yes </b></font>&nbsp;</td>
  </tr>
  <tr> 
    <td width="319" ></td>
    <td width="319" > <input type="radio"    onKeyPress="return event.keyCode!=13"   name="upd" value = "No"> <font class="sbd"><b>No
      </b></font>&nbsp;</td>
  </tr
    ><table cellpading=0 cellspacing=10 width= 50>
    <tr> 
      <td> <blockquote> <input type ="submit" name="submit" value = "Submit"></td></blockquote>
  </table>
  
  
		</table>
	<?
}
elseif(!empty($row))
{
echo("This product is already available in product master for this customer. Please check and retry<br>");
exit;
}




?>



