diff --git a/booking.register.inc b/booking.register.inc index e72164c..13897d0 100644 --- a/booking.register.inc +++ b/booking.register.inc @@ -1063,10 +1063,10 @@ function _booking_insert($node) { 'booking_mobile' => $node->booking_mobile, 'booking_email' => $node->booking_email, 'booking_timestamp' => $node->booking_timestamp, - 'booking_ecclesia' => $node->booking_ecclesia, + 'booking_ecclesia' => ucwords($node->booking_ecclesia), 'booking_baptised' => $node->booking_baptised, 'booking_married' => $node->booking_married, - 'booking_partner_name' => $node->booking_partner_name, + 'booking_partner_name' => ucwords($node->booking_partner_name), 'booking_partner_id' => $node->booking_partner_id, 'booking_room_mate1' => $node->booking_room_mate1, 'booking_room_mate2' => $node->booking_room_mate2, diff --git a/booking.reports.inc b/booking.reports.inc index b5b2b90..ffb37b2 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -44,21 +44,22 @@ function booking_report_summary() { //bookings by ecclesia - $ecclesia_heaeder = array('Ecclesia', 'Count'); + $ecclesia_heaeder = array('State','Ecclesia', 'Count'); $ecclesia_rows = array(); $query = db_select('booking_person', 'p') - ->fields('p', array('booking_ecclesia')) + ->fields('p', array('booking_ecclesia','booking_state')) ->condition('p.booking_event_id', $event->eid, '='); $query->groupBy('p.booking_ecclesia'); $query->addExpression('COUNT(p.booking_ecclesia)', 'ecclesia_count'); + $query->orderBy('booking_state') + ->orderBy('ecclesia_count','DESC'); $stats = $query->execute(); foreach ($stats as $ecclesia) { - $ecclesia_rows[] = array($ecclesia->booking_ecclesia, $ecclesia->ecclesia_count); + $ecclesia_rows[] = array($ecclesia->booking_state,$ecclesia->booking_ecclesia, $ecclesia->ecclesia_count); } //more detailed summary - $output .= t("

The following table presents a summary of payments that have been made for !event.

", array('!event' => $event->booking_eventname)); foreach ($result as $person) { $rows[] = array( l(t('!id', array('!id' => $person->nid)), t('node/!id', array('!id' => $person->nid))), @@ -82,6 +83,7 @@ function booking_report_summary() { $output .= theme('table', array('header' => $state_header, 'rows' => $state_rows, 'attributes' => $stats_attributes)); $output .= t("

Bookings by ecclesia

"); $output .= theme('table', array('header' => $ecclesia_heaeder, 'rows' => $ecclesia_rows, 'attributes' => $stats_attributes)); + $output .= t("

The following table presents a summary of payments that have been made for !event.

", array('!event' => $event->booking_eventname)); $output .= theme('table', array('header' => $header, 'rows' => $rows)); $output .= t("

Total of !bookedin registrations currently booked in, !waiting on waiting list, and !notpaid haven't paid.

", array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter));