Re: show events in calendar [message #174757 is a reply to message #174749] |
Sun, 03 July 2011 18:19 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 7/3/2011 11:13 AM, Co wrote:
> Hi All,
>
> I got me some code to show a month calendar and I have a database with
> events.
> Now I want to show the events on the calendar. When there is an event
> on day X I want
> the number to be bold and on a mouse over display the details of the
> event.
>
> Can anyone help me with this?
> here is my code:
> << I didn't put all the code which builds the calendar>>
>
> // Build the heading portion of the calendar table
> echo "<table class=\"maintable\">\n".
> "<tr class='headline'>\n".
> "<td colspan=\"7\">\n".
> "<table align=\"center\">\n".
> "<tr class='headline'>\n".
> "<td colspan=\"2\" width=\"75\" align=\"left\">$previous_link</td>
> \n".
> "<td colspan=\"3\" width=\"150\" align=\"center\">$month_name
> $year</td>\n".
> "<td colspan=\"2\" width=\"75\" align=\"right\">$next_link</td>
> \n".
> "</tr>\n".
> "</table>\n".
> "</td>\n".
> "<tr class='mainrow'>\n".
> "<td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</
> td><td>S</td>\n".
> "</tr>\n";
>
> // Now we break each key of the array
> // into a week and create a new table row for each
> // week with the days of that week in the table data
>
> $i = 0;
> while (list(, $week) = each($weeks))
> {
>
> echo "<tr class='mainrow'>\n";
> while (list(, $d) = each($week)){
>
> if($i< $offset_count){
> //$day_link = "<a href=\"".$_SERVER['PHP_SELF']."?
> date=".mktime(0, 0, 0, $month -1, $d, $year)."\">$d</a>";
> echo "<td class=\"nonmonthdays\">$day_link</td>\n";
> }
> if(($i>= $offset_count)&& ($i< ($num_weeks * 7) - $outset))
> {
> $datecount=mktime(0, 0, 0, $month -1, $d, $year);
> $day_link = "<A href=\"javascript:popWin('editcalendar.php?
> ID=$datecount', 350, 400)\">$d</a>";
> if($date == mktime(0, 0, 0, $month, $d, $year)){
> echo "<td><A href=\"javascript:popWin('editcalendar.php?
> ID=$datecount', 350, 400)\"><font color='red'><b>$d</b></font></a></
> td>\n";
> } else {
> echo "<td class=\"days\">$day_link</td>\n";
> }
> } elseif(($outset> 0)) {
> if(($i>= ($num_weeks * 7) - $outset)){
> $day_link = "";
> echo "<td class=\"nonmonthdays\">$day_link</td>\n";
> }
> }
> $i++;
> }
> echo "</tr>\n";
> }
>
> // Close out your table and that's it!
> echo "<tr class='headline'><td colspan='7' class='days'> </td></
> tr>";
> echo '</table>';
>
>
> Regards
> Marco
Luuk is right. We help those who help themselves. Copying code from
another site is fine - all of us do it.
The difference is - we UNDERSTAND what the code does. If you want to be
a web developer, you must learn HTML, a server-side language such as
PHP, SQL if you're going to use a database, and almost certainly a
client-side language such as javascript.
Your questions here show you have made no attempt to even understand the
differences between technologies and people are rapidly losing interest
in trying to help you. Your attitude is completing the alienation of
others.
Good luck. You're going to need it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|