<?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 >Costing Sheet</font></td>
</tr><tr valign="top"><td colspan=2>
<font >&nbsp;</font>
</td>
</tr>
</table>
        
<form name="form1" method="POST"  action="costupd.php?record=<? echo($record);?>">
<?php 

$result = mysql_query("select distinct enquiry.record, enquiry.enquiry_refno, enquiry.enquiry_refdt, enquiry.tools_cost, enquiry.bcode, enquiry.prodcode FROM enquiry where record ='$record'") or die(mysql_error());
 $row1=mysql_fetch_row($result);
 
?>
<input type="hidden" name="record" value="<? echo($row1[0]); ?>">
<input type="hidden" name="enqrefno" value="<? echo($row1[1]); ?>">
<input type="hidden" name="enqrefdt" value="<? echo($row1[2]); ?>">
<input type="hidden" name="tools_cost" value="<? echo($row1[3]); ?>">
<input type="hidden" name="bcode" value="<? echo($row1[4]); ?>">
<input type="hidden" name="prodcode" value="<? echo($row1[5]); ?>">
<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 = '' > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="blankval" value = 0.00 > </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 ='' ></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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="piercval" value = 0.00 > </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 =''>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="formval" value = 0.00 > </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 = ''>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="blendval" value = 0.00 > </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 =''>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="tools1val" value = 0.00 > </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 =''>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="tools2val" value = 0.00 > </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 =''>  </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 = 0.0 > </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 = '' > </td>
<td width="84"  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procstripval" value = 0.00 > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procblankval" value =0.00 > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procburrval" value = 0.00 > </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 = 0.00>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procpierval" value = 0.00 > </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 = 0.00>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procformval" value = 0.00 > </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 = 0.00>  </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procbendval" value = 0.00 > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procflatval" value = 0.00 > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="prochardval" value = 0.00 > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procfinishval" value = 0.00 > </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 = '' > </td>
<td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size='10' name="procinsval" value = 0.00 > </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 = '' > </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 = '' > </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 = '' > </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 = '' > </td>
</tr>
</table>



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


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