<?
/*
Scryed Labs Financial Manager
Copyright (c) 2005-2007, Scryed Labs
http://www.scryedlabs.com
Financial Manager is copyrighted free software by Waheed Ayubi <hide@address.com>.
You can redistribute it and/or modify it under either the terms of the GPL
(see COPYING.txt), or the terms of the Artistic License (see README.txt).
http://sourceforge.net/projects/financemonitor/
*/
?>
<div class="ns_page_title"><a href="index.php">Financial Monitor</a></div>
<div class="ns_month_nav">
<ul>
<?
for ($i = $NumberOfPastMonths; $i >= ($NumberOfFutureMonths * -1); $i--) {
# Adjust for the following year
if ( ($month - $i) > 12 )
{
$display_month = ($month - $i) - 12;
$display_year = $year + 1;
}
# Adjust for the previous year
else if ( ($month - $i) < 1 )
{
$display_month = ($month - $i) + 12;
$display_year = $year - 1;
}
# Current year, no adjustment needed
else
{
$display_month = ($month - $i);
$display_year = $year;
}
# Display logic for the current month
if ( $i == 0 )
{
print "<li class=\"selected\">";
print date( "F Y", strtotime( returnDate( $display_month, $display_year ) ) );
print "</li>";
}
# Display logic for future or past months
else
{
print "<li><a href='" . $_SERVER['PHP_SELF'] . "?month=" . $display_month . "&year=" . $display_year . "'>";
print date( "F Y", strtotime( returnDate( $display_month, $display_year ) ) );
print "</a></li>";
}
# Logic adds divider between months (excluding last month)
if ( $i > ($NumberOfFutureMonths * -1) )
{
print " - ";
}
}
?>
</ul>
</div>