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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.