<body background="i.jpg">
<?php include("../../include/dbconnect.php");
// Get all _POST VALUES HERE..
foreach($_POST as $p=>$t)
{
	$_POST[$p] = trim($t);
}
$myCustomer = $_POST['Customer'];
foreach($_POST as $q=>$r)
{
	$_POST[$q] = trim($r);
}
$myProduct = $_POST['Product'];
?>
<title>Daily Enquiry</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 face="Verdana, Arial, Helvetica, sans-serif"><b><b>Add new Enquiry</b></font></td>
</tr>
<tr valign="top"> 
<td colspan=2> <font >&nbsp;</font> </td>
</tr>
</table>

<table border=0  width="602">
<tr>
<td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>1. Customer Name & Address
  &nbsp;</b></font></td><td>
  </body>
<?
// Pull all the data from Customer master & populate it
$stQuery = mysql_query("select bcode,name,unit from buy where buyertype != 'LABOUR' order by name")or die( mysql_error() );
?>
<form name='myForm01' method='POST' action='<?=$_SERVER[PHP_SELF]?>'>
  <SELECT name='Customer' onChange="javascript:submit();">
    <?
echo "<option selected value=\" 0\"> Select Customer";
while($row = mysql_fetch_row($stQuery))
{
	$temp = $row[1].'&nbsp;&nbsp;'.$row[2];
	if(isset($myCustomer) && eregi("$myCustomer",$row[0]))
	{
		echo "<option selected value=\"$row[0]\">$temp";
	}
	else{
		echo "<option value=\"$row[0]\">$temp";
	}
}
?>
  </SELECT></td></tr>
  

</form>
<form name='myForm02' method='POST' action='entry_save.php' >
<input type="hidden" name="bcode" value=<?echo($myCustomer);?>>
<tr > 
<? // echo "$myCustomer"; ?>
<tr>
<td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>2. Product Name
  &nbsp;</b></font></td><td>
<SELECT name="prodcode"  >
<?
$bkquery = "SELECT  prodname,drawing_no,prodcode FROM product WHERE bcode ='$myCustomer' order by prodname,drawing_no ";
    $bkquery=stripslashes($bkquery);
    $result=mysql_query($bkquery) or       die( mysql_error() );
   echo "<option selected value=' '> Select Product";
   while($row1 = mysql_fetch_row($result))
{
          echo "<option value='$row1[2]'>";
          echo ($row1[0].'&nbsp;&nbsp;Dr. No:'.$row1[1]);

}
?>
</SELECT></td>
</tr>



<td width="164" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Enquiry No &nbsp;</b></font></td>
<td width="414" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="enquiryref_no"  value= '' > 
</td>
</tr>
<SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>


<?
if(empty($sdt))
{
  $sdt=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
}?>
<tr>
<td width="164" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Date &nbsp;</b></font></td>
<td>
<INPUT NAME="sdt" TYPE="text" class="text_box_button" VALUE="<?=$sdt?>" SIZE="15" readonly  >
 <A HREF="#" onClick="cal.select(document.myForm02.sdt,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> <BR>
 </td>
</tr>



  <td width="164" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>3. Quantity 
    &nbsp;</b></font></td>
  <td width="414" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="qty"  value= '' > 
  </td>
</tr>

<tr > 
  <td width="164" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>4. Sample / Drawing Given by Customer [Drawing / Tools]
    &nbsp;</b></font></td>
  <td width="414" > <input type="text"    onKeyPress="return event.keyCode!=13"   name="sample" value= ''> 
  </td>
  <tr>
  <td nowrap  width="164" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>5. Tools Given by Customer
    &nbsp;</b></font></td>
    <td> <select name="tools">
 <option selected>Select Yes/ No</option>
 <option>Yes</option>
 <option>No</option>
 </select></td>
</tr>

<tr> 
  <td nowrap  width="164" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>6. Feasible to Supply
    &nbsp;</b></font></td>
    <td> <select name="feasible">
 <option selected>Select Yes/ No</option>
 <option>Yes</option>
 <option>No</option>
 </select></td>
</tr>

 
   <tr> 
    <td align="right" ><font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Confirm</b></font></td>
    <td> <input type="radio"    onKeyPress="return event.keyCode!=13"   name="confirm" value = "No" checked> <font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>No 
    </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio"    onKeyPress="return event.keyCode!=13"   name="confirm" value = "Yes"> <font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Yes
      </b></font>&nbsp;</td>
  </tr>  

 </table>
  
  <table cellpading=0 cellspacing=10 width= 50>
    <tr> 
      <td> <blockquote> <input type =submit name="submit" value = "Submit"></td></blockquote>
  </table>
</table>

<br><font size=1><center><a href= "index.html">Return to index page</a></center></font>
</body></form>

