}
    ?>
				</td>
			</tr>
		<?php 
}
?>

		<?php 
if ($user['u_delivery_type'] == 'home_delivery') {
    ?>
			<tr>
				<th><label for="u_address_full">Delivery Address</label></th>
				<td>
					<?php 
    echo multiline_address($user);
    ?>
				</td>
			</tr>
		<?php 
}
?>


		<tr>
			<td colspan="2" style="text-align:right;"><input type="submit" class="btn" value="Update Details" /></td>
		</tr>

	</table>

<?php 
 $unconfirmed = 0;
 $grand['items'] = $grand['price'] = 0;
 $curr_group['id'] = $orders[0]['u_bg_id'];
 $curr_group['items'] = $curr_group['price'] = 0;
 $curr_customer['id'] = $orders[0]['oi_u_id'];
 $curr_customer['items'] = $curr_customer['price'] = 0;
 if (config_item('delivery_options') != null) {
     $curr_customer['delivery_detail'] = $orders[0]['u_delivery_type'];
 }
 echo '<table class="results">';
 echo '<tr><td colspan="4"><h3>Buying Group: ' . $orders[0]['bg_name'] . '</h3></td></tr>';
 if (config_item('delivery_options') != null) {
     $delivery_types = config_item('delivery_options');
     $delivery = $delivery_types[$curr_customer['delivery_detail']];
     if ($curr_customer['delivery_detail'] == 'home_delivery') {
         $delivery .= ' to <strong>' . multiline_address($orders[0], ', ') . '</strong>';
     }
     echo '<tr style="text-align:left;"><th colspan="4">Delivery: ' . $delivery . '</th></tr>';
 }
 echo '<tr><th colspan="4" class="customer-name" style="text-align:left; font-weight:bold;">' . $orders[0]['u_title'] . ' ' . $orders[0]['u_fname'] . ' ' . $orders[0]['u_sname'] . ' ';
 if (!isset($search_u_id)) {
     echo '<a href="' . current_url() . '/' . $curr_customer['id'] . '" class="noprint"><img src="' . site_url('img/icons/view.png') . '" title="view individual picking list"></a>';
 }
 echo '</th></tr>';
 foreach ($orders as $o) {
     $new = array();
     // Define current array
     if (!isset($curr_group[$o['u_bg_id']])) {
         $curr_group[$o['u_bg_id']] = array('price' => 0, 'items' => 0);
     }
     //display totals, if appropriate