// we have only this one booking if (count($openBookings) == 1) { Header($location); } else { $smarty->assign('tpl_type', 'bookings'); $smarty->assign('tpl_openBookings', $openBookings); $smarty->display('checkopenbookings.tpl'); } // we have more than one receipt } else { $count = 0; if (count($receiptids) > 1) { $receipts = array(); for ($i = 0; $i < count($receiptids); $i++) { if ($request->GetVar('direct', 'get') == 'true') { $name = $receipt->getReceipient($receiptids[$i]); if ($guestid == $name['guestid']) { $receipts[$i] = array('receiptid' => $receiptids[$i], 'name' => $name['name'], 'guestid' => $name['guestid']); $count++; } } else { $name = $receipt->getReceipient($receiptids[$i]); $receipts[$i] = array('receiptid' => $receiptids[$i], 'name' => $name['name'], 'guestid' => $name['guestid']); $count++; } } $smarty->assign('tpl_receipts', $receipts); } elseif ($receiptids !== -1) { $name = $receipt->getReceipient($receiptids); $receipts[0] = array('receiptid' => $receiptids, 'name' => $name['name'], 'guestid' => $name['guestid']); $count++;