I have made a system with which teachers can book class rooms. In the database the following data are stored: date, time & period, classroom, teacher code.
When asked for a survey appears that lists the bookings as follows (with more data, but this is the basis):
2008-03-05: Room G15, period 1: 08.30, (MNA) Mike Nameful
2008-03-05: Room G15, period 3: 10.10, (KKN) Karl Knowbody
I would, however, like the list also to include the periods that do not have any bookings: so actually my list would like this:
2008-03-05: Room G15, period 1: 08.30, (MNA) Mike Nameful
2008-03-05: Room G15, period 2: 09.20, <empty>
2008-03-05: Room G15, period 3: 10.10, (KKN) Karl Knowbody
I have the following script (sorry for the Dutch words but I am sure you will get around with it...):
<?
$query1="select lokaal, week, datum, roosteruur, uur, reserveren.code, naam from reserveren,code,uren where reserveren.code=code.code AND reserveren.uur=uren.tijd AND week='$weeknr' AND jaar='$jaar' Order by lokaal, datum, uur";
$result1 = mysql_query ($query1);
while (list ($lokaal, $week, $datum, $roosteruur, $uur, $code,$naam) = mysql_fetch_row($result1)){
echo "<TR><TD bgcolor=$color>$lokaal</TD><TD>$week</TD><TD bgcolor=$color_day>$dagnaam $datum2</TD><TD bgcolor=$color_day>$roosteruur</TD><TD>$uur</TD><TD>$code</TD><td>$naam</td></TR>";
}
But does anyone know a solution to include the empty ones, without having to record them in the database itsself?
Thanks