[eluser]vincej[/eluser]
Hi - I have an order form with products on each line. It has a combination of POST variables which can be easily Posted up to my controller up but also some straight variables - see View:
Code:
<?php foreach ( $_SESSION['openorders'] as $key=>$value) { ?>
<tr align="center">
<td width="30"><?php $data=array('name' =>'quantity','value'=>$value['quantity']); echo form_input($data); ?></td> //POST VARIABLE
<td><?php echo $value['prodid']; ?></td> // STRAIGHT VARIABLES
<td><?php echo $value['name'];?></td>
<td><?php echo $value['ordervalue']; ?></td>
<td><?php echo $value['pricelb']; ?></td>
<td align="right"><?php echo form_checkbox('delete','delete',FALSE); // POST VARIABLES
$data = array(
'orderid' => $value['orderid'],
'productid'=> $value['prodid'],
'name'=>$value['name'],
);
echo form_hidden($data);
$totalordervalue += $value['ordervalue'];
} ?>
</td>
</tr>
<tr><td></td><td></td><td><?php echo "Total Unweighed Order Value: $";?></td>
<td><?php echo $totalordervalue; ?></td>
</tr>
</table> <br/>
<?php
echo form_submit('submit','Update and Submit to Picking >> ');
echo form_close();
My code loops through the $_Session['openorders'] building the page - great.
I now modify the quantities.
I need recommendations on what is the best way of getting
all the variables for each product line packed up into some kind of array so I can process them.
I thought of using hidden values and POSTING them to the controller - but what is the best way of getting them into an array ?
Many Thanks for your advice !