Subversion Repositories VORC

Rev

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

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