Jump to content

day in calendar not clickable


clausowitz

Recommended Posts

I have a calendar with a month view. I can click on a date to add or edit an event.

The current date is coloured red. I made sure that when I click on next to go to the next month the day is not coloured red.

However when I am in a month, not being the current month I CANNOT click on the day of today.

So if I would like to click on 21 July or 21 September this is not possible. I have tried everything but it doesn't change anything.

 

 <?php 
$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);
		$short = '';
		//$day_link = $d;
		$day_link = "<A href=\"javascript:popWin('editcalendar.php?ID=$datecount', 450, 570)\">$d</a>";
		$query = "SELECT * FROM bl_calender WHERE viewable='1'";
		$r = mysql_query ($query) or die ("Query error: ".mysql_error());
		while($row=mysql_fetch_array($r)) {//Array or records stored in $row
			if($row['dateclass']==$datecount) {
				$short = $row['short'];
				$day_link = "<A href=\"javascript:popWin('editcalendar.php?ID=$datecount', 450,  570)\" title=\"$short\"><FONT style='BACKGROUND-COLOR: yellow'><b>$d  </b></font></a>";}
		}

    	   $this_month = date('M');	
	   if($date == mktime(0, 0, 0, $month, $d, $year)){                                       
		if($this_month == $month_name) {  // only make date red if it is current month
		   echo "<td><A href=\"javascript:popWin('editcalendar.php?ID=$datecount', 450,  570)\" title=\"$short\"><font color='red'><b>$d</b></font></a></td>\n"; 
		   } else {echo "<td><A href=\"javascript:popWin('editcalendar.php?ID=$datecount', 450,  570)\" title=\"$short\"><a style='color:#0066FF'>$d</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>'; 
?>

Link to comment
https://forums.phpfreaks.com/topic/245386-day-in-calendar-not-clickable/
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.