use separate query for session data
This commit is contained in:
@@ -438,18 +438,19 @@ function booking_variety_sessions_view_summary() {
|
||||
$rows = array();
|
||||
$attributes = array('style' => 'max-width:100%');
|
||||
|
||||
//@todo - join the variety sessions table to timeslots table to avoid another query
|
||||
|
||||
//get variety session timeslot definitions
|
||||
$timeslot_query = db_select('booking_variety_timeslots', 't');
|
||||
$timeslot_query->join('booking_variety_sessions', 's', 't.tid = s.booking_variety_timeslot_id');
|
||||
$timeslot_query->condition('t.booking_eventid', $event->eid, '=')
|
||||
->fields('t')
|
||||
->fields('s')
|
||||
->orderBy('t.booking_variety_start');
|
||||
$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)));
|
||||
//watchdog('booking_debug', "<pre>Variety Session Report timeslots:\n@info</pre>", array('@info' => print_r( $timeslot_list, true)));
|
||||
|
||||
//get vareity session definitions
|
||||
$sessions_query = db_query("SELECT * FROM {booking_variety_sessions} WHERE booking_eventid = :eid",
|
||||
array(':eid' => $event->eid));
|
||||
$sessions = $sessions_query->fetchAllAssoc('vid');
|
||||
|
||||
foreach ($timeslot_list as $timeslot) {
|
||||
$header[] = $timeslot->booking_variety_time_descrip;
|
||||
@@ -468,7 +469,7 @@ function booking_variety_sessions_view_summary() {
|
||||
if (isset($session_ids[$timeslot->tid])) {
|
||||
//get details of the person's variety session for this timeslot
|
||||
$sid = $session_ids[$timeslot->tid];
|
||||
$text = "Session description goes here";
|
||||
$text = $sessions[$sid]->booking_variety_descrip;
|
||||
$newline[] = $text;
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user