MiCalendar
Auteur: Wim - 24 september 2005 - 11:34 - Gekeurd door: nemesiskoen - Hits: 14542 - Aantal punten: 4.67 (3 stemmen)
Kalender scriptje.
Voorbeeld aanwezig!
veel uitleg is er (denk ik) niet bij nodig
|
Code: |
<?php
$now = getdate(time());
$time = mktime(0,0,0, $now['mon'], 1, $now['year']);
$date = getdate($time);
$dayTotal = cal_days_in_month(0, $date['mon'], $date['year']);
print '<table><tr><td colspan="7"><strong>' . $date['month'] . '</strong></td></tr>';
for ($i = 0; $i < 6; $i++) {
print '<tr>';
for ($j = 1; $j <= 7; $j++) {
$dayNum = $j + $i*7 - $date['wday'];
print '<td';
if ($dayNum > 0 && $dayNum <= $dayTotal) {
print ($dayNum == $now['mday']) ? ' style="background #ccc;">' : '>';
print ($dayNum == date("d")) ? '<strong>'.$dayNum.'</strong>' : $dayNum;
}
else
print '>';
print '</td>';
}
print '</tr>';
if ($dayNum >= $dayTotal && $i != 6)
break;
}
print '</table>';
?>
<?php $time = mktime(0,0,0, $now['mon'], 1, $now['year']); print '<table><tr><td colspan="7"><strong>' . $date['month'] . '</strong></td></tr>'; for ($i = 0; $i < 6; $i++) { for ($j = 1; $j <= 7; $j++) { $dayNum = $j + $i*7 - $date['wday']; if ($dayNum > 0 && $dayNum <= $dayTotal) { print ($dayNum == $now['mday']) ? ' style="background #ccc;">' : '>'; print ($dayNum == date("d")) ? '<strong>'.$dayNum.'</strong>' : $dayNum; } else } if ($dayNum >= $dayTotal && $i != 6) break; } ?>
Download code (.txt)
|
|
|
Stemmen |
Niet ingelogd. |
|