| Current Path : /var/www/cesa.co.za/cesanet/ |
| Current File : /var/www/cesa.co.za/cesanet/timetable-render.php |
<h1>Full Timetable</h1>
<p class="text-end print-hide">
<a href="#" onclick="window.print(); return false;">Click here to print the full timetable</a>
</p>
<?php
$weeklySessionObj = new CCEWeeklySessions($sqlf);
$weeklySessions = $weeklySessionObj->findCurrent();
if (is_array($weeklySessions) && count($weeklySessions) > 0) {
?>
<table class="table" border="1" width="100%" cellpadding="4" cellspacing="0">
<tr>
<th>
Date and Time
</th>
<th>
Description
</th>
</tr>
<?php
$prevDate = '';
foreach ($weeklySessions as $weeklySession) {
if ($prevDate != $weeklySession['SessionDate']) {
$sessionDate = new DateTime($weeklySession['SessionDate']);
?>
<tr class="page-break">
<th colspan="2">
<h4><?php
echo $sessionDate->format('j F Y');
?></h4>
</th>
</tr>
<?php
}
?>
<tr>
<td>
<?php echo $weeklySession['StartTime']; ?> - <?php echo $weeklySession['EndTime']; ?>
</td>
<td>
<?php
echo '<h5>' . $weeklySession['Description'] . '</h5> ';
if (strlen($weeklySession['PresentationRef'])) {
echo '<br /><b>Presentation Ref: </b>' . $weeklySession['PresentationRef'];
}
if (strlen($weeklySession['AssignmentRef'])) {
echo '<br /><b>Assignment Ref: </b>' . $weeklySession['AssignmentRef'];
}
if (strlen($weeklySession['AssignmentSubDate']) > 0 && $weeklySession['AssignmentSubDate'] != '0000-00-00') {
$subDate = new DateTime($weeklySession['AssignmentSubDate']);
echo '<br /><b>Assignment Submission Date: </b>' . $subDate->format('j F Y');
}
?>
</td>
</tr>
<?php
$prevDate = $weeklySession['SessionDate'];
}
?>
</table>
<?php
}