join the variety sessions table to timeslots table
This commit is contained in:
@@ -428,23 +428,6 @@ function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$query = db_select('booking_studygroup_list', 's')
|
|
||||||
->fields('s')
|
|
||||||
->condition('s.booking_eventid', $event->eid, '=')
|
|
||||||
->orderBy('sid');
|
|
||||||
$studygroup_list = $query->execute()->fetchAllAssoc('sid');
|
|
||||||
|
|
||||||
//add columns for the study groups
|
|
||||||
foreach ($studygroup_list as $group) {
|
|
||||||
$header[] = $group->booking_studygroup_descrip;
|
|
||||||
}
|
|
||||||
|
|
||||||
$person_query = db_query("SELECT * FROM {booking_person_view} WHERE booking_gender = 'M' " .
|
|
||||||
" AND (booking_status = 1 OR booking_status = 2)" .
|
|
||||||
" ORDER BY booking_lastname, booking_firstname")->fetchAllAssoc('nid');
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to generate table listing all variety session registrations
|
* Function to generate table listing all variety session registrations
|
||||||
*/
|
*/
|
||||||
@@ -453,15 +436,20 @@ function booking_variety_sessions_view_summary() {
|
|||||||
$output = "";
|
$output = "";
|
||||||
$header = array('First Name', 'Last Name');
|
$header = array('First Name', 'Last Name');
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$attributes = array('style' => 'max-width:100%');
|
$attributes = array('style' => 'max-width:100%');
|
||||||
|
|
||||||
|
//@todo - join the variety sessions table to timeslots table to avoid another query
|
||||||
|
|
||||||
//get variety session timeslot definitions
|
//get variety session timeslot definitions
|
||||||
$timeslot_query = db_select('booking_variety_timeslots', 'v');
|
$timeslot_query = db_select('booking_variety_timeslots', 't');
|
||||||
$timeslot_query->condition('v.booking_eventid', $event->eid, '=')
|
$timeslot_query->leftJoin('booking_variety_sessions', 's', 't.tid = s.booking_variety_timeslot_id');
|
||||||
|
$timeslot_query->condition('t.booking_eventid', $event->eid, '=')
|
||||||
->fields('v')
|
->fields('v')
|
||||||
->orderBy('v.booking_variety_start');
|
->orderBy('t.booking_variety_start');
|
||||||
$timeslot_list = $timeslot_query->execute()->fetchAllAssoc('tid');
|
$timeslot_list = $timeslot_query->execute()->fetchAllAssoc('tid');
|
||||||
|
|
||||||
|
watchdog('booking_debug', "<pre>Variety Session Report timeslots:\n@info</pre>", array('@info' => print_r( $timeslot_list, true)));
|
||||||
|
|
||||||
foreach ($timeslot_list as $timeslot) {
|
foreach ($timeslot_list as $timeslot) {
|
||||||
$header[] = $timeslot->booking_variety_time_descrip;
|
$header[] = $timeslot->booking_variety_time_descrip;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user