I have a PHP page displaying the results of a MySQL query.
The User can change the quantity Intended input and by clicking on Get Total
Button, user can see the result of Item Rate * Qty Intended
. So, that total
can be used for creating a voucher for the user.
Can anybody guide me on how to add this functionality to my existing page.
My code currently is shown below:
<?php
include 'functions.php'; //for connection
?>
<table>
<tr>
<th>Select</font></th>
<th>Item Desc</th>
<th>Item Specification</th>
<th>Item Rate</th>
<th>Qty Intented</th>
</tr>
<?php
$sql1 = mysql_query("SELECT * from item
where item ='stationeries'")
while ($row = mysql_fetch_array($sql1, MYSQL_ASSOC)) {
?>
<tr>
<td><input type="checkbox" name="sel" /></td>
<td><?php echo $row['item']; ?></td>
<td><?php echo $row['specification']; ?></td>
<td><?php echo $row['rate']; ?></td>
<td><input type="text" name="qty" class="toAdd" id="qty" value="0.0" /></td>
</tr>
<?php
}
?>
</table><br />
<input type="button" value="Get Total" />
<input type="text" id="total" />