Jump to content

booking schedule


puntapuisomos

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/94542-booking-schedule/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.