well first of the code is creating a schedule matrix, with what is being booked accross top and time going down, the hours are in a database table, so in writing, the loop is supposed to go as follows:
Start loop through hours
>Loop through all people that can be booked (accross)
>>then check with current persons ID and check with Time. (bookings code below)
>moves to next person and checks the current time against all
Moves to next time to check and loops
The table gets created although here ill put the code and the query that seems to be having trouble:
PHP Code:
$bk = "SELECT * FROM bookings WHERE ";
$bookings = mysql_query($bk."time_start <= '$curdate' & time_finish > '$curdate' & mech = 1");//.$mech["ID"]);
if ($bookings) {
echo "<td width='100' bgcolor='#FF0000'></td>";
}else{
echo "<td width='100' bgcolor='#FF00FF'><font size=1></font></td>"; }
Bookmarks