Subversion Repositories VORC

Rev

Rev 73 | Rev 85 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
56 bgadell 1
#!/usr/bin/perl
2
 
3
# Redirect error messages to a log of my choosing. (it's annoying to filter for errors in the shared env)
4
my $error_log_path = $ENV{SERVER_NAME} eq "volunteers.rollercon.com" ? "/home3/rollerco/logs/" : "/tmp/";
5
close STDERR;
6
open STDERR, '>>', $error_log_path.'vorc_error.log' or warn "Failed to open redirected logfile ($0): $!";
7
#warn "Redirecting errors to ${error_log_path}vorc_error.log";
8
 
9
#if ($ENV{SHELL}) { die "This script shouldn't be executed from the command line!\n"; }
10
 
11
#use strict;
12
use cPanelUserConfig;
13
use CGI qw/param cookie header start_html url/;
14
use HTML::Tiny;
15
use tableViewer;
16
use RollerCon;
17
use DateTime;
18
#use DateTime::Duration;
19
my $now = DateTime->now (time_zone => 'America/Los_Angeles');
20
our $h = HTML::Tiny->new( mode => 'html' );
21
 
22
my $cookie_string;
23
our ($EML, $PWD, $LVL);
24
my $user;
25
my $username;
26
my $RCid;
27
my $RCAUTH_cookie;
28
my $YEAR = 1900 + (localtime)[5];
29
 
30
$cookie_string = authenticate(1) || die;
31
($EML, $PWD, $LVL) = split /&/, $cookie_string;
32
$user = getUser($EML);
33
$user->{department} = convertDepartments $user->{department};
34
$username = $h->a ({ href=>"/schedule/view_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
35
$RCid = $user->{RCid};
36
$RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
37
 
58 bgadell 38
if (!$user->{MVPid} and $LVL < RollerCon::ADMIN and $user->{department}->{MVP} < RollerCon::USER) {
56 bgadell 39
	print header(-cookie=>$RCAUTH_cookie);
40
	printRCHeader("Unauthorized Page");
41
	print $h->div ({ class=>"error" }, "No Access");
42
	print $h->div ("Your user account is not registered to sign up for MVP Classes, so you can't see this page.  It's possible that your access is still being reviewed.  Please be patient.");
43
	print $h->a ({ href=>"/schedule/" }, "[Go Home]");
44
	print $h->close ("html");
45
	exit;
46
}
47
 
48
my $pageTitle = "MVP Classes";
49
my $prefscookie = "allnewmvpclasses";
50
our $DBTABLE = 'v_class';
51
my %COLUMNS = (
52
# colname   =>  [qw(DisplayName       N    type     status)],   status ->  static | default | <blank>
53
	name				=> [qw(Class         5    text     static )],
54
	date				=> [qw(Date         10    date              )],
55
	dayofweek		=> [qw(Day          15    select    default )],
56
	start_time	=> [qw(StartTime    20    text      )],
57
	end_time		=> [qw(EndTime      25    text       )],
58
	time				=> [qw(Time         30    text      default )],
59
	location		=> [qw(Track        35    select    default )],
65 bgadell 60
	level    		=> [qw(Level        37    select    default )],
56 bgadell 61
	coach				=> [qw(Coach        40    select    default )]
62
);
63
 
64
if ($LVL >= RollerCon::ADMIN) {
65
  $COLUMNS{id}       = [qw(Admin         1    none        default )];
66
	$COLUMNS{available}= [qw(SignUp       45    text       )]
67
}
68
 
69
if ($LVL >= RollerCon::ADMIN or $user->{department}->{MVP} >= RollerCon::VOLUNTEER) {
70
	$COLUMNS{note}     = [qw(Notes         60    text         )],
71
	$COLUMNS{capacity} = [qw(Capacity      65    number        default )],
72
	$COLUMNS{count}    = [qw(Count         70    number      default )],
73
}
74
 
58 bgadell 75
if ($user->{MVPid} and $LVL < RollerCon::ADMIN) {
56 bgadell 76
	$COLUMNS{available}= [qw(SignUp       45    text       static)]
77
}
78
 
79
 
80
my $stylesheet = "/style.css";
81
my $homeURL = '/schedule/';
82
my @pagelimitoptions = ("All", 5, 10, 25);
83
 
84
# Set any custom "where" DB filters here...
85
my @whereClause;
86
 
87
# If we need to modify line item values, create a subroutine named "modify_$columnname"
88
#    It will receive a hashref to the object lineitem
89
 
90
#use WebDB;
91
#my $dbh = WebDB::connect;
92
my $dbh = getRCDBH;
93
 
94
sub modify_id {
95
  my $hr = shift;
96
  my $clicky = $hr->{count} ? "event.stopPropagation(); if (confirm('WARNING!\\nYou are modifying a class that someone has signed up for.')==true) {return true;} else {return false;}" : "return true;";
97
  my $extrawarning = $hr->{count} ? "\\nWARNING! It appears someone is signed up for it." : "";
98
  return join "&nbsp;", #$hr->{id},
99
         $h->a ({ href=>"view_class.pl?id=$hr->{id}&choice=Update", onClick=>$clicky }, "[Edit]"),
100
         $h->a ({ href=>"view_class.pl?id=$hr->{id}&choice=Copy" }, "[Copy]"),
101
         $h->a ({ href=>"view_class.pl?id=$hr->{id}&choice=Delete", onClick=>"event.stopPropagation(); if (confirm('Are you sure you want to DELETE this class?$extrawarning')==true) {return true;} else {return false;}" }, "[Delete]")
102
  ;
103
};
104
 
105
sub modify_available {
106
	my $t = shift;
107
 
108
 	my ($yyyy, $mm, $dd) = split /\-/, $t->{date};
109
	my $cutoff = DateTime->new(
110
        year => $yyyy,
111
        month => $mm,
112
        day => $dd,
113
        hour => 5,
114
        minute => 0,
115
        second => 0,
116
        time_zone => 'America/Los_Angeles'
117
  );
118
 
119
  return "CLOSED" unless $now < $cutoff;
120
 
121
	my $classkey = join '|', $t->{date}, $t->{start_time}, $t->{location};
122
 
80 bgadell 123
	($t->{signedup}) = $dbh->selectrow_array ("select role from v_class_signup where RCid = ? and id = ?", undef, $RCid, $t->{id} );
124
	my $droplink = $h->a ({ onClick=>"if (confirm('Really? You want to drop this class?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$t->{id}&role=$t->{signedup}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DROP]");
56 bgadell 125
	if (!$t->{available}) {
126
	  my $full = "FULL";
127
	  $full .= " | ".$droplink unless !$t->{signedup};
128
	  return $full;
129
  }
130
 
131
	$t->{available} .= " Open";
132
  $t->{available} .= " | ".$droplink unless !$t->{signedup};
133
	if (signUpEligible ($ORCUSER, $t, "class")) {
134
		# SIGN UP
73 bgadell 135
		$t->{available} .= " | ".$h->a ({ onClick=>"event.stopPropagation(); window.open('make_shift_change.pl?change=add&RCid=$RCid&id=$classkey','Confirm Class Change','resizable,height=260,width=370'); return false;" }, "[SIGN UP]");
56 bgadell 136
	}
58 bgadell 137
	if ($LVL > 4 or $user->{department}->{VCI} >= 2) {
56 bgadell 138
		# ADD USER
139
		$t->{available} ? $t->{available} .= " | " : {};
73 bgadell 140
		$t->{available} .= $h->a ({ onClick=>"event.stopPropagation(); window.open('make_shift_change.pl?change=lookup&RCid=$RCid&id=$classkey','Confirm Class Change','resizable,height=260,width=370'); return false;" }, "[ADD USER]");
56 bgadell 141
	}
142
 
143
	return $t->{available};
144
}
145
 
146
sub filter_available {
147
  my $colName = shift;
148
	my $filter = shift;
149
 
150
	if (defined $filter)	{
151
		if ($filter eq "Full") {
152
			return "$colName = 0";
153
		}
154
		return "$colName > 0";
155
	}	else {
156
		my $thing = "filter-${colName}";
157
		my $Options = "<OPTION></OPTION>"."<OPTION>Available</OPTION>"."<OPTION>Full</OPTION>";
158
 
159
		$Options =~ s/>($FORM{$thing})/ selected>$1/;
160
		return "<SELECT name=filter-${colName} $onChange>$Options</SELECT>";
161
	}
162
}
163
 
164
sub modify_time {
165
  my $t = shift;
166
  return convertTime $t->{time};
167
}
168
 
169
sub modify_start_time {
170
  my $t = shift;
171
  return convertTime $t->{start_time};
172
}
173
 
174
sub modify_end_time {
175
  my $t = shift;
176
  return convertTime $t->{end_time};
177
}
178
 
179
 
180
# Ideally, nothing below this comment needs to change
181
#-------------------------------------------------------------------------------
182
 
183
 
184
our %NAME              = map  { $_ => $COLUMNS{$_}->[0] } keys %COLUMNS;
185
our %colOrderHash      = map  { $_ => $COLUMNS{$_}->[1] } keys %COLUMNS;
186
our %colFilterTypeHash = map  { $_ => $COLUMNS{$_}->[2] } keys %COLUMNS;
187
our @staticFields      = sort byfield grep { $COLUMNS{$_}->[3] eq 'static' } keys %COLUMNS;
188
our @defaultFields     = sort byfield grep { defined $COLUMNS{$_}->[3] } keys %COLUMNS;
189
#our @defaultFields     = grep { $COLUMNS{$_}->[3] eq 'default' or inArray ($_, \@staticFields) } keys %COLUMNS;
190
 
191
our @allFields = sort byfield keys %NAME;
192
our @displayFields = ();
193
our @hideFields = ();
194
my $QUERY_STRING;
195
 
196
my $pagelimit = param ("limit") // "All"; #$pagelimitoptions[$#pagelimitoptions];
197
my $curpage = param ("page") // 1;
198
 
199
our %FORM;
200
my $FILTER;
201
foreach (param()) {
202
 	if (/^year$/) { #
203
		$YEAR = param($_);
204
		next;
205
	}
206
 
207
	$FORM{$_} = param($_);				# Retrieve all of the FORM data submitted
208
 
209
	if ((/^filter/) and ($FORM{$_} ne '')) {	# Build a set of filters to apply
210
		my ($filter,$field) = split /-/, $_;
211
		$FILTER->{$field} = $FORM{$_} unless notInArray ($field, \@allFields);
212
	}	elsif ($FORM{$_} eq "true")	{		# Compile list of fields to display
213
	  if ($_ ne "shiftinclude") {
214
		  push @displayFields, $_;
215
		}
216
	}
217
}
218
 
219
push @whereClause, "year(date) = '$YEAR'";
220
 
221
if (exists $FORM{autoload})	{			# If the FORM was submitted (i.e. the page is being redisplayed),
222
							                    #  	build the data for the cookie that remembers the page setup
223
	my $disFields = join ":", @displayFields;
224
	my $fils = join ":", map { "$_=$FILTER->{$_}" } keys %{$FILTER};
225
 
226
	$QUERY_STRING = $disFields.'&'.$fils.'&'.$FORM{sortby}.'&'.$FORM{autoload}.'&'.$FORM{shiftinclude};
227
}
228
 
229
 
230
if (!(exists $FORM{autoload}))	{			# No FORM was submitted...
231
	if (my $prefs = cookie ($prefscookie) and !defined param ("ignoreCookie"))	{ # Check for cookies from previous visits.
232
		my ($disF, $filts, $sb, $al, $si) = split /&/,$prefs;
233
		@displayFields = split /:/,$disF;
234
 
235
		foreach my $pair (split /:/, $filts)	{
236
			my ($key, $value) = split /=/, $pair;
237
			$FORM{"filter-$key"} = $value;
238
			$FILTER->{$key} = $value;
239
		}
240
 
241
		$FORM{sortby} = $sb;
242
		$FORM{autoload} = $al;
243
		$FORM{shiftinclude} = $si;
244
		$QUERY_STRING = $prefs;
245
	}	else {
246
	  @displayFields = @defaultFields; # Otherwise suppply a default list of columns.
247
	  $FORM{autoload} = 1;             # And turn aut0load on by default.
248
		$FORM{sortby} = "note";
249
	}
250
}
251
 
252
# let's just make sure the columns are in the right order (and there aren't any missing)
253
@displayFields = grep { inArray($_, \@allFields) } sort byfield uniq @displayFields, @staticFields;
254
 
255
# If the field isn't in the displayFields list,	then add it to the hideFields list
256
@hideFields = grep { notInArray ($_, \@displayFields) } @allFields;
257
 
258
# Process any filters provided in the form to pass to the database
259
push @whereClause, map { filter ($_, $FILTER->{$_}) } grep { defined $FILTER->{$_} } @displayFields;
260
push @whereClause, "year(date) = '$YEAR'";
261
#warn join " and ", @whereClause;
262
 
263
							#  Given the fields to display and the where conditions,
264
							#	  "getData" will return a reference to an array of
265
							#	  hash references of the results.
266
my ($data, $datacount) = getData (\@displayFields, \@whereClause, $DBTABLE, $FORM{sortby}, $curpage, $pagelimit);
267
my @ProductList = @{ $data };
268
 
269
#my @ProductList = @{ getData (\@displayFields, \@whereClause, $DBTABLE, $FORM{sortby}, $curpage, $pagelimit) };
270
my $x = scalar @ProductList; # How many results were returned?
271
 
272
# If the user is trying to download the Excel file, send it to them and then exit out.
273
if ($FORM{excel}) {
274
  exportExcel (\@ProductList, "MVP_Class_List");
275
  exit;
276
}
277
 
278
my @shifts;
279
if ($FORM{shiftinclude} eq "true") {
280
  my @SIWhere; # = ("year(date) = '$YEAR'");
281
  push @SIWhere, "RCid = $ORCUSER->{RCid}";
282
  my ($d, $c) = getData (\@displayFields, \@SIWhere, 'v_class_signup', $FORM{sortby});
283
  @shifts = @{ $d };
284
}
285
 
286
my $signedOnAs = $username ? "Welcome, $username. ".$h->a ({ href=>"index.pl", onClick=>"document.cookie = 'RCAUTH=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';return true;" }, "[Log Out]") : "You are not signed in.";
287
 
288
# Set some cookie stuff...
65 bgadell 289
my $path = `dirname $ENV{SCRIPT_NAME}`; chomp $path; $path .= '/' unless $path eq "/";
56 bgadell 290
my $queryCookie = cookie(-NAME=>$prefscookie,
291
			-VALUE=>"$QUERY_STRING",
292
			-PATH=>"$path",
293
			-EXPIRES=>'+365d');
294
 
295
my $SIChecked;
296
if ($FORM{shiftinclude}) {
297
  $SIChecked = $h->input ({ type=>"checkbox", name=>"shiftinclude", value=>"true", checked=>[], onClick=>'submit();' });
298
} else {
299
  $SIChecked = $h->input ({ type=>"checkbox", name=>"shiftinclude", value=>"true", onClick=>'submit();' });
300
}
301
 
302
# Print the header
303
print header(-cookie=>[$RCAUTH_cookie,$queryCookie]);
304
 
305
# 	print "<!-- FORM \n\n";				# Debug code to dump the FORM to a html comment
306
#	print "I'm catching updates!!!\n\n";
307
#	foreach $key (sort (keys %FORM))		#	Must be done after the header is written!
308
# 		{ print "\t$key:  $FORM{$key}\n"; }
309
# 	print "--> \n\n";
310
#
311
#
312
# 	print "<!-- ENV \n\n";				# Debug code to dump the ENV to a html comment
313
# 	foreach $key (sort (keys %ENV))			#	Must be done after the header is written!
314
# 		{ print "\t$key:  $ENV{$key}\n"; }
315
# 	print "--> \n\n";
316
#
317
# 	print "\n\n\n\n<!-- $QUERY_STRING --> \n\n\n\n";
318
 
319
 
320
#------------------
321
 
322
# Toggle the autoload fields within the table elements
323
our ($onClick, $onChange);   # (also used in scanFunctions)
324
my ($radiobutton, $refreshbutton, $sortby);
325
if ($FORM{autoload}) {
326
	$onClick = "onClick='submit();'";
327
	$onChange = "onChange='page.value = 1; submit();'";
328
  $radiobutton = $h->div ({ class=>'autoload' },
329
    ["Autoload Changes: ",
330
    $h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>1, onClick=>'submit();', checked=>[] }), "On ",
331
    $h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>0, onClick=>'submit();' }), "Off ",
332
    ]);
333
  $refreshbutton = "";
334
  $sortby = $h->select ({name=>"sortby", onChange=>'submit();' }, [ map { $FORM{sortby} eq $_ ? $h->option ({ value=>$_, selected=>[] }, $NAME{$_}) : $h->option ({ value=>$_ }, $NAME{$_}) } @displayFields ]);
335
} else {
336
  $onClick = "";
337
	$onChange = "onChange='page.value = 1;'";
338
  $radiobutton = $h->div ({ class=>'autoload' },
339
    ["Autoload Changes: ",
340
    $h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>1, onClick=>'submit();' }), "On ",
341
    $h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>0, onClick=>'submit();', checked=>[] }), "Off ",
342
    ]);
343
  $refreshbutton = $h->input ({ type=>"button", value=>"Refresh", onClick=>"submit(); return false;" });
344
  $sortby = $h->select ({name=>"sortby" }, [ map { $FORM{sortby} eq $_ ? $h->option ({ value=>$_, selected=>[] }, $NAME{$_}) : $h->option ({ value=>$_ }, $NAME{$_}) } @displayFields ]);
345
}
346
 
347
print start_html (-title => $pageTitle, -style => {'src' => $stylesheet} );
348
 
349
print $h->open ('form', { action=>url, method=>'POST', name=>'Req' });
350
print $h->input ({ type=>"hidden", name=>"excel", value=>0 });
351
print $h->div ({ class => "accent pageheader" }, [
352
  $h->h1 ($pageTitle),
353
  $h->div ({ class=>"sp0" }, [
354
    $h->div ({ class=>"spLeft" }, [
355
      $radiobutton
356
    ]),
357
    $h->div ({ class=>"spRight" }, [
358
      $h->input ({ type=>"button", value=>"Home", onClick=>"window.location.href='$homeURL'" }),
359
      $refreshbutton
360
    ]),
361
  ]),
362
]);
363
 
364
# Print the Hidden fields' check boxes (if there are any)
365
 
366
my $c = 1;
367
my @hiddencheckboxes;
368
my @hiddenrows;
369
foreach my $field (sort { $NAME{$a} cmp $NAME{$b}; } @hideFields) {
370
  if ($FORM{autoload}) {
371
    push @hiddencheckboxes, $h->div ({ class=>'rTableCell quarters nowrap', onClick=>"Req.$field.click();" }, [ $h->input ({ type=>'checkbox', class=>'accent', name=>$field, value=>'true', onClick=>"event.stopPropagation(); submit();" }), $NAME{$field} ]);
372
  } else {
373
    push @hiddencheckboxes, $h->div ({ class=>'rTableCell quarters nowrap', onClick=>"Req.$field.checked=!Req.$field.checked;" }, [ $h->input ({ type=>'checkbox', class=>'accent', name=>$field, value=>'true', onClick=>"event.stopPropagation();" }), $NAME{$field} ]);
374
  }
375
  if ($c++ % 4 == 0) {
376
    push @hiddenrows, $h->div ({ class=>'rTableRow' }, [ @hiddencheckboxes ]);
377
    @hiddencheckboxes = [];
378
  }
379
}
380
push @hiddenrows, $h->div ({ class=>'rTableRow' }, [ @hiddencheckboxes ]) unless --$c % 4 == 0;
381
 
382
my @yearoptions;
383
foreach (@{&getYears()}) {
384
	push @yearoptions, $YEAR eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_);
385
}
386
 
387
if (scalar @hideFields) {
388
  my @topleft;
389
  push @topleft, $h->div ({ class=>"nowrap" }, "Hidden Columns:");
390
  push @topleft, $h->div ({ class=>'rTable' }, [ @hiddenrows ]);
391
 
392
  print $h->div ({ class=>"sp0" }, [
393
    $h->div ({ class=>"spLeft"  }, [ @topleft ]),
394
    $h->div ({ class=>"spRight" }, [
395
      $signedOnAs, $h->br,
396
      "Show my classes: ", $SIChecked, $h->br,
397
      $h->input ({ type=>"button", value=>"Block Personal Time", onClick=>"window.location.href='personal_time.pl'" }),
398
    ])
399
  ]);
400
}
401
 
402
# Print the main table...............................................
403
 
404
print $h->open ('div', { class=>'rTable' });
405
 
406
my @tmptitlerow;
407
foreach my $f (@displayFields)	{  # Print the Column headings
408
  if (inArray ($f, \@staticFields)) {
409
    push @tmptitlerow, $h->div ({ class=>'rTableHead' }, [ $h->input ({ type=>"hidden", name=>$f, value=>"true" }), $NAME{$f} ]);
410
  } else {
411
    if ($FORM{autoload}) {
412
      push @tmptitlerow, $h->div ({ class=>'rTableHead', onClick=>"Req.$f.click();" }, [ $h->input ({ type=>"checkbox", class=>"accent", name=>$f, value=>"true", checked=>[], onClick=>'event.stopPropagation(); submit();' }), $NAME{$f} ]);
413
    } else {
414
      push @tmptitlerow, $h->div ({ class=>'rTableHead', onClick=>"Req.$f.checked=!Req.$f.checked;" }, [ $h->input ({ type=>"checkbox", class=>"accent", name=>$f, value=>"true", checked=>[], onClick=>"event.stopPropagation();" }), $NAME{$f} ]);
415
    }
416
  }
417
}
418
 
419
# Print the filter boxes...
420
print $h->div ({ class=>'rTableHeading' }, [ @tmptitlerow ], [ map { $h->div ({ class=>'rTableCell filters' }, filter ($_)) } @displayFields ], $h->div ({ class=>"rTableCell" }));
421
 
422
if ($FORM{shiftinclude}) {  # Include all of the user's shifts at the top
423
  foreach my $t (@shifts)	{
424
	  print $h->div ({ class=>'rTableRow highlighted' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_} ? $t->{$_} : "") } @displayFields ]);
425
  }
426
  print $h->hr ({ width=>"500%" });
427
}
428
 
429
# Print the things
430
foreach my $t (@ProductList)	{
431
  my @display = map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_}) } @displayFields;
432
  if ($LVL >= RollerCon::ADMIN or $user->{department}->{MVP} >= RollerCon::VOLUNTEER) {
433
    print $t->{signedup} ? $h->div ({ class=>'rTableRow highlighted', onclick=>"location.href='view_class.pl?id=$t->{id}&choice=View'" }, [ @display ])
434
                         : $h->div ({ class=>'rTableRow shaded',      onclick=>"location.href='view_class.pl?id=$t->{id}&choice=View'" }, [ @display ]);
435
  } else {
436
    print $t->{signedup} ? $h->div ({ class=>'rTableRow highlighted' }, [ @display ])
437
                         : $h->div ({ class=>'rTableRow shaded' },      [ @display ]);
438
  }
439
}
440
 
441
print $h->close ('div');
442
 
443
# close things out................................................
444
 
445
my $pages = $pagelimit eq "All" ? 1 : int( $datacount / $pagelimit + 0.99 );
446
if ($curpage > $pages) { $curpage = $pages; }
447
 
448
my @pagerange;
449
if ($pages <= 5 ) {
450
  @pagerange = 1 .. $pages;
451
} else {
452
  if ($curpage <= 3) {
453
    @pagerange = (1, 2, 3, 4, ">>");
454
  } elsif ($curpage >= $pages - 2) {
455
    @pagerange = ("<<", $pages-3, $pages-2, $pages-1, $pages);
456
  } else {
457
    @pagerange = ("<<", $curpage-1, $curpage, $curpage+1, ">>");
458
  }
459
}
460
 
461
my @excelcode;
462
push @excelcode, $h->br;
463
push @excelcode, $h->a ({ href=>"", target=>"_new", onClick=>"window.document.Req.excel.value=1; window.document.Req.submit(); window.document.Req.excel.value=0; return false;" }, "[Export Displayed Data as an Excel Document.]");
464
 
465
print $h->br; # print $h->br;
466
print $h->div ({ class=>"sp0" }, [
467
    $h->div ({ class=>"spLeft" }, [
468
      $h->div ({ class=>"footer" }, [
469
        "To bookmark, save, or send this exact view, use the ",
470
        $h->a ({ href=>'', onClick=>"window.document.Req.method = 'GET'; Req.submit(); return false;" }, "[Full URL]"),
471
        $h->br,
472
        "If this page is displaying oddly, ", $h->a ({ href=>url ()."?ignoreCookie=1" }, "[Reset Your View]"),
473
        @excelcode,
474
        $h->br,
475
        "This page was displayed on ", currentTime (),
476
        $h->br,
65 bgadell 477
        "Please direct questions, problems, and concerns to $SYSTEM_EMAIL",
56 bgadell 478
        $h->br,
479
        "Displaying: ", $h->select ({ name=>"year", onchange=>"Req.submit();" }, [ @yearoptions ])
480
      ])
481
    ]),
482
    $h->div ({ class=>"spRight" }, [
483
      $h->h5 ([
484
               "$x of $datacount Record". ($x == 1 ? "" : "s") ." Displayed", $h->br,
485
               "Sorted by ", $sortby, $h->br,
486
               "Displaying ", $h->select ({ name=>"limit", onChange=>"page.value = 1; submit();" }, [ map { $pagelimit == $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } @pagelimitoptions ]), " Per Page", $h->br,
487
               ( $pages > 1 ? ( join " ", map { $_ == $curpage ? "<B>$_</b>" :
488
                                                $_ eq "<<"     ? $h->a ({ onClick=>qq{Req.page.value=1; Req.submit();} }, "$_") :
489
                                                $_ eq ">>"     ? $h->a ({ onClick=>qq{Req.page.value=$pages; Req.submit();} }, "$_") :
490
                                                                 $h->a ({ onClick=>qq{Req.page.value=$_; Req.submit();} }, "[$_]") } @pagerange ) : "" ), $h->br,
491
               $h->input ({ type=>"hidden", name=>"page", value=>$curpage })
492
      ])
493
    ]),
494
]);
495
 
496
print $h->close('form');
497
print $h->close('html');