<?php 
include("../../include/dbconnect.php");
?>
<script  type="text/javascript" language="javascript">
function addNumbers()
{
//var val1 = parseInt(document.getElementById("blankval").value);
var val1 = parseFloat(document.getElementById("blankval").value);
var val2 = parseFloat(document.getElementById("piercval").value);
var val3 = parseFloat(document.getElementById("formval").value);
var val4 = parseFloat(document.getElementById("blendval").value);
var val5 = parseFloat(document.getElementById("tools1val").value);
var val6 = parseFloat(document.getElementById("tools2val").value);
var ansD = document.getElementById("total");
ansD.value = val1 + val2 + val3 + val4 + val5 + val6 ;
}
function addnum()
{
var val1 = parseFloat(document.getElementById("rawcost").value);
var val2 = parseFloat(document.getElementById("processcost").value);
var val3 = parseFloat(document.getElementById("admnexp").value);
var ansD = document.getElementById("totcost");
ansD.value = val1 + val2 + val3;
}
function add_num()
{
alert ("hai");
var val1 = parseFloat(document.getElementById("procstripval").value);
var val2 = parseFloat(document.getElementById("procblankval").value);
var val3 = parseFloat(document.getElementById("procburrval").value);
var val4 = parseFloat(document.getElementById("procpierval").value);
var val5 = parseFloat(document.getElementById("procformval").value);
var val6 = parseFloat(document.getElementById("procbendval").value);
var val7 = parseFloat(document.getElementById("procflatval").value);
var val8 = parseFloat(document.getElementById("prochardval").value);
var val9 = parseFloat(document.getElementById("procfinishval").value);
var val10 = parseFloat(document.getElementById("procinsval").value);
var ansD = document.getElementById("totprocs");
ansD.value = val1 + val2 + val3 + val4 + val5 + val6 + val7 + val8 + val9 + val10;
}
</script>


<title> Schedules Edit</title>
<body bgcolor="#ffffff"  topmargin=0>
<center>
<table cellpadding=0 cellspacing=4 width=590>
<tr>
<td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font >Tools Cost edit</font></td>
</tr><tr valign="top"><td colspan=2>
<font >&nbsp;</font>
</td>
</tr>
</table>
<table border="1" cellspacing="1" cellpadding="3" align="center" width="600" bgcolor="#999999">
        
<form name="form1" method="POST"  action="update.php?record=<?echo($record);?>">

<?php 

$result = mysql_query("SELECT distinct record, bcode, enquiry_refno, enquiry_refdt, drawing_no, prodname, cost_refno, cost_refdt,  rawdraw, rawoffer, rawsize, rawwgt, rawrate, rawqty, toolslife, blanktxt, blankval, pierctxt, piercval, formtxt, formval, blendtxt, blendval, tools1txt, tools1val, tools2txt, tools2val, procstriptxt, procstripval, procblanktxt, procblankval, procburrtxt, procburrval, procpiertxt, procpierval, procformtxt, procformval, procbendtxt, procbendval, procflattxt, procflatval, prochardtxt, prochardval, procfinishtxt, procfinishval, procinstxt, procinsval, tlcost, rawcost, processcost, admnexp, remarks, appby FROM toolscost WHERE  record ='$record'") or die(mysql_error());

 $row1=mysql_fetch_row($result);
?>

<input type="hidden" name="record" value="<? echo($row1[0]); ?>">


<table border=2 cellspacing=1 cellpadding=1>
<tr>
<td>  <font color="#003366" size="3" face="Verdana, Arial, Helvetica, sans-serif"><b>RAW MATERIALS  </b></font></td>
<td> </td>
<td><font color="#003366" size="3" face="Verdana, Arial, Helvetica, sans-serif"><b>TOOL COST</b></font></td>
</tr>


<tr>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Raw Materials as per Drawing </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="rawdraw" value = <?php echo("'$row1[8]'");?> > </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool - Blanking </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="blanktxt" value = <?php echo("'$row1[15]'");?>> </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="blankval" value = <?php echo("'$row1[16]'");?> > </td>
</tr>


<tr>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Raw Material Offered </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="rawoffer" value =<?php echo("'$row1[9]'");?> ></td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool - Piercing </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="pierctxt" value = <?php echo("'$row1[17]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="piercval" value = <?php echo("'$row1[18]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Raw Material in Size </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="rawsize" value =<?php echo("'$row1[10]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool - Forming </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="formtxt" value = <?php echo("'$row1[19]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="formval" value = <?php echo("'$row1[20]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Component Weight </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="rawwgt" value = <?php echo("'$row1[11]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool - Blending </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="blendtxt" value = <?php echo("'$row1[21]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="blendval" value = <?php echo("'$row1[22]'");?> > </td>
</tr>


<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Raw Material Rate</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="rawrate" value =<?php echo("'$row1[12]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="tools1txt" value = <?php echo("'$row1[23]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="tools1val" value = <?php echo("'$row1[24]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
Component Qty / Month</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="rawqty" value =<?php echo("'$row1[13]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="tools2txt" value = <?php echo("'$row1[25]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="tools2val" value = <?php echo("'$row1[26]'");?> > </td>
</tr>


<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tools Life</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="toolslife" value =<?php echo("'$row1[14]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">TOTAL </font></td>
<td  bgcolor="#FFFFFF">
 </td>
<td  bgcolor="#FFFFFF">
<input type="text"  onKeyPress="return event.keyCode!=13" size='10' id="total" name="total" onFocus="javascript:addNumbers()" value="" > </td>
</tr>
</table>




<p>&nbsp;</p>
<table border=2 cellspacing=1 cellpadding=1>
<tr>
<td width="170">  <font color="#003366" size="3" face="Verdana, Arial, Helvetica, sans-serif"><b>COSTING  </b></font></td>
<td width="60"> </td>
<td width="187"><font color="#003366" size="3" face="Verdana, Arial, Helvetica, sans-serif"><b>PROCESS COST</b></font></td>
</tr>


<tr>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Tool Cost </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="tlcost" value = <?php echo("'$row1[47]'");?> > </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Stripping </font></td>
<td width="120"  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procstriptxt" value = <?php echo("'$row1[27]'");?> > </td>
<td width="84"  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procstripval" value = <?php echo("'$row1[28]'");?> > </td>
</tr>


<tr>
<td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Blanking </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procblanktxt" value = <?php echo("'$row1[29]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procblankval" value =<?php echo("'$row1[30]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Burr Cleaning & correction </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procburrtxt" value = <?php echo("'$row1[31]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procburrval" value = <?php echo("'$row1[32]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Raw Material Cost </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="rawcost" value = <?php echo("'$row1[48]'");?> >  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Piercing </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procpiertxt" value = <?php echo("'$row1[33]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procpierval" value = <?php echo("'$row1[34]'");?> > </td>
</tr>


<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Process Cost</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="processcost" value = <?php echo("'$row1[49]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Forming </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procformtxt" value = <?php echo("'$row1[35]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procformval" value = <?php echo("'$row1[36]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
Admn. Expenses/Margin</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="admnexp" value = <?php echo("'$row1[50]'");?>>  </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Bending </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procbendtxt" value = <?php echo("'$row1[37]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procbendval" value = <?php echo("'$row1[38]'");?> > </td>
</tr>


<tr><td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"> </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Flatening </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procflattxt" value = <?php echo("'$row1[39]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procflatval" value = <?php echo("'$row1[40]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"> </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Hardening & Tempering </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="prochardtxt" value = <?php echo("'$row1[41]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="prochardval" value = <?php echo("'$row1[42]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"> </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Finishing </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procfinishtxt" value = <?php echo("'$row1[43]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procfinishval" value = <?php echo("'$row1[44]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF"> </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">Inspection </font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='20' name="procinstxt" value = <?php echo("'$row1[45]'");?> > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procinsval" value = <?php echo("'$row1[46]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
TOTAL</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"  onKeyPress="return event.keyCode!=13" size='10' id="totcost" name="totcost" onFocus="javascript:addnum()" value="" > </td>
<td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">TOTAL </font></td>
<td  bgcolor="#FFFFFF"></td>
<td  bgcolor="#FFFFFF">
<input type="text"  onKeyPress="return event.keyCode!=13" size='10' id="totprocs" name="totprocs" onFocus="javascript:add_num()" value="" > </td>
</tr>

</table>

<p>&nbsp;</p>
<table>
<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
REMARKS</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='50' name="remarks" value = <?php echo("'$row1[51]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
Approved By</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='5' name="appby" value = <?php echo("'$row1[52]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
Ref No</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='15' name="cost_refno" value = <?php echo("'$row1[6]'");?> > </td>
</tr>

<tr><td  bgcolor="#FFFFFF"><font class="sbd" face="Arial, Helvetica, sans-serif"  color="#0033FF">
Date</font></td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='5' name="cost_refdt" value = <?php echo("'$row1[7]'");?> > </td>
</tr>
</table>
</table>


<table>
<tr>
<td align=right>
<blockquote>  
<input  type =submit name=submit value = "Update"></td> 
<td><input type =submit name=submit value = "Delete"></td>
</blockquote>
</table>

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