Many changes...
This commit is contained in:
@@ -299,6 +299,83 @@ function booking_report_paypal_payments() {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* List everyone's flight info
|
||||
*/
|
||||
function booking_report_flight_details() {
|
||||
global $event;
|
||||
$form = array();
|
||||
$prefix = t("<h2>Internal Flight Details</h2>\n<p>View flight information for all attendees with status currently set to booked in.</p>");
|
||||
|
||||
$header = array(
|
||||
'booking_name' => array('data' => t('Name'), 'field' => 'booking_lastname'),
|
||||
'booking_destination_country' => array('data' => t('Country'), 'field' => 'booking_destination_country'),
|
||||
'booking_outflight_bookingnum' => array('data' => t('Reference'), 'field' => 'booking_outflight_bookingnum'),
|
||||
'booking_outflight_flightnum' => array('data' => t('Flight #'), 'field' => 'booking_outflight_flightnum'),
|
||||
'booking_outflight_origin' => array('data' => t('Description'), 'field' => 'booking_outflight_origin'),
|
||||
'booking_outflight_origin_ts' => array('data' => t('Departure Time'), 'field' => 'booking_outflight_origin_ts'),
|
||||
'booking_outflight_connecting_flightnum' => array('data' => t('Connecting Flight'), 'field' => 'booking_outflight_connecting_flightnum'),
|
||||
'booking_outflight_destination' => array('data' => t('Description'), 'field' => 'booking_outflight_destination'),
|
||||
'booking_outflight_destination_ts' => array('data' => t('Time'), 'field' => 'booking_outflight_destination_ts'),
|
||||
'booking_rtrnflight_bookingnum' => array('data' => t('Return Reference'), 'field' => 'booking_rtrnflight_bookingnum'),
|
||||
'booking_rtrnflight_flightnum' => array('data' => t('Flight #'), 'field' => 'booking_rtrnflight_flightnum'),
|
||||
'booking_rtrnflight_origin' => array('data' => t('Description'), 'field' => 'booking_rtrnflight_origin'),
|
||||
'booking_rtrnflight_origin_ts' => array('data' => t('Time'), 'field' => 'booking_rtrnflight_origin_ts'),
|
||||
);
|
||||
|
||||
$query = db_select('booking_person', 'p');
|
||||
$query->fields('p');
|
||||
|
||||
$db_and = db_and();
|
||||
$db_and->condition('p.booking_event_id', $event->eid, '=');
|
||||
$db_and->condition('p.booking_status', 1, '=');
|
||||
$query->condition($db_and);
|
||||
|
||||
$table_sort = $query->extend('TableSort')->orderbyHeader($header);
|
||||
$result = $table_sort->execute();
|
||||
|
||||
foreach($result as $data)
|
||||
{
|
||||
$name_link = l(t('!first !last', array('!first' => ucwords($data->booking_firstname), '!last' => ucwords($data->booking_lastname))),
|
||||
t('node/!id', array('!id' => $data->nid))
|
||||
);
|
||||
|
||||
$rows[] = array (
|
||||
'data' => array(
|
||||
$name_link,
|
||||
$data->booking_destination_country,
|
||||
$data->booking_outflight_bookingnum,
|
||||
$data->booking_outflight_flightnum,
|
||||
$data->booking_outflight_origin,
|
||||
$data->booking_outflight_origin_ts == 0 ? '' : format_date($data->booking_outflight_origin_ts, 'custom', 'd/m/Y H:i'),
|
||||
$data->booking_outflight_connecting_flightnum,
|
||||
$data->booking_outflight_destination,
|
||||
$data->booking_outflight_destination_ts == 0 ? '' : format_date($data->booking_outflight_destination_ts, 'custom', 'd/m/Y H:i'),
|
||||
$data->booking_rtrnflight_bookingnum,
|
||||
$data->booking_rtrnflight_flightnum,
|
||||
$data->booking_rtrnflight_origin,
|
||||
$data->booking_rtrnflight_origin_ts == 0 ? '' : format_date($data->booking_rtrnflight_origin_ts, 'custom', 'd/m/Y H:i'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$result = array (
|
||||
'first_para' => array (
|
||||
'#type' => 'markup',
|
||||
'#markup' => $prefix,
|
||||
),
|
||||
'table' => array (
|
||||
'#theme' => 'table',
|
||||
'#header' => $header,
|
||||
'#rows' => $rows,
|
||||
'#attributes' => array('id' => 'sort-table'),
|
||||
//'#sticky' => FALSE,
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function booking_coming_page() {
|
||||
global $event;
|
||||
|
Reference in New Issue
Block a user