diff --git a/booking.helper.inc b/booking.helper.inc index 5069352..c6d7f4b 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -1610,6 +1610,7 @@ function _booking_travelform_email_summary($node) { function _booking_readinggroup_email_listing($node) { global $event; $rows = array(); + $header = array("First Name", "Last Name", "Phone Number"); //display study session data if enabled if (variable_get('booking_enable_studygroups', 0) == 0) { @@ -1632,7 +1633,14 @@ function _booking_readinggroup_email_listing($node) { //check that this reading group session has been defined for this attendee and that they're a leader if (!empty($node->$sessionid) && $node->$roleid == 1) { - watchdog('booking_debug', "
Person is a leader of reading group \n@info
", array('@info' => print_r($readinggroup, true))); + watchdog('booking_debug', "
Person is a leader of reading group @id \n@info
", + array('@id' => $node->$sessionid, '@info' => print_r($readinggroup, true))); + + $member_query = db_query("SELECT * FROM {booking_person_view} WHERE $sessionid = :sid ", array(':sid' => $node->$sessionid))->fetchAllAssoc('nid'); + watchdog('booking_debug', "
Other people in reading group @id \n@info
", + array('@id' => $node->$sessionid, '@info' => print_r($member_query, true))); + + //theme('table', array('header' => $state_header, 'rows' => $state_rows)); } } } diff --git a/booking.reports.inc b/booking.reports.inc index 383c0f9..acc40c8 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -38,12 +38,11 @@ function booking_report_summary() { $header[] = array('data' => t('Name'), 'field' => 'booking_lastname'); $header[] = array('data' => t('Booking Status'), 'field' => 'booking_status'); - if (variable_get('booking_enable_studygroups', 0) == 1) - { + // Add some optional columns + if (variable_get('booking_enable_studygroups', 0) == 1) { $header[] = array('data' => t('Studygroups')); } - if (variable_get('booking_enable_roomallocations', 0) == 1) - { + if (variable_get('booking_enable_roomallocations', 0) == 1) { $header[] = array('data' => t('Room')); } @@ -141,8 +140,7 @@ function booking_report_summary() { $table_sort = $query->extend('TableSort')->orderbyHeader($header); $result = $table_sort->execute(); - foreach ($result as $person) - { + foreach ($result as $person) { $this_row = array(); //$amount_owing = _booking_amount_owing($person->nid, 0, FALSE); $amount_owing = _booking_amount_owing($person, 0, FALSE); @@ -162,12 +160,10 @@ function booking_report_summary() { ); $this_row[] = _booking_status_generate($person->booking_status); - if (variable_get('booking_enable_studygroups', 0) == 1) - { + if (variable_get('booking_enable_studygroups', 0) == 1) { $this_row[] = l(t('Groups'), t('admin/booking/!id/edit-studygroup-membership', array('!id' => $person->nid))); } - if (variable_get('booking_enable_roomallocations', 0) == 1) - { + if (variable_get('booking_enable_roomallocations', 0) == 1) { $this_row[] =l(t('Room'), t('admin/booking/!id/edit-room', array('!id' => $person->nid))); } @@ -187,39 +183,44 @@ function booking_report_summary() { $total_paid += $person->booking_amount_paid; //subtract any refund - if ($person->booking_refund_processed == 'Y' && $person->booking_refund_due > 0) - { + if ($person->booking_refund_processed == 'Y' && $person->booking_refund_due > 0) { $total_refunds += $person->booking_refund_due; } //travel form completed? - if (! empty($person->tid)) + if (! empty($person->tid)) { $travelform_count++; - - //booking status - if ($person->booking_status == 0) - $notpaid_counter++; - elseif ($person->booking_status == 1) - $bookedin_counter++; - elseif ($person->booking_status == 2) - $waiting_counter++; - elseif ($person->booking_status == 5) - $hosts_counter++; - else - $notcoming_counter++; - - //welfare - if ($person->booking_welfare_required == 'Y') - $welfare_count++; - - //committee? - if ($person->booking_committee_member == 'Y') - $committee_count++; - - //fully paid? - if ($amount_owing == 0) - $fullypaid_count++; + } + //booking status + if ($person->booking_status == 0) { + $notpaid_counter++; + } + elseif ($person->booking_status == 1) { + $bookedin_counter++; + } + elseif ($person->booking_status == 2) { + $waiting_counter++; + } + elseif ($person->booking_status == 5) { + $hosts_counter++; + } + else { + $notcoming_counter++; + } + + //welfare + if ($person->booking_welfare_required == 'Y') { + $welfare_count++; + } + //committee? + if ($person->booking_committee_member == 'Y') { + $committee_count++; + } + //fully paid? + if ($amount_owing == 0) { + $fullypaid_count++; + } $person_count++; $state = strcmp($person->booking_country,'Australia') == 0 ? $person->booking_state : 'International'; @@ -230,13 +231,13 @@ function booking_report_summary() { $dob_total += $person->booking_dob; //store data for average ages per gender and state - if ($person->booking_gender == 'M') - { + if ($person->booking_gender == 'M') { $male_count++; $male_dob_total += $person->booking_dob; $state_statistics[$state]->male_avg += $person->booking_dob; $state_statistics[$state]->male_count++; - } else { + } + else { $female_count++; $female_dob_total += $person->booking_dob; $state_statistics[$state]->female_avg += $person->booking_dob;