function showtimeSelect($months, $weekdays, $days, $hours, $mins, $id_schedule)
{
    $display = display_scripts($id_schedule);
    $display .= display_months($months, $id_schedule);
    $display .= '<hr>';
    $display .= display_weekdays($weekdays, $id_schedule);
    $display .= '<hr>';
    $display .= display_days($days, $id_schedule);
    $display .= '<hr>';
    $display .= display_hours($hours, $id_schedule);
    $display .= '<hr>';
    $display .= display_mins($mins, $id_schedule);
    $display .= '<script type="text/javascript">
					monthSize();
					weekdaySize();
				</script>';
    return $display;
}
                }
                $i++;
            }
        }
        if (is_array($report_results["courses"]) && count($report_results["courses"])) {
            $total_event = $report_results["courses"]["events"]["events_minutes"];
            if ($total_event) {
                ?>
			<tr>
				<td colspan="3">&nbsp;</td>
			</tr>
			<tr class="modified">
				<td class="general">Final Totals:</td>
				<td class="report-hours"><?php 
                echo $report_results["courses"]["events"]["total_events"];
                ?>
</td>
				<td class="report-hours"><?php 
                echo display_hours($total_event);
                ?>
</td>
			</tr>
			<?php 
            }
        }
        ?>
	</tbody>
	</table>
	<?php 
    }
}
                            ?>
</td>
									<td class="report-hours-lg"><?php 
                            echo $session_total_observership ? display_half_days($session_total_observership, "observership") : "&nbsp;";
                            ?>
</td>
									<td class="report-hours-lg"><?php 
                            echo $session_total_clerkship_seminar ? display_half_days($session_total_clerkship_seminar, "clerkship_seminar") : "&nbsp;";
                            ?>
</td>
									<td class="report-hours-lg"><?php 
                            echo $session_total_events ? display_half_days($session_total_events, "events") : "&nbsp;";
                            ?>
</td>
									<td class="report-hours-lg"><?php 
                            echo $duration_final_total ? display_hours($duration_final_total) : "&nbsp;";
                            ?>
</td>
									<td class="report-hours-lg"><?php 
                            echo $session_final_total ? $session_final_total : "&nbsp;";
                            ?>
</td>
								</tr>
							<?php 
                        }
                    }
                    ?>
					</tbody>
				</table>
				<?php 
                    if (is_array($no_staff_number) && ($total_no_staff_number = count($no_staff_number))) {
		<col class="report-hours" />
	</colgroup>
	<thead>
		<tr>
			<td class="modified" style="width: 100%" colspan="2">&nbsp;</td>
			<td class="report-hours">Total Hours</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td colspan="7">&nbsp;</td>
		</tr>
		<tr style="background-color: #DEE6E3; font-weight: bold">
			<td class="modified">&nbsp;</td>
			<td class="general">Final Totals:</td>
			<td class="report-hours"><?php 
        echo $absolute_final_total ? display_hours($absolute_final_total) : "";
        ?>
</td>
		</tr>
	</tbody>
	</table>
	<?php 
        $sidebar_html = "<ul class=\"menu\">\n";
        foreach ($course_sidebar as $result) {
            $sidebar_html .= "\t<li class=\"link\"><a href=\"#" . $result["course_link"] . "\" title=\"" . html_encode($result["course_name"]) . "\">" . html_encode($result["course_name"]) . "</a></li>\n";
        }
        $sidebar_html .= "</ul>";
        new_sidebar_item("Course List", $sidebar_html, "department-list", "open");
    }
}
					</thead>
					<tbody>
					<?php 
                    foreach ($appendix[$course_id] as $event_id => $segments) {
                        foreach ($segments as $event) {
                            $total_duration += $event["duration"];
                            $hours = display_hours($event["duration"]);
                            echo "<tr>\n";
                            echo "\t<td class=\"title\"><a href=\"" . ENTRADA_URL . "/events?id=" . $event["event_id"] . "\" target=\"_blank\">" . html_encode($event["event_title"]) . "</a></td>\n";
                            echo "\t<td class=\"date\">" . html_encode($event["eventtype_title"]) . "</td>\n";
                            echo "\t<td class=\"date\">" . date(DEFAULT_DATE_FORMAT, $event["event_start"]) . "</td>\n";
                            echo "\t<td class=\"report-hours\">" . $hours . " hr" . ($hours != 1 ? "s" : "") . "</td>\n";
                            echo "</tr>\n";
                        }
                    }
                    echo "<tr class=\"na\" style=\"font-weight: bold\">\n";
                    echo "\t<td colspan=\"2\" style=\"padding-left: 10px\">Total of " . count($appendix[$course_id]) . " events with " . $result["total_events"] . " event type segments.</td>\n";
                    echo "\t<td class=\"date\" style=\"text-align: right\">Total Hours:</td>\n";
                    echo "\t<td class=\"report-hours\">" . display_hours($total_duration) . " hr" . ($total_duration != 1 ? "s" : "") . "</td>\n";
                    echo "</tr>\n";
                    ?>
					</tbody>
					</table>
					<?php 
                } else {
                    echo display_notice(array("There are no learning events in this course during the selected duration."));
                }
            }
        }
    }
}
                 $percent_duration = round($event["duration"] / $result["total_duration"] * 100);
             } else {
                 $percent_duration = 0;
             }
             $eventtypes_html .= "<tr>";
             $eventtypes_html .= "<td>" . html_encode($eventtype_legend[$eventtype_id]) . "</td>";
             $eventtypes_html .= "<td class=\"report-hours large\" style=\"text-align: left\">" . $event["events"] . " (~ " . $percent_events . "%)</td>";
             $eventtypes_html .= "<td class=\"report-hours large\" style=\"text-align: left\">" . display_hours($event["duration"]) . " hrs (~ " . $percent_duration . "%)</td>";
             $eventtypes_html .= "</tr>";
         }
         $eventtypes_html .= "</tbody>";
         $eventtypes_html .= "<tfoot>";
         $eventtypes_html .= "<tr>";
         $eventtypes_html .= "<td><strong>Totals</strong></td>";
         $eventtypes_html .= "<td><strong>" . $result["total_events"] . "</strong></td>";
         $eventtypes_html .= "<td><strong>" . display_hours($result["total_duration"]) . " hrs</strong></td>";
         $eventtypes_html .= "</tr>";
         $eventtypes_html .= "</tfoot>";
         $eventtypes_html .= "</table>";
     }
 }
 $ENTRADA_USER = new User();
 $ENTRADA_USER->setActiveOrganisation($org_id);
 list($objectives, $top_level_id) = courses_fetch_objectives($org_id, array($course->getID()), -1, 1, false);
 $pages_html["course_objectives"] = course_objectives_in_list($objectives, $top_level_id, $top_level_id, false, false, 1, false);
 if ($objectives) {
     $pages_html["course_objectives"] = "<h1>Course Objectives</h1>" . $pages_html["course_objectives"];
 } else {
     unset($pages_html["course_objectives"]);
 }
 /* Gradebook */