Jump to content

Event Calendar


Recommended Posts

I am workin on a event calendar and i ran into a problem.. it shows the calendar and the today's date and 1 event on each month but i want it to show all the events for each month. my problem is i can't figure out how to loop it so it will..

 

here is where im having trouble at..

for ($i=0; $i<($maxday+$startday); $i++) {
if(($i % 7) == 0 ){
echo "<tr>";
}
if($i < $startday){
echo ("<td bgcolor='414141'> </td>");
} else {
if (($i - $startday + 1) == $today && $currentmonth == $cMonth && $currentyear == $cYear){
echo ("<td bgcolor='FF0000'><center><font color='FFFFFF'>".($i - $startday + 1)."</font></center></td>");
} else {
[color=red]// this is where i need it to loop[/color]
if (($i - $startday + 1) == $eday && $eMonth == $cMonth && $eYear == $cYear){
echo ("<td bgcolor='0000FF'><center><a class='info' href='#'><font color='FFFFFF'>".($i - $startday + 1)."<span>".$event."<hr><br>".$event_des."</span></font></a></center></td>");
} else { 
echo ("<td bgcolor='595959'><center><font color='FFFFFF'>".($i - $startday + 1)."</font></center></td>");
}
}
if(($i % 7) == 6 ) {
echo "</tr>\n";
}
}
}

i marked where the loop needs to go in red..

 

currently i have the sql query right above it in my script but i tried putting it where i need the loop and i get a error in there or it duplicates the calender and sometimes the numbers. can some please help me?

 

Thank you

Outsider_Child

Link to comment
https://forums.phpfreaks.com/topic/235575-event-calendar/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.