Remove duplicated queries in summary page
This commit is contained in:
@@ -65,6 +65,7 @@ function booking_report_summary() {
|
||||
//non australian states
|
||||
$state_rows[] = array('International', $non_australia_count);
|
||||
|
||||
/*
|
||||
//general stats
|
||||
$query = db_select('booking_person', 'p')
|
||||
->fields('p', array('booking_baptised', 'booking_married', 'booking_gender', 'booking_dob'))
|
||||
@@ -93,6 +94,7 @@ function booking_report_summary() {
|
||||
if ($person->booking_married == 'Y')
|
||||
$married_count++;
|
||||
}
|
||||
*/
|
||||
|
||||
//bookings by ecclesia
|
||||
$query = db_select('booking_person', 'p')
|
||||
@@ -151,6 +153,27 @@ function booking_report_summary() {
|
||||
//watchdog('booking', "Fully paid married person, ID !id (!first !last)", array('!id' => $person->nid,'!first' => ucwords($person->booking_firstname), '!last' => ucwords($person->booking_lastname)));
|
||||
$fullypaid_count++;
|
||||
}
|
||||
|
||||
//general stats
|
||||
$dob_total += $person->booking_dob;
|
||||
$person_count++;
|
||||
|
||||
if ($person->booking_gender == 'M')
|
||||
{
|
||||
$male_count++;
|
||||
$male_dob_total += $person->booking_dob;
|
||||
}
|
||||
else
|
||||
{
|
||||
$female_count++;
|
||||
$female_dob_total += $person->booking_dob;
|
||||
}
|
||||
|
||||
if ($person->booking_baptised == 'Y')
|
||||
$baptised_count++;
|
||||
|
||||
if ($person->booking_married == 'Y')
|
||||
$married_count++;
|
||||
}
|
||||
|
||||
//output everything
|
||||
|
Reference in New Issue
Block a user