View Single Post
Old 01-25-2013, 08:43 PM   PM User | #1
afi ali
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
afi ali is an unknown quantity at this point
pass the value between two table

im develop a transaction function here. as you can see below, there are two tables. which is the first one is for display the item and the second table is for purchasing. what i want to do is, the row for item in first table is clickable. as the row is click, the item that have been choose come out in the second table. and at the second table cell for discount can be editable and the total price is changing by the discount. is anyone can help me how to pass the value between the two table?

Code:
<fieldset>
<legend>Item Show</legend>
<table border="1">
<tr>
  <td>Item Name</td>
    <td>Item Code</td>
    <td>Manufacturer</td>
    <td>Price</td>
    <td>Stock</td>
</tr>
<?php
while($row = mysql_fetch_array($result))
  {
?>
<tr>
  <td><?php echo $row['item_name']; ?></td>
    <td><?php echo $row['item_code']; ?></td>
    <td><?php echo $row['item_manufacturer']; ?></td>
    <td><?php echo $row['sell_price']; ?></td>
    <td><?php echo $row['stock']; ?></td>
</tr>
<?php
}
?>
</table>
</fieldset>

<fieldset>
<legend>Item Sale</legend>
<table border="1">
<tr>
  <td>Item name</td>
    <td>Item Code</td>
    <td>Stock</td>
    <td>Price</td>
    <td>Quantity</td>
    <td>Discount</td>
    <td>Total Price</td>
</tr>
</table>
</fieldset>
afi ali is offline   Reply With Quote