Subversion Repositories ORC

Rev

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

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