diff --git a/booking.balance.inc b/booking.balance.inc index 95589e2..d88612c 100644 --- a/booking.balance.inc +++ b/booking.balance.inc @@ -21,14 +21,24 @@ function booking_balance_page() { //TODO: if the person says they're married, query to see if they're listed partner has already registered and paid //if they have, then let the new registration person know their partner has already paid, and send them the confirmation email - + //work out the node id from the session id + $query = db_select('booking_person', 'p'); + $db_and = db_and()->condition('p.booking_eventid', $event->eid, '=') + ->condition('p.booking_tempid', arg(1), '='); + $query->condition($db_and); + $query->fields('p', array('nid')); + $person = $query->execute() + ->fetchObject(); + + /* $query = db_select('booking_person', 'p'); $query->condition('p.booking_tempid', arg(1), '=') ->fields('p', array('nid')); $person = $query->execute() ->fetchObject(); - + */ + if ($person) { //load all the fields $node = node_load($person->nid);