I have a php calendar at http://idea-palette.com/aleventcal/calendar.php. I want the days that are not part of the current month to show up grayed out(which it does now), and I want it to appear as those are the days of the previous and next month.
Şimdi olduğu gibi, ayın ilk gününden önce görünür gün gibi olumsuz numaraları görünür (-1, -2, -3, ve benzeri) ve ayın son gününden sonra görünen gün hemen devam bir ay 31 biter eğer öyleyse, o zaman bu kadar üzerinde 32, 33, 34 okumak, ve olacaktır.
Ben başka bir şey yapmak daha sonra toplam gün daha büyükse ve ben görebiliyordu döngü çeşit koşullu bir ifadeyi anlamaya çalışıyorum. Gördüğüm sorun yaratılıyor tablo hücre döngüye ediliyor, bu yüzden ben sadece $ günde 1 yaparsanız yerine 32, daha sonra, sadece 33 okuyacaktır.
İşte benim kod:
for($i=0; $i< $total_rows; $i++)
{
for($j=0; $j<7;$j++)
{
$day++;
//if the current day is less or equal to the total days in the month
if($day>0 && $day<=$total_days_of_current_month)
{
$date_form = "$current_year/$current_month/$day";
echo '<div class="date_has_event" href="#"><td';
//If the date is today then give the td cell the 'today' class
if($date_form == $today)
{
echo ' class="today"';
}
//check if any event stored for the date
if(array_key_exists($day,$events))
{
//adding the date_has_event class to the <td> and close it
echo ' class="date_has_event">'.$day;
//adding the eventTitle and eventContent wrapped inside <span> & <li> to <ul>
echo '<div class="events"><ul>'.$events[$day].'</ul></div>';
}
}
else //if the current day is less or more than the total days in the month
{
//then create a table cell with the current day of the mont
echo '<td class="padding">' . $day . ' </td>'; h
}
}
}