Reformatted booking summary report

This commit is contained in:
2014-05-14 18:19:17 +10:00
parent e8b05b7ee2
commit 6e2354efe6

View File

@@ -159,44 +159,51 @@ function booking_report_summary() {
if ($amount_owing == 0) if ($amount_owing == 0)
$fullypaid_count++; $fullypaid_count++;
//general stats
$dob_total += $person->booking_dob;
$person_count++; $person_count++;
if ($person->booking_gender == 'M') //general stats for booked in people
{ if ($person->booking_status == 1)
$male_count++; {
$male_dob_total += $person->booking_dob; $dob_total += $person->booking_dob;
}
else if ($person->booking_gender == 'M')
{ {
$female_count++; $male_count++;
$female_dob_total += $person->booking_dob; $male_dob_total += $person->booking_dob;
} }
else
{
$female_count++;
$female_dob_total += $person->booking_dob;
}
if ($person->booking_baptised == 'Y') if ($person->booking_baptised == 'Y')
$baptised_count++; $baptised_count++;
if ($person->booking_married == 'Y') if ($person->booking_married == 'Y')
$married_count++; $married_count++;
}
} }
//output everything //output everything
$output .= t("<h3>General Statistics</h3>"); $output .= t("<h2>General Statistics</h2>");
$output .= t("<p>There are !boys males and !girls females registered. Of these, !baptised are baptised and !married are married.<br />", $output .= t("<h3>Attendees booked in</h3>");
$output .= t("<p>There are !boys males and !girls females currently booked in. Of these, !baptised are baptised and !married are married.</p>",
array('!boys' => $male_count, '!girls' => $female_count, '!baptised' => $baptised_count, '!married' => $married_count array('!boys' => $male_count, '!girls' => $female_count, '!baptised' => $baptised_count, '!married' => $married_count
)); ));
$output .= t("The overall average age at the start of the week will be !average. The male average age will be !maleaverage. The female average age will be !femaleaverage.<br />", $output .= t("<p>The combined average age at the start of the week will be !average.<br />The male average age will be !maleaverage.<br />The female average age will be !femaleaverage.</p>",
array('!average' => _booking_avg_age($dob_total, $person_count, $event->booking_event_start), '!maleaverage' => _booking_avg_age($male_dob_total, $male_count, $event->booking_event_start), array('!average' => _booking_avg_age($dob_total, $male_count + $female_count, $event->booking_event_start), '!maleaverage' => _booking_avg_age($male_dob_total, $male_count, $event->booking_event_start),
'!femaleaverage' => _booking_avg_age($female_dob_total, $female_count, $event->booking_event_start) '!femaleaverage' => _booking_avg_age($female_dob_total, $female_count, $event->booking_event_start)
)); ));
$output .= t("There are !bookedin registrations currently booked in, !waiting on waiting list, !notpaid haven't paid, " . $output .= t("<h3>Overall</h3>");
"and !notcoming are no longer coming, which comes to a total of !total people who have filled in the registration form.</p>", $output .= t("<p>There are !bookedin registrations currently booked in, !waiting on waiting list, !notpaid haven't paid, " .
array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter, '!total' => $person_count, "and !notcoming are no longer coming, which comes to a total of !total people who have filled in the registration form. !travel people have filled in their travel form.</p>",
array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter, '!total' => $person_count, '!travel' => $travelform_count,
'!notcoming' => $notcoming_counter)); '!notcoming' => $notcoming_counter));
$output .= t("<h3>Finances</h3>");
$output .= t("<p>There are !welfare people with special financial consideration approved, and !committee people on the committee. " . $output .= t("<p>There are !welfare people with special financial consideration approved, and !committee people on the committee. " .
"!fullypaid people have completed their payments and !travel people have filled in their travel form.<br />", "!fullypaid people have completed their payments.</p>",
array('!welfare' => $welfare_count, '!fullypaid' => $fullypaid_count, '!travel' => $travelform_count, '!committee' => $committee_count, array('!welfare' => $welfare_count, '!fullypaid' => $fullypaid_count, '!committee' => $committee_count,
)); ));
$output .= t("Total amount paid: $!paid, minus $!refunds in refunds.</p>", array('!paid' => $total_paid, '!refunds' => $total_refunds)); $output .= t("Total amount paid: $!paid, minus $!refunds in refunds.</p>", array('!paid' => $total_paid, '!refunds' => $total_refunds));
$output .= t("<h3>Bookings by state</h3>"); $output .= t("<h3>Bookings by state</h3>");