Jump to content

Help with Calendar - attribute eventday


ninjaphp

Recommended Posts

Hello, i've been trying to modify a already done calendar, what im trying to do is getting dates where there are an event to get an backgroundcolor.

The problem is that it does work... but if i set an event on 23' of feb i get a backgroundcolor there, which all 23' in every month get, and now i hope someone here can help me.

 

The whole code can be got here: http://nyken.com/test/kalender.rar

Demo can be found here:http://nyken.com/test/

 

The things i've added are:

  function EventDate($estring)
{
$_GET['date'] = date("Y-m-d");
$edate = explode("-", $_GET['date']);
$eyear = $edate[0];
$emonth = $edate[1];
//$eday = $edate[2];

$esql = "SELECT subject FROM notes WHERE date = '$eyear-$emonth-$estring'";
$eresult = mysql_query($esql) or die("SQL-error <br>".mysql_error());

$ediv="ediv";
$eediv="div";

if(mysql_num_rows($eresult) > 0)
{   
return $ediv;
}
else
{
return $eediv;
}

} 

 

And then when it loop the calendar i got

'.EventDate($i).' for the div.

 

So in my thought this should check if there is an event on that date, which it does, but something is wrong as that date gets backgroundcolored every month  >:(

Link to comment
https://forums.phpfreaks.com/topic/39792-help-with-calendar-attribute-eventday/
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.