PeriodiCal
Calendar with period highlighting ability
');
} else {
//init
error_reporting(0);
$day = 60*60*24;
//get numbers
$now = time(); $now = mktime(12, 0, 0, date('n',$now), 1, date('Y',$now));
$last = date_parse_from_format('Y-m-d', $_GET['last']);
$last = mktime(12, 0, 0, $last['month'], $last['day'], $last['year']);
$period=28; if(isset($_GET['period'])) $period = $_GET['period'];
$length=7; if(isset($_GET['len'])) $length = $_GET['len'];
$months=12; if(isset($_GET['months'])) $months = $_GET['months'];
echo('');
$r = 0;
for($i=0;$i<$months;$i++) {
$lm = $m = date('m',$now);
$mo = date('M',$now);
echo("$m ($mo) | ");
while($m == $lm) {
if(round(($now-$last)/$day)%($period) == 0) $r = $length;
$c = '';
if($r>0) $c = '#FF0000';
if($r==1 || $r==$length) $c = '#FF7777';
$r--;
echo("".date('d', $now).' | ');
$now += $day;
$m = date('m',$now);
}
echo('
');
}
echo('
You can bookmark this page it will get updated automatically each month.');
}