Subversion Repositories VORC

Rev

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