Hello everyone, I am back for a little help/advice on what to do! As most of you will be aware, I run an online radio site and I am currently re-designing it to look fresher and cleaner than it currently does. I use a DJ Panel that is coded in PHP and uses a MySQL Database which is all well and good and honky dory.
One of the features of it is an online schedule booking system that allows any DJ to book and un-book their sets. On our public website we then grab this data and display it for our visitors to see who is on and when. Simple enough.
Something that I would like to do now is only display the entries from today that have a DJ booked. All slots where no-one is booked are blank so it should be a case of running an if such and such == "" then do not display, but I wouldn't know where to start for this!!
Below I have pasted the code that is currently used to grab all of the times from the current day.
Any help would be greatly appreciated!!
One of the features of it is an online schedule booking system that allows any DJ to book and un-book their sets. On our public website we then grab this data and display it for our visitors to see who is on and when. Simple enough.
Something that I would like to do now is only display the entries from today that have a DJ booked. All slots where no-one is booked are blank so it should be a case of running an if such and such == "" then do not display, but I wouldn't know where to start for this!!
Below I have pasted the code that is currently used to grab all of the times from the current day.
PHP:
$day = $_GET['week'];
if($_GET['week'] == ""){
$day = date("l",time() + 18000);
$_GET['week'] = date("l",time() + 18000);
}
$result = mysql_query("SELECT * FROM rp_timetable WHERE day = '$day'");
while($slot = mysql_fetch_assoc($result)) {
if($slot["1"] == "")
{ $one = "OPEN SLOT"; }
else
{ $one = "<b>DJ {$slot["1"]}</b>"; }
if($slot["2"] == "")
{ $two = "OPEN SLOT"; }
else
{ $two = "<b>DJ {$slot["2"]}</b>"; }
if($slot["3"] == "")
{ $three = "OPEN SLOT"; }
else
{ $three = "<b>DJ {$slot["3"]}</b>"; }
if($slot["4"] == "")
{ $four = "OPEN SLOT"; }
else
{ $four = "<b>DJ {$slot["4"]}</b>"; }
if($slot["5"] == "")
{ $five = "OPEN SLOT"; }
else
{ $five = "<b>DJ {$slot["5"]}</b>"; }
if($slot["6"] == "")
{ $six = "OPEN SLOT"; }
else
{ $six = "<b>DJ {$slot["6"]}</b>"; }
if($slot["7"] == "")
{ $seven = "OPEN SLOT"; }
else
{ $seven = "<b>DJ {$slot["7"]}</b>"; }
if($slot["8"] == "")
{ $eight = "OPEN SLOT"; }
else
{ $eight = "<b>DJ {$slot["8"]}</b>"; }
if($slot["9"] == "")
{ $nine = "OPEN SLOT"; }
else
{ $nine = "<b>DJ {$slot["9"]}</b>"; }
if($slot["10"] == "")
{ $ten = "OPEN SLOT"; }
else
{ $ten = "<b>DJ {$slot["10"]}</b>"; }
if($slot["11"] == "")
{ $eleven = "OPEN SLOT"; }
else
{ $eleven = "<b>DJ {$slot["11"]}</b>"; }
if($slot["12"] == "")
{ $twelve = "OPEN SLOT"; }
else
{ $twelve = "<b>DJ {$slot["12"]}</b>"; }
if($slot["13"] == "")
{ $thirteen = "OPEN SLOT"; }
else
{ $thirteen = "<b>DJ {$slot["13"]}</b>"; }
if($slot["14"] == "")
{ $fourteen = "OPEN SLOT"; }
else
{ $fourteen = "<b>DJ {$slot["14"]}</b>"; }
if($slot["15"] == "")
{ $fifteen = "OPEN SLOT"; }
else
{ $fifteen = "<b>DJ {$slot["15"]}</b>"; }
if($slot["16"] == "")
{ $sixteen = "OPEN SLOT"; }
else
{ $sixteen = "<b>DJ {$slot["16"]}</b>"; }
if($slot["17"] == "")
{ $seventeen = "OPEN SLOT"; }
else
{ $seventeen = "<b>DJ {$slot["17"]}</b>"; }
if($slot["18"] == "")
{ $eighteen = "OPEN SLOT"; }
else
{ $eighteen = "<b>DJ {$slot["18"]}</b>"; }
if($slot["19"] == "")
{ $nineteen = "OPEN SLOT"; }
else
{ $nineteen = "<b>DJ {$slot["19"]}</b>"; }
if($slot["20"] == "")
{ $twenty = "OPEN SLOT"; }
else
{ $twenty = "<b>DJ {$slot["20"]}</b>"; }
if($slot["21"] == "")
{ $twentyone = "OPEN SLOT"; }
else
{ $twentyone = "<b>DJ {$slot["21"]}</b>"; }
if($slot["22"] == "")
{ $twentytwo = "OPEN SLOT"; }
else
{ $twentytwo = "<b>DJ {$slot["22"]}</b>"; }
if($slot["23"] == "")
{ $twentythree = "OPEN SLOT"; }
else
{ $twentythree = "<b>DJ {$slot["23"]}</b>"; }
if($slot["24"] == "")
{ $twentyfour = "OPEN SLOT"; }
else
{ $twentyfour = "<b>DJ {$slot["24"]}</b>"; }
$day = $_GET['week'];
echo "<p class=\"firstP\">You are currently viewing ";
echo "$day";
echo "'s times<p>";
echo "<p>0000 | $one<br />
0100 | $two<br />
0200 | $three<br />
0300 | $four<br />
0400 | $five<br />
0500 | $six<br />
0600 | $seven<br />
0700 | $eight<br />
0800 | $nine<br />
0900 | $ten<br />
1000 | $eleven<br />
1100 | $twelve<br />
1200 | $thirteen<br />
1300 | $fourteen<br />
1400 | $fifteen<br />
1500 | $sixteen<br />
1600 | $seventeen<br />
1700 | $eighteen<br />
1800 | $nineteen<br />
1900 | $twenty<br />
2000 | $twentyone<br />
2100 | $twentytwo<br />
2200 | $twentythree<br />
2300 | $twentyfour<p>";
}
Any help would be greatly appreciated!!