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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.