function process_origin_add() { for ($i = 0; $i <= get_max_customer(); $i++) { //form a name for form handling // echo "mixer".$i; $name = "origin_non_detect" . $i; //$name_val= if (isset($_POST[$name])) { echo "Processing non_origin"; //echo $_POST[$name]; $origin_val = "origin_val" . $i; $origin_id = $_POST[$origin_val]; //here we import origins as transaction while done it's shown as import ready. import_origin($origin_id); } } }
<div data-role='collapsible-set'> <div data-role="collapsible" data-collapsed="true"> <h1><a herf="#" data-transition="flip" data-role="button" data-mini="true" > SPECIFY COLLECTION PLACE</a> </h1> <?php $customers = array(); echo '<div data-role="main" class="ui-content">'; //form for pickin a site echo '<form action="#site-details" method="POST">'; echo "<p>"; echo '<label for="customer">Customer Location: </label>'; echo "</p>"; echo '<div data-role="controlgroup">'; echo '<select name="customer" data-native-menu="false" data-inline="true">'; // for ($i = 0; $i <= get_max_customer(); $i++) { //here we remember only last pick up. Not stored anywhere elese just one global that is gone after page reloaded. If if ($FLAG_SITE_PICKED_UP == 1 and $i == $customer_id) { $selected = " selected"; } else { $selected = ""; } $customers = read_customers($i); //moved one up!! if (!empty($customers[0])) { echo '<option value="' . $customers[0] . '" ' . $selected . '>'; echo $customers[1]; echo " - "; echo $customers[2]; echo '</option>'; }