Events calandar
Posted: Tue Apr 10, 2007 1:19 am
Hello,
I have an event calendar. It shows the events of month, date etc. but it shows the events for all year (previous and also past). For example, if i add an event from apr 1 to apr 10 2007 . It shows that event for any year we select. I think, its not taking year to consideration. Pls help me out.
Here is the code
DB table field names
ID DAY MONTH YEAR DAY1 MONTH1 YEAR1 TITLE
DAY- starting date
DAY1-ending date
similarly for month and year
Thanks
I have an event calendar. It shows the events of month, date etc. but it shows the events for all year (previous and also past). For example, if i add an event from apr 1 to apr 10 2007 . It shows that event for any year we select. I think, its not taking year to consideration. Pls help me out.
Here is the code
Code: Select all
function getDisplay(&$row,$months,$day,$year)
{
// Show Link or not
$month = abs($months);
$show = 'NO';
//echo $month;
echo $year;
if($row['MONTH1']==$month)
{
if($row['MONTH']<$month)
{
if($row['DAY1']>=$day)
$show='YES';
}
else if($row['MONTH']==$month)
{
if($row['DAY1']>=$day && $row['DAY']<=$day)
$show = 'YES';
}
if($row['DAY1']>=$day && $row['DAY']<=$day)
$show = 'YES';
}
else if($row['MONTH1']>$month){
if($row['DAY']<=$day)
$show = 'YES';
}
else if($row['MONTH1']<$month)
$show = 'NO';
return $show;
}ID DAY MONTH YEAR DAY1 MONTH1 YEAR1 TITLE
DAY- starting date
DAY1-ending date
similarly for month and year
Thanks