Example #1
0
// Friday
echo "<th>";
if (checkIfToday($fridate)) {
    echo "<u>";
}
// if
echo "Friday";
echo "<br>" . styleDate($fridate) . "</u></th>";
?>
    </tr>
    <tr>
      <!--PERIOD 1-6-->
      <?php 
for ($period = 1; $period <= 8; $period++) {
    echo "<tr>";
    echo "<th>" . writeTimeSlot($period) . "</th>";
    writeCell($conn, $mondate, $period);
    writeCell($conn, $tuedate, $period);
    writeCell($conn, $weddate, $period);
    writeCell($conn, $thudate, $period);
    writeCell($conn, $fridate, $period);
    echo "</tr>";
}
// for
?>
    </table>
    <?php 
// close connection
?>
  </div>
</div>
if (checkIfToday($fridate)) {
    echo "<u>";
}
// if
echo "Friday";
echo "<br>" . styleDate($fridate) . "</u></th>";
?>
    </tr>
    <tr style="border: 1px solid #999">
      <!--PERIOD 1-6-->
      <?php 
$minibuscodes = ["JBX", "JHA", "LLE", "YHJ"];
$minibustables = ["minibusjbx", "minibusjha", "minibuslle", "minibusyhj"];
// loop through each period
for ($period = 1; $period <= 8; $period++) {
    echo "<th rowspan=5>" . writeTimeSlot($period) . "</th>";
    echo "</tr>";
    for ($i = 0; $i < count($minibuscodes); $i++) {
        echo "<tr>";
        echo "<td>{$minibuscodes[$i]}</td>";
        writeCell($conn, $mondate, $period, $minibustables[$i]);
        writeCell($conn, $tuedate, $period, $minibustables[$i]);
        writeCell($conn, $weddate, $period, $minibustables[$i]);
        writeCell($conn, $thudate, $period, $minibustables[$i]);
        writeCell($conn, $fridate, $period, $minibustables[$i]);
        echo "</tr>";
    }
    // for
}
// for
?>