Will things ever be the same again?
[freeside.git] / httemplate / elements / tr-select-from_to.html
1 %
2 %
3 %  #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
4 %  my ($curmon,$curyear) = (localtime(time))[4,5];
5 %  
6 %  #find first month
7 %  my $syear = 1899+$curyear;
8 %  my $smonth = $curmon+1;
9 %  
10 %  #want 12 month by default, not 13
11 %  $smonth++;
12 %  if ( $smonth > 12 ) { $smonth-=12; $syear++ }
13 %  
14 %  #find last month
15 %  my $eyear = 1900+$curyear;
16 %  my $emonth = $curmon+1;
17 %
18 %  my %hash = (
19 %    'show_month_abbr' => 1,
20 %    'start_year'      => '1999',
21 %    'end_year'        => '2012', #haha, well...
22 %     @_,
23 %  );
24 %
25 %
26
27
28 <TR>
29   <TD ALIGN="right">From: </TD>
30   <TD>
31     <% include('/elements/select-month_year.html',
32                   'prefix'        => 'start',
33                   'selected_mon'  => $smonth,
34                   'selected_year' => $syear,
35                   %hash,
36                )
37     %>
38   </TD>
39 </TR>
40
41 <TR>
42   <TD ALIGN="right">To: </TD>
43   <TD>
44     <% include('/elements/select-month_year.html',
45                   'prefix'        => 'end',
46                   'selected_mon'  => $emonth,
47                   'selected_year' => $eyear,
48                   %hash,
49                )
50     %>
51   </TD>
52 </TR>