<?php include("../../include/dbconnect.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>
<script language="javascript">
function addone()
{
var a = parseFloat(document.getElementById("h1").value);
var b=parseFloat(document.getElementById("h2").value);
var c=parseFloat(document.getElementById("h3").value);
var d=parseFloat(document.getElementById("h4").value);
var e = a + b + c + d;
document.getElementById("h5").value=e;
 
}
</script>
<script language="javascript">
function add()
{
var f=parseFloat(document.getElementById("h5").value);
var g=parseFloat(document.getElementById("h6").value);
var h =  f - g ;
document.getElementById("h7").value=h;
}
</script>
</head>
<body>
<?
$coquery = mysql_query("SELECT name, address1, address2, city, pin, std, telno, fax, email from company")or die( mysql_error() );
$row0 = mysql_fetch_row($coquery);
$temp = $row0[1] ."," .  $row0[2] ."," . $row0[3] ."-" . $row0[4]; 
$temp1 = "Phone : " . $row0[5] ."-" .  $row0[6] . "  Fax : " . "$row0[5]" . "-" .  $row0[7];
$temp2 = "Email : " . $row0[8] ;
?>
<table width="700" >
<tr><div align="center"><h2><em><? echo "$row0[0]"?>  </em></h2></div></tr>
<tr><div align="center"><? echo "$temp" ?>  </div></tr>
<tr><div align="center"><? echo "$temp1" ?>  </div></tr>
<tr><div align="center"><? echo "$temp2" ?>  </div></tr>
</table>
 <form name="myForm02" method="Post"  action="editsave.php">
<?php 
//echo "rec" . "$record";

$query = mysql_query("SELECT  distinct record, bcode,  quot_refno, quot_refdt, attn, yr_refno, yr_refdt, enquiry_refno, enquiry_refdt, prodcode, drawing_no, prodname, rawoffer, rawrate, rawcost, invper, invcost, processcost, admnexp, scrapcost, tlcost, delperiod, st, exduty, pandf, payterms, price, subtot, tot, rawwgt FROM quotation WHERE record ='$record'") or die( mysql_error() );;

//$result1=mysql_query($query) or die('Queryproblem: ' . mysql_error() . '<br />Executed query: ' . $query);

$row3=mysql_fetch_row($query);

$bkquery = mysql_query("SELECT bcode, prodname, drawing_no, prodcode
FROM product WHERE prodcode = '$row3[2]' AND bcode = '$row3[1]'")or die( mysql_error() );
$row2 = mysql_fetch_row($bkquery);

$stQuery = mysql_query("select bcode,name,unit, address1, address2, city, buyertype from buy  where bcode= '$row3[1]' order by name")or die( mysql_error() );
$row1 = mysql_fetch_row($stQuery);

?>
<input type="hidden" name="enqrefno" value="<? echo($row3[4]); ?>">
<input type="hidden" name="enqrefdt" value="<? echo($row3[5]); ?>">
<input type="hidden" name="rec" value="<? echo($row3[0]); ?>">
<input type="hidden" name="prodcode" value="<? echo($row3[9]); ?>">
<input type="hidden" name="bcode" value="<? echo($row3[1]); ?>">

<SCRIPT LANGUAGE="JavaScript" src="../../include/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
<?
if ($row3[3]==0)
{
  $sdt=substr($row3[3],8,2).'/'.substr($row3[3],5,2).'/'.substr($row3[3],0,4);
}
else
{
$refdt = $row3[3];
$sdt = substr($refdt,8,2).'/'.substr($refdt,5,2).'/'.substr($refdt,0,4);
}

//if(empty($sdt))
//{
//  $sdt=strftime ("%d/%m/%Y", mktime (0,0,0,date("m"),date("d"),date("Y"))); 
//}
?>
<table width="700"  bordercolordark="#000000"bordercolor="#000000" border=3>
<tr> <td width="338">To</td>
<td width="342" height="29" align="center" valign="middle" ><h2>Quotation</h2></td>
</tr>
</table>
<table width="700"  bordercolordark="#000000"bordercolor="#000000" border=3>
<tr>
<td>M/s.<INPUT  VALUE="<?=$row1[1]?>" size="40" readonly  ></td>
<td >Quotation No :</td><td width="208"><input name="quot_refno" type="text" value="<? echo($row3[2]); ?>"></td>
</tr>
<tr>

<td><INPUT  VALUE="<?=$row1[2]?>" size="45" readonly ></td>
<td>Quotation Date :</td><td><INPUT NAME="sdt" TYPE="text" class="text_box_button" VALUE="<? echo($sdt); ?>"SIZE="12" 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>
<tr>
<td> <INPUT  VALUE="<?=$row1[3]?>"  size="45"readonly ></td>
<td>Kind Attn : </td><td><input type="text" name="attn" value="<? echo($row3[4]); ?>"></td>
</tr>
<tr>
<td><INPUT  VALUE="<?=$row1[4]?>" size="45" readonly>  </td>
<td>Your Ref :</td><td> <input type="text"    onKeyPress="return event.keyCode!=13"   name="yr_refno"  value= "<? echo($row3[5]); ?>" > </td>
</tr>
   <?
if ($row3[6]==0)
{
  $sdt=substr($row3[6],8,2).'/'.substr($row3[6],5,2).'/'.substr($row3[6],0,4);
}
else
{
$refdt = $row3[6];
$ydt = substr($refdt,8,2).'/'.substr($refdt,5,2).'/'.substr($refdt,0,4);
}
//$ydt = date(d).'/'.date(m).'/'.date(Y); 
?>
<tr><td></td>
<td>Date : </td><td><INPUT NAME="ydt" TYPE="text" class="text_box_button" VALUE="<? echo($ydt); ?>" SIZE="15" readonly> <A HREF="#" onClick="cal.select(document.myForm02.ydt,'anchor1','dd/MM/yyyy'); return false;"NAME="anchor1" ID="anchor1"><img  src="../../images/cal.gif" border="0"></A> <BR>
</td>
</tr>
</table>

<table width="700" >
<tr><td>We thank you very much for your enquiry,</td></tr>
<tr><td>We offer below our lowest rate, which will be most competive and acceptable to you</td></tr>
</table>
<table width="700" border=1>
 <tr>
  <td width=47 valign=top style='width:35.15pt;border:solid windowtext 1.0pt;
  border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal>S.No</p>  </td>
  <td width=128 valign=top style='width:96.15pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal>DRAWING NO</p>  </td>
  <td width=200 colspan=3 valign=top style='width:150.1pt;border-top:none;
  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal>DESCRIPTION</p>  </td>
  <td width=97 valign=top style='width:72.8pt;border-top:none;border-left:none;
  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal>MATERIAL OFFERED</p>  </td>
  <td width=118 valign=top style='width:88.6pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal>PRICE / UNIT Rs.</p>  </td>
 </tr>
 <tr style='height:260.5pt'>
  <td width=47 valign=top style='width:35.15pt;border:solid windowtext 1.0pt;
  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:260.5pt'>
  <p class=MsoNormal> <INPUT  VALUE="1" size="5" readonly  >&nbsp;</p>  </td>
  <td width=128 valign=top style='width:96.15pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt;height:260.5pt'>
  <p class=MsoNormal><INPUT  VALUE="<?=$row3[10]?>" name= "drawing_no" readonly> &nbsp;</p>  </td>
  <td width=200 colspan=3 valign=top style='width:150.1pt;border-top:none;
  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt;height:260.5pt'>
  <p class=MsoNormal> <INPUT  VALUE="<?=$row3[11]?>" name="prodname" readonly>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  </td>
  <td width=97 valign=top style='width:72.8pt;border-top:none;border-left:none;
  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt;height:260.5pt'>
  <p class=MsoNormal><input type="text" name="rawoffer" value="<?=$row3[12]?>"  size="15"></p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal>&nbsp;</p>
  <p class=MsoNormal> </p>
  <p class=MsoNormal>
  <p class=MsoNormal>&nbsp;</p>
      <p class=MsoNormal>&nbsp;</p>  </td>
  <td width=118 valign=top style='width:88.6pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0in 5.4pt 0in 5.4pt;height:260.5pt'>
  <p class=MsoNormal>  <input type="text"    onKeyPress="return event.keyCode!=13"   name="price"  value= "<? echo($row3[26]); ?>" >&nbsp;</p>  </td>
 </tr>
</table>
<table width="705"  frame="box"cellspacing=0 cellpadding=0>

<tr>
<td width="111"> Delivery Period :</td>
<td width="239"> <input type="text" name="delperiod" value="<? echo($row3[21]); ?>"size="35" > </td>
<td width="348">Thanking You</td>
</tr>
<tr>
<td width="111"> Sales Tax :</td>
<td width="239"><input type="text" name="st" value="<? echo($row3[22]); ?>"  size="35"> </td>
<td width="348">Yours Faithfully,</td>
</tr>
<tr>
<td width="111"> Excise Duty :</td>
<td width="239"><input type="text" name="exduty"  value="<? echo($row3[23]); ?>" size="35"> </td>
<td width="348">For Wilson Press Tools</td>
</tr>
<tr>
<td width="111">P & F Charges :</td>
<td width="239"><input type="text" name="pandf" value="<? echo($row3[24]); ?>"size="35"> </td>
<td width="348"></td>
</tr>
<tr>
<td width="111">Payment Terms :</td>
<td width="239"><input type="text" name="payterms" value="<? echo($row3[25]); ?>" > </td>
<td width="348">Authorised Signatory</td>
</tr>
</table>
<table width="705" border=1>
<tr><td>
SPECIALISTS IN TOOLINGS / SHEETMETAL BLANKINGS / FORMINGS AND PRESSED COMPONENTS
</td></tr>

</div>
</form>
</html>




<body>
</body>
</html>
