<?php include("../../include/dbconnect.php"); 
//echo "ccc" . "$enqrefdt";
//echo " ref " . "$enquiry_refno";
$enquiry_refdt = substr($sdt,6,4).'-'.substr($sdt,3,2).'-'.substr($sdt,0,2);
$quot_sub_dt = substr($qsubdt,6,4).'-'.substr($qsubdt,3,2).'-'.substr($qsubdt,0,2);
$quot_refdt = substr($qrefdt,6,4).'-'.substr($qrefdt,3,2).'-'.substr($qrefdt,0,2);
$order_sub_dt = substr($odt,6,4).'-'.substr($odt,3,2).'-'.substr($odt,0,2);
$sample_give_dt = substr($srefdt,6,4).'-'.substr($srefdt,3,2).'-'.substr($srefdt,0,2);
$amend_dt = substr($amddt,6,4).'-'.substr($amddt,3,2).'-'.substr($amddt,0,2);
//echo "$enquiry_refdt";
if ( isset($submit) && $submit == "Update")
{
   $result=mysql_query("update enquiry set enquiry_refno='$enquiry_refno', enquiry_refdt='$enquiry_refdt', enquiry_open='$enquiry_open', tools_cost='$tools_cost', quot_sub_dt='$quot_sub_dt', quot_refno='$quot_refno', quot_refdt='$quot_refdt', quot_rev_by='$quot_rev_by', order_sub_dt='$order_sub_dt', diff_order_quot='$diff_order_quot', details_cus='$details_cus', order_refno='$order_refno', sample_give_dt='$sample_give_dt', approv_by='$approv_by', amend_dt='$amend_dt', amend_details='$amend_details', amend_comm='$amend_comm' where record='$record'") or   die(mysql_error());
?>
<br>
<meta http-equiv="refresh" content="0 url=index.html">
</body></form>
<?
}
elseif (isset($submit) && $submit == "Delete")
{
$result=mysql_query("delete from enquiry where record='$record'") or die(mysql_error());
?>
<meta http-equiv="refresh" content="0 url=../../index.html">
</body></form>
<?
}
if (isset($submit) && $submit == "Print")
{
$result = mysql_query("select distinct enquiry.record, enquiry.bcode, buy.name, buy.address1, buy.address2, buy.city, enquiry.prodcode, product.prodname, enquiry.drawing_no, enquiry.enquiry_refno, enquiry.enquiry_refdt, enquiry.qty, enquiry.sample, enquiry.tools, enquiry.feasible, enquiry.enquiry_open, enquiry.tools_cost, enquiry.quot_sub_dt, enquiry.quot_refno, enquiry.quot_refdt, enquiry.quot_rev_by, enquiry.order_sub_dt, enquiry.diff_order_quot, enquiry.Details_cus, enquiry.order_refno, enquiry.sample_give_dt, enquiry.approv_by, enquiry.amend_dt, enquiry.amend_details, enquiry.amend_comm
 FROM enquiry, buy, product WHERE  enquiry.record='$record' and (enquiry.bcode = buy.bcode) and  (enquiry.prodcode= product.prodcode)  group by enquiry.record order by enquiry_refno,enquiry_refdt ") or die(mysql_error());
  $row1=mysql_fetch_row($result);
?>
<table border=0   width="620">
<body>
<hr align = left width = 620 >
</hr>
</body>
<tr> 
<td><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>WILSON PRESS TOOLS </b></font></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>CONTRACT REVIEW </b></font></td>
<td ><font face="Verdana, Arial, Helvetica, sans-serif"><b> Ref No  &nbsp;</b></font></td>
<td> <?php echo("$row1[9]");?>  </td></tr>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>Coimbatore </b></font></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>Checklist </b></font></td>
<td ><font face="Verdana, Arial, Helvetica, sans-serif"><b>Date  &nbsp;</b></font></td>
<td> <?php echo("$row1[10]");?>  </td></tr>
</tr>

</table>

<body>
<hr align = left width = 620 >
</hr>
</body>
<table border=0 width="620">
<tr>
<td  height="40" align="left"  ><font  face="Verdana, Arial, Helvetica, sans-serif">1. Customer Name & Address  &nbsp;</font></td>
<td> <?php echo(" :   " . "$row1[2]");?>  </td></tr>
<td width="139"  align="left" </td>
<td> <?php  echo(" :   " . "$row1[3]");?>  </td></tr>
<td width="139" align="left" </td>
<td> <?php echo(" :   " . "$row1[4]");?>  </td>
</tr>

<tr>
<td  height="40" align="left" ><font  face="Verdana, Arial, Helvetica, sans-serif">2. Product Name  &nbsp;</font></td>
<td> <?php  echo(" :  " . "$row1[7]");?>  </td>
</tr>

<tr > 
<td  height="40" align="left"  ><font face="Verdana, Arial, Helvetica, sans-serif">3. Quantity  &nbsp;</font></td>
<td><?php echo (" :  " . "$row1[11]") ?> </td>
</tr>

<tr> 
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">4. Sample / Drawings given by customer &nbsp;</font></td>
<td> <?php echo (" :  " . "$row1[12]") ?></td>
</tr>

<tr> 
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica,sans-serif">5. Tools given by customer &nbsp;</font></td>
<td> <?php echo (" :  " . "$row1[13]") ?>  </td>
</tr>

<tr > 
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">6. Tools Developed by Wilson &nbsp;</font></td>
<td> <?php echo (" :  " . "$row1[16]") ?> </td></tr>

<tr>
<td  height="40" align="left"  ><font face="Verdana, Arial, Helvetica, sans-serif">7. Quotation to be Submitted on(date)</font></td>
<td><?php echo(" :  " .  "$row1[17]" );?>  </td>
</tr>

<tr>
<td  height="40" align="left" ><font  face="Verdana, Arial, Helvetica, sans-serif">8. Feasible to supply </font></td>
<td> <?php echo (" :  " . "$row1[14]")?> </td>
</tr>

<tr>
<td width="139"  align="left" </td>
<td  width="300"  align="right" ><font  face="Verdana, Arial, Helvetica, sans-serif">Prepared By </font></td>
</tr>
</table>
<body>
<hr align = left width = 620 >
</hr>
</body>

<table border=0 width="620">
<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">9. Quotation Ref No. & Date </font></td>
<td><?php echo(" :  " . "$row1[18]" . "    " . "$row1[19]"  );?>  </td>
</tr>

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">10. Reviewed By </font></td>
<td> <?php echo(" :  " . "$row1[20]");?>  </td>
</tr>

<tr>
<td width="139" align="left" </td>
<td  width="300"  align="right" ><font  face="Verdana, Arial, Helvetica, sans-serif">Manager (Sales) </font></td>
</tr>
</table>
<body>
<hr align = left width = 620 >
</hr>
</body>
<table border=0 width="602">

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">11. Order Acceptance received on </font></td>
<td> <?php echo(" :  " . "$row1[21]");?>  </td>
</tr>

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">12. Difference between order / Quotation </font></td>
<td> <?php echo(" :  " . "$row1[22]");?> </td>
</tr>

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">13. Details of resolution with customer (regret)</font></td>
<td><?php echo(" :  " . "$row1[23]");?> </td>
</tr>

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">14. Order.ref </b></font></td>
<td><?php echo(" :  " . "$row1[24]");?>  </td>
</tr>

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">15. Sample should be given on </font></td>
<td><?php echo(" :  " . "$row1[25]");?> </td>
</tr>

<tr>
<td  height="40" align="left" ><font face="Verdana, Arial, Helvetica, sans-serif">16. Reviewed and Approved by</font></td>
<td><?php echo(" :  " . "'$row1[26]'");?>  </td>
</tr>
</table>
<body>
<hr align = left width = 620 >
</hr>
</body>
<table border=0 width="602">
<h3 align="center"> AMEDEMENT DETAILS </h3>
<table>
<table border=1 cellpadding="10"  width="602">

<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif">Date </font></td>
<td ><font face="Verdana, Arial, Helvetica, sans-serif">Details of Amendment</font></td>
<td ><font face="Verdana, Arial, Helvetica, sans-serif">Communicated to </font></td>

</tr>
<tr>
<td>  <textarea name="amddt" cols="20" onKeyPress="return event.keyCode!=13"><?php echo("$row1[27]");?></textarea>  </td>
<td><textarea name="amend_details" cols="20" onKeyPress="return event.keyCode!=13"><?php echo("$row1[28]");?></textarea>  </td>
<td><textarea name="amend_details" cols="20" onKeyPress="return event.keyCode!=13"><?php echo("$row1[29]");?></textarea>  </td>
</tr>

<?
}
?>
