Not sure if the title makes any sense so heres what I'm after
Given a set of links: Jan -> Dec
what I'm looking to do is this (based on today being in Jan)
Jan: ?m=1&y=2010
Feb: ?m=2&y=2009
Mar: ?m=3&y=2009
Apr: ?m=4&y=2009
May: ?m=5&y=2009
Jun: ?m=6&y=2009
Jul: ?m=7&y=2009
Aug: ?m=8&y=2009
Sep: ?m=9&y=2009
Aug: ?m=10&y=2009
Nov: ?m=11&y=2009
Dec: ?m=12&y=2009
As the year progresses you'll get to
Jan: ?m=1&y=2010
Feb: ?m=2&y=2010
Mar: ?m=3&y=2010
Apr: ?m=4&y=2010
May: ?m=5&y=2010
Jun: ?m=6&y=2010
Jul: ?m=7&y=2010
Aug: ?m=8&y=2010
Sep: ?m=9&y=2010
Aug: ?m=10&y=2010
Nov: ?m=11&y=2010
Dec: ?m=12&y=2009
once december is reached you'll have links for all 2010 and no 2009... once january comes youll have jan 2011 and all other will be 2010
what I'm currently working with is static and every link will always have the same year
$months = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
//$nowMonth = date('j');
//$nowYear = date('Y');
echo '<ul id="ribbon">';
echo '<li class="root">Overages</li>'."\n";
$i=1;
foreach ($months as $month)
{
echo '<li><a
href="javascript:void(0);"
onClick="javascript:doAction(\''.urlencode($getAction).'&Month='.$i.'&Year='.date('Y').'\')">'.$month.'</a></li>'."\n";
$i++;
}
echo '</ul>';
soo I'm trying to make it dynamic as I can't have (in Januarys instance) data for Feb 2010 but I have data for Feb 2009 through Dec 2009
Hope I explained it well enough