PDA

View Full Version : Material Order Form



Jay Dog
01-22-2013, 04:13 PM
Hiya,

this is an order form that I have been working on based on a cake sample I found:

http://www.bigwood.nottingham.sch.uk/VLE/frame.html

The problem is that I want to set up the table so that instead of Quantity I put in Length I have another column called Width and the children can input a value for LENGTH and WIDTH but I will have a specific number for the value of the area.

Say they put in 100 for length, 200 for width and I will already have a formula for the value of per square millimetre.

and here is the code:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Mini Monster Costing</title>
<link rel="stylesheet" href="/css/page_v2a.css" />
<script src="/lib/js/page_v2.js" type="text/javascript"></script>
<link rel="stylesheet" href="ex.css" type="text/css" />
<script src="validation.js" type="text/javascript"></script>
<script src="ex1.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
var PRODUCT_ABBRS = ["choc_cake","carrot_cake","cheese_cake","banana_bread"];
// ]]>
</script>
</head>
<body>



<div id="container">
<div id="main">
<div id="content">
<div id="text">


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">&nbsp;</td>
<td align="left" valign="middle">My name is:</td>
<td align="right" valign="middle">&nbsp;</td>
<td align="left" valign="middle">My teacher is:</td>
<td align="right" valign="middle">&nbsp;</td>
<td align="left" valign="middle">My class is:</td>
</tr>
<tr>
<td width="5%" align="center" valign="middle">&nbsp;</td>
<td width="34%" align="left" valign="middle"><input name="name" type="text" id="name" style="width:220px;" /></td>
<td width="12%" align="right" valign="middle">&nbsp;</td>
<td width="23%" align="left" valign="middle"><select name="teacher" id="teacher">
<option value=""></option>
<option value="Mr Booth">Mr Booth</option>
<option value="Mr Gilkerson">Mr Gilkerson</option>
<option value="Mr Hayes">Mr Hayes</option>
<option value="Ms Kandola">Ms Kandola</option>
<option value="Mrs Perry">Mrs Perry</option>


</select></td>
<td width="13%" align="right" valign="middle">&nbsp;</td>
<td width="13%" align="left" valign="middle"><select name="class" id="class">

<option value=""></option>
<option value="7A1">7A1</option>
<option value="7A2">7A2</option>
<option value="7A3">7A3</option>
<option value="7A4">7A4</option>
<option value="7B1">7B1</option>
<option value="7B2">7B2</option>
<option value="7B3">7B3</option>
<option value="7B4">7B4</option>

</select>
</form></td>
</tr>
<tr>
<td colspan="6" align="center" valign="middle"><h1>Picture Frame Costing</h1></td>
</tr>
<tr>
<td colspan="6" align="center" valign="middle"><img src="picture frame cost.png" alt="" width="400" height="279" /></td>
</tr>
</table>

<form action="../ex1_result.php" method="post" onsubmit="return finalCheck(this)">
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" class="display">
<tr>
<th width="30%" class="first">Product</th>
<th width="29%" align="center">Price</th>
<th width="26%" align="center">&nbsp;</th>
<th width="26%" align="center">Quantity / Size</th>
<th width="15%" align="center">Totals</th>
</tr>
<tr>
<td>3mm Acrylic</td>
<td align="left" class="cur">17.70/m<sup>2</sup>
<input type="hidden" name="choc_cake_price" value="0.00123" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="choc_cake_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="choc_cake_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td>20mm thick pine</td>
<td align="left" class="cur">0.4/m<input name="carrot_cake_price" type="hidden" value="0.0025" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="carrot_cake_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="carrot_cake_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td>6mm thick plywood</td>
<td align="left" class="cur">0.2/m<input type="hidden" name="cheese_cake_price" value="0.116" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="cheese_cake_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="cheese_cake_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td>Aluminium collars</td>
<td align="left" class="cur">1.62 /m
<input type="hidden" name="banana_bread_price" value="0.00162" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="banana_bread_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="banana_bread_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td>Nuts</td>
<td align="left" class="cur">0.90 / 100
<input type="hidden" name="nuts_price" value="0.009" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="nuts_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="nuts_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td>Bolts</td>
<td align="left" class="cur">8.77 / 100
<input type="hidden" name="bolts_price" value="0.0877" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="bolts_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="bolts_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td>Finish*</td>
<td align="left" class="cur">9.99 / 75ml
<input type="hidden" name="2banana_bread_price" value="0.10" /></td>
<td align="center" class="qty">&nbsp;</td>
<td align="center" class="qty"><input type="text" name="2banana_bread_qty" value="0" size="4" class="cur" onchange="getProductTotal(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" /></td>
<td align="center"><input type="text" name="2banana_bread_tot" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td></td>
<td align="center"></td>
<td align="center" class="total">&nbsp;</td>
<td align="center" class="total">Total: </td>
<td align="center"><input type="text" name="total" value="0" readonly="readonly" size="8" class="cur" /></td>
</tr>
<tr>
<td></td>
<td><input type="button"
onClick="window.print()"
value="Print This Page"/></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</form>
<center>
* Finish is always 1
</center>
<p>&nbsp;</p>


</div> <!-- end text -->
</div> <!-- end content --><!-- end sidebar -->
<div class="clearer"></div>
</div> <!-- end main -->
<div id="footer">
<div id="copyright"></div>
</div>

</div> <!-- end container div -->

</body>
</html>

vwphillips
01-23-2013, 06:27 AM
this should help
http://www.dynamicdrive.com/forums/showthread.php?72647-Working-out-values-of-materials