Change url for booking summary page
Add state analytics
This commit is contained in:
@@ -204,7 +204,7 @@ function booking_menu() {
|
|||||||
$items['admin/booking/summary'] = array(
|
$items['admin/booking/summary'] = array(
|
||||||
'title' => 'Booking Summary',
|
'title' => 'Booking Summary',
|
||||||
'description' => 'List people and their payments for the current event',
|
'description' => 'List people and their payments for the current event',
|
||||||
'page callback' => 'booking_report_payments',
|
'page callback' => 'booking_report_summary',
|
||||||
'access arguments' => array('access reports'),
|
'access arguments' => array('access reports'),
|
||||||
'type' => MENU_NORMAL_ITEM,
|
'type' => MENU_NORMAL_ITEM,
|
||||||
);
|
);
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
/**
|
/**
|
||||||
* List people and how much they have paid
|
* List people and how much they have paid
|
||||||
*/
|
*/
|
||||||
function booking_report_payments() {
|
function booking_report_summary() {
|
||||||
global $event;
|
global $event;
|
||||||
$text = "";
|
$text = "";
|
||||||
$output = "";
|
$output = "";
|
||||||
@@ -14,12 +14,31 @@ function booking_report_payments() {
|
|||||||
$total_paid = 0;
|
$total_paid = 0;
|
||||||
|
|
||||||
$header = array('Id', 'Name', 'Email', 'Payment To Date', 'Total Payment Required');
|
$header = array('Id', 'Name', 'Email', 'Payment To Date', 'Total Payment Required');
|
||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
|
||||||
$result = db_query("SELECT * FROM {booking_person} p WHERE p.booking_event_id = :eid",
|
$result = db_query("SELECT * FROM {booking_person} p WHERE p.booking_event_id = :eid",
|
||||||
array(':eid' => $event->eid));
|
array(':eid' => $event->eid));
|
||||||
|
|
||||||
|
//do some analysis about the people booked in
|
||||||
|
//first the summary of states
|
||||||
|
$state_header = array('State', 'Count');
|
||||||
|
$state_rows = array();
|
||||||
|
$state_stats = db_select('booking_person', 'p')
|
||||||
|
->fields('p', array('booking_state'))
|
||||||
|
->condition('p.booking_event_id', $event->eid, '=')
|
||||||
|
->addExpression('COUNT(booking_state)', 'state_count')
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
foreach ($state_stats as $state) {
|
||||||
|
$state_rows[] = array($state->booking_state, $state->state_count);
|
||||||
|
}
|
||||||
|
$output .= t("<p>Bookings by state</p>");
|
||||||
|
$output .= theme('table', array('header' => $state_header, 'rows' => $state_rows));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$output .= t("<p>The following table presents a summary of payments that have been made for !event.</p>", array('!event' => $event->booking_eventname));
|
||||||
foreach ($result as $person) {
|
foreach ($result as $person) {
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
l(t('!id', array('!id' => $person->nid)), t('node/!id', array('!id' => $person->nid))),
|
l(t('!id', array('!id' => $person->nid)), t('node/!id', array('!id' => $person->nid))),
|
||||||
@@ -38,20 +57,7 @@ function booking_report_payments() {
|
|||||||
$waiting_counter++;
|
$waiting_counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
return array(
|
|
||||||
'first_para' => array(
|
|
||||||
'#type' => 'markup',
|
|
||||||
'#markup' => t("<p>The following table presents a summary"),
|
|
||||||
),
|
|
||||||
'table' => theme('table', array(
|
|
||||||
'header' => $header,
|
|
||||||
'rows' => $rows,
|
|
||||||
)),
|
|
||||||
|
|
||||||
);*/
|
|
||||||
|
|
||||||
$output .= t("<p>The following table presents a summary of payments that have been made for !event.</p>", array('!event' => $event->booking_eventname));
|
|
||||||
$output .= theme('table', array('header' => $header, 'rows' => $rows));
|
$output .= theme('table', array('header' => $header, 'rows' => $rows));
|
||||||
$output .= t("<p>Total of !bookedin registrations currently booked in, !waiting on waiting list, and !notpaid haven't paid.</p>",
|
$output .= t("<p>Total of !bookedin registrations currently booked in, !waiting on waiting list, and !notpaid haven't paid.</p>",
|
||||||
array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter));
|
array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter));
|
||||||
|
Reference in New Issue
Block a user