I am just following a calender tutorial. The calender highlights only the start of the booking date. ie.$start_date.
my fields are id,start_date,end_date .ie (1,2003-02-02,2003,02-09)
What I want is to hight light date start_date to end_date.
// open a connection to the database
$connection = mysql_connect($server, $user, $pass);
// formulate the SQL query - same as above
$query = "SELECT DISTINCT start_date from calendar where start_date >= '" . $currYear . "-" . sprintf("%02d", $currMonth) . "-01' and start_date <= '" . $currYear . "-" . sprintf("%02d", $currMonth) . "-" . $totalDays[$currMonth] . "'";
// run the query on the database
$result = mysql_db_query($db,$query ,$connection);
$x=0;
$dateList=array();
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{
$dates = explode("-", $row["start_date"]);
$dateList[$x] = $dates[2];
$x++;
}
}
// close connection
mysql_close($connection);
// print date
if ($dayCount == date("j") && $currYear == date("Y") && $currMonth == date("n"))
{
#echo "<td align=center bgcolor=Silver><font face=Arial size=-1><a href=day.view.php?currYear=" . $currYear . "&currMonth=" . $currMonth . "&currDay=" . $dayCount . ">" . $dayCount. "</a></font>";
echo "<td align=center bgcolor=Silver><font face=Arial size=-1><a href=\"javascript:cal_action($dayCount, $currMonth, $currYear)\";>$dayCount</a></font>";
}
else
{
echo "<td align=center><font face=Arial size=-1><a href=\"javascript:cal_action($dayCount, $currMonth, $currYear)\";>" . $dayCount . "</a></font>";
#echo "<td align=center><font face=Arial size=-1><a href=day.view.php?currYear=" . $currYear . "&currMonth=" . $currMonth . "&currDay=" . $dayCount . ">" . $dayCount . "</a></font>";
}
for ($y=0; $y<sizeof($dateList); $y++)
{
//echo $dateList[$y];
if ($dateList[$y] == $dayCount)
{
echo "<font face=Arial color=red size=-4>+++</font>";
}
}
I think I need to do something in the array..but how..