b.starttime AND now() <= b.endtime ON r.resource_id = p.resource_id;"; $result = mysql_query($q); //SELECT r.name as resname,r.slavename, r.link, r.resource_id,u.user_id,u.name as username,u.email,b.starttime,b.endtime,b.purpose from resource r LEFT JOIN pod p LEFT JOIN booking b INNER JOIN user u ON u.user_id = b.user_id ON b.resource_id = p.resource_id AND now() > b.starttime AND now() <= b.endtime ON r.resource_id = p.resource_id WHERE type_id=2; closeDB(); echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while ($row = mysql_fetch_array($result)) { $slave = $row{'slavename'}; if (! isDevPod($slave)) continue; $slave_url = getSlaveUrl($slave); $status = getSlaveStatus($slave); echo ""; echo ""; echo ""; if ($row{'username'} != "") $booker = $row{'username'}; else $booker="-"; echo ""; if ($row{'endtime'} != "") { $until = strtotime($row{'endtime'}); echo ""; //$until = $row{'endtime'}; } else { $until="-"; echo ""; } if ($row{'purpose'} != "") $purpose = $row{'purpose'}; else $purpose="-"; echo ""; $active = 'true'; if ($status == "online") $color = "#BEFAAA"; else $color = "#FAAAAB"; echo ""; echo ""; echo ""; } echo ''; echo '
NameSlave NameBooked byBooked untilPurposeStatus
".$row{'resname'}."".$slave."".$booker."".date('d/M/Y', $until)."".$until."".$purpose."".$status."
'; ?>
Booked by:

Start:

End:

Purpose: