I'm stuck with the following code:\[code\] <?php if ($orders) { ?> <?php foreach ($orders as $order) { ?> <tr> <td style="text-align: center;"><?php if ($order['selected']) { ?> <input type="checkbox" name="selected[]" value="http://stackoverflow.com/questions/15702156/<?php echo $order['order_id']; ?>" checked="checked" class="trigger"/> <?php } else { ?> <input type="checkbox" name="selected[]" value="http://stackoverflow.com/questions/15702156/<?php echo $order['order_id']; ?>" class="trigger" /> <?php } ?></td> <td class="right"><?php echo $order['order_id']; ?></td> <td class="left"><?php echo $order['customer']; ?></td> <td class="left"><?php echo $order['status']; ?></td> <td class="right"><?php echo $order['total']; ?></td> <td class="left"><?php echo $order['date_added']; ?></td> <td class="left"><?php echo $order['date_modified']; ?></td> <td class="right"><?php foreach ($order['action'] as $action) { ?> [ <a href="http://stackoverflow.com/questions/15702156/<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ] <?php } ?></td> </tr> <tr class="eph-row" style="" > <td colspan="8" style="background-color: #EBF6FF; height: 50px;"> <div style=""> <label for="eph-dobierka" style="display: table-row;">Dobierka</label> <input type="text" name="eph-dobierka" id="eph-dobierka" value="" size="7" placeholder="Dobierka"/> </div> </td> </tr> <?php } ?> <?php } else { ?>\[/code\]
Here is the controller's code:\[code\] public function eph() { $this->load->model('sale/order'); $this->data['orders'] = array(); $orders = array(); if (isset($this->request->post['selected'])) { $orders = $this->request->post['selected']; } elseif (isset($this->request->get['order_id'])) { $orders[] = $this->request->get['order_id']; }$xml = "<?xml version='1.0'?>"; $xml .= "<EPH>\n"; $xml .= "<Zasielky>\n"; foreach ($orders as $order_id) { $order_info = $this->model_sale_order->getOrder($order_id); $xml .= "<Zasielka>\n"; $xml .= "<Adresat>\n"; $xml .= "<Meno>".$order_info['shipping_firstname']." ".$order_info['shipping_lastname']."</Meno>\n"; $xml .= "<Organizacia>".$order_info['shipping_company']."</Organizacia>\n"; $xml .= "<Ulica>".$order_info['shipping_address_1']."</Ulica>\n"; $xml .= "<Mesto>".$order_info['shipping_city']."</Mesto>\n"; $xml .= "<PSC>".$order_info['shipping_postcode']."</PSC>\n"; $xml .= "<Telefon>".$order_info['telephone']."</Telefon>\n"; $xml .= "<Email>".$order_info['email']."</Email>\n"; $xml .= "<sum>".$this->request->post['eph-dobierka']."</sum>\n"; $xml .= "</Adresat>\n"; $xml .= "</Zasielka>\n"; } $xml .= "</Zasielky>\n"; $xml .= "</EPH>\n"; libxml_use_internal_errors(true); $xmls = simplexml_load_string($xml); if ($xmls === false) { echo "Failed loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\t", $error->message; } } Header('Content-type: text/xml'); //Header('Content-disposition: attachment; filename="eph.xml"'); print($xmls->asXML()); }\[/code\]As you can see, based on selected[] value the selected rows are queried from the database.I was added the \[code\]<tr class="eph-row">...</tr>\[/code\] part to the original code, I want to pass some value to the controller, based on which row is selected => the: \[code\]$xml .= "<sum>".$this->request->post['eph-dobierka']."</sum>\n";\[/code\] in the "order foreach" in the controller (this is not working).