<%doc>
IP Reports
</%doc>

<%attr>
title   => 'IP Reports' 
section => 'Reports'
</%attr>

<%args>
$report_type => undef
$version     => 4
$days        => 90
$edit        => 0
</%args>

<%once>
my $ipreports_tab = "";
</%once>

<%init>
my $DEBUG = 0;
my (@headers, @rows) = ();

if (defined($report_type) && $report_type ne "") {
    $ipreports_tab = $report_type;
}
</%init>

<div class="container">
  <div class="containerhead">IP Reports</div>
    <div class="containerbody">
    <p>
      <form name="report_form" action="ip_reports.html" method="POST">
         <select name="report_type" id="report_type">
         <option value="">Select Report</option>
         <option value="unused_subnets" <% (!defined($report_type) || $ipreports_tab eq "unused_subnets")?"SELECTED":"" %>>Unused Subnets</option>
         <option value="unused_v4_subnets" <% ($ipreports_tab eq "unused_v4_subnets")?"SELECTED":"" %>>Unused Subnets (v4)</option>
         <option value="unused_v6_subnets" <% ($ipreports_tab eq "unused_v6_subnets")?"SELECTED":"" %>>Unused Subnets (v6)</option>
         <option value="maxed_v4_subnets" <% ($ipreports_tab eq "maxed_v4_subnets")?"SELECTED":"" %>>Maxed Out Subnets (v4)</option>
         <option value="maxed_v6_subnets" <% ($ipreports_tab eq "maxed_v6_subnets")?"SELECTED":"" %>>Maxed Out Subnets (v6)</option>
         <option value="unused_v4_statics" <% ($ipreports_tab eq "unused_v4_statics")?"SELECTED":"" %>>Unused Static Addresses</option>
         </select>
         <input type="submit" name="submit" class="btn" value="Go" >
      </form>
   </div>
</div>

<%perl>
if ( $report_type eq 'unused_subnets' ){
    $m->comp('unused_subnets.html');
}elsif ( $report_type eq 'unused_v4_subnets' ){
    $m->comp('unused_subnets.html', version=>4);
}elsif( $report_type eq 'unused_v6_subnets' ){
    $m->comp('unused_subnets.html', version=>6);
}elsif ( $report_type eq 'maxed_v4_subnets' ){
    $m->comp('maxed_subnets.html', version=>4);
}elsif ( $report_type eq 'maxed_v6_subnets' ){
    $m->comp('maxed_subnets.html', version=>6);
}elsif ( $report_type eq 'unused_v4_statics' ){
</%perl>
     <div class="container">
        <form name="unused_statics" action="ip_reports.html" method="POST">
        <div class="containerheadleft"><b>Static addresses not seen on the network in the past</b>
          <input type="text" size="3" name="days" value="<% $days %>"><b>days</b>
          <input type="hidden" name="version" value="<% $version %>">
          <input type="hidden" name="report_type" value="<% $report_type %>">
          <input type="submit" name="submit" value="Submit">
        </div>
	<div class="containerheadright">
	   <a href="ip_reports.html?report_type=<% $report_type %>&version=<% $version %>&days=<% $days %>&edit=1">[edit]</a>
        </div>
        </form>
      <div class="containerbody">
        <& 'unused_statics.html', version=>$version, days=>$days, edit=>$edit &>
      </div>
    </div>
%}
