<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div class="content-header">
    <div class="header-section">
        <h1><i class="fa fa-money"></i><strong>Finances</strong> <br> <small>Finance & Revenue Department | <?php echo SITE_NAME?> &copy; <?php echo date("Y"); ?></small></h1>
    </div>
</div>
<div>
<div class="block">
	<div class="block-title">
		<h3>Finance <strong>Options</strong></h3>
	</div>
	<form class="form-horizontal" action="<?php echo url('/finances/viewreport'); ?>" method="get">
	<div class="form-group">
		<div class="col-md-4"></div>
<div class="col-md-4">
	<center>
		
<?php
$years = StatsData::GetYearsSinceStart();
$months = StatsData::GetMonthsSinceStart();
$months = array_reverse($months, true);
?>
<select class="form-control" name="type">
	<option value="" <?php echo ($_GET['type']=='')?'selected="selected"':''?>>View Summary</option>
<?php
/*
 * Get the years since the VA started
 */
foreach($years as $yearname=>$timestamp)
{
	# Get the one that's currently selected
	if($_GET['type'] == 'y'.$timestamp)
		$selected = 'selected="selected"';
	else
		$selected = '';
	
?>
	<option value="<?php echo 'y'.$timestamp?>" <?php echo $selected?>>Yearly: <?php echo $yearname?></option>
	<?php
}

/*
 * Get all the months since the VA started
 */

foreach($months as $monthname=>$timestamp)
{
	# Get the one that's currently selected
	if($_GET['type'] == 'm'.$timestamp)
		$selected = 'selected="selected"';
	else
		$selected = '';
		
?>
	<option value="<?php echo 'm'.$timestamp?>" <?php echo $selected?>>Monthly: <?php echo $monthname?></option>
<?php
}
?>
</select>
	</center>
</div>
</div>

<center>
	<input class="btn btn-success btn-md" type="submit" name="submit" value="View Report" />
</center>
<br>
</form>
</div>
</div><br /><br>
<hr>