Subversion Repositories ORC

Rev

Rev 40 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 40 Rev 41
Line 12... Line 12...
12
my $cookie_string = authenticate(2) || die;
12
my $cookie_string = authenticate(2) || die;
13
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
13
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
14
my $user = getUser($EML);
14
my $user = getUser($EML);
15
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
15
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
Line -... Line 16...
-
 
16
 
-
 
17
my $date = param ("date");
-
 
18
my $dt;
-
 
19
if ($date =~ /^\d{4}-\d{2}-\d{2}$/) {
-
 
20
  my ($YYYY, $MM, $DD) = split /-/, $date;
-
 
21
  $dt = DateTime->new(
-
 
22
    year  => $YYYY,
-
 
23
    month => $MM,
-
 
24
    day   => $DD
-
 
25
  );
16
 
26
} else {
-
 
27
  $dt = DateTime->today;
-
 
28
  $date = $dt->date;
17
my $dt = DateTime->today;
29
}
18
my $day = $dt->day_name;
-
 
Line 19... Line 30...
19
my $date = $dt->date;
30
my $day = $dt->day_name;
20
 
31
 
21
## Uncomment and update to test:
32
## Uncomment and update to test:
Line 22... Line 33...
22
$day = "Wednesday";
33
#$day = "Wednesday";
Line 23... Line 34...
23
$date = "2022-07-13";
34
#$date = "2022-07-13";
Line 24... Line 35...
24
 
35
 
25
my $dbh = WebDB::connect ();
36
my $dbh = WebDB::connect ();
26
 
37
 
27
print CGI::header(-cookie=>$RCAUTH_cookie);
38
print CGI::header(-cookie=>$RCAUTH_cookie);
28
 
39
 
29
print<<output;
40
print<<output;
Line 30... Line 41...
30
<html><head><title>RollerCon VORC - MVP Class Sign-Ups - $day ($date)</title>
41
<html><head><title>RollerCon VORC - MVP Class Sign-Ups - $day ($date)</title>
Line 39... Line 50...
39
 
50
 
40
 
51
 
41
$sth->execute("CLA", $date);
52
$sth->execute("CLA", $date);
42
while (my $g = $sth->fetchrow_hashref()) {
53
while (my $g = $sth->fetchrow_hashref()) {
43
	if ($tcount ne $g->{location}) { #pagebreak whenever we change tracks
54
	if ($tcount ne $g->{location}) { #pagebreak whenever we change tracks
44
		print "<div class='pagebreak'><hr></div>\n" unless !$tcount;
55
		print "<div class='pagebreak'></div>\n" unless (!$tcount or $gcount++ % 2);
45
		print "<div class='pagebreak'><hr></div>\n";
56
#		print "<div class='pagebreak'><hr></div>\n";
46
		$gcount = 1;
57
		$gcount = 1;
Line 47... Line -...
47
		$tcount = $g->{location};
-
 
48
	}
-
 
49
	
-
 
50
	my %crew;
-
 
51
	$crewhan->execute($date, "CLA", $g->{location}, $g->{time});
-
 
52
	while (my ($k, $v) = $crewhan->fetchrow_array()) {
-
 
53
		$crew{$k} = $v;
58
		$tcount = $g->{location};
54
	}
59
	}
55
		
60
	
56
	print<<game;
61
	print<<game;
57
<table>
62
<table>
58
  <tr><td colspan=4>Class: ($g->{location}) $g->{note}</td></tr>
63
  <tr><td colspan=5 class="mvp bold">Class: ($g->{location}) $g->{note}</td></tr>
59
	<tr><td colspan=2>Date: $day ($date)</td><td colspan=2 align=right>Time: $g->{time}</td></tr>
64
	<tr><td colspan=3 class="mvp">Date: $day ($date)</td><td colspan=2 class='mvp right'>Time: $g->{time}</td></tr>
-
 
65
	<tr><td colspan=5 class="mvp">Coach: $g->{role}</td></tr>
60
	<tr><td colspan=4>Coach: $g->{role}</td></tr>
66
	<tr><td colspan=5 class="mvp">&nbsp;</td></tr>
-
 
67
game
-
 
68
 
-
 
69
  my $counter = 1;
-
 
70
	$crewhan->execute($date, "CLA", $g->{location}, $g->{time});
61
	<tr><td colspan=4>&nbsp;</td></tr>
71
	while (my ($derby_name, $real_name) = $crewhan->fetchrow_array()) {
62
game
72
    print "<tr><td class='mvp right'>".$counter++."</td><td>&nbsp;</td><td class='mvp'>".$derby_name."</td><td>&nbsp;</td><td class='mvp'>".$real_name."</td></tr>";
63
  my $counter = 1;
73
	}
-
 
74
	for ($counter..20) {
64
  foreach (sort keys %crew) {
75
	  print "<tr><td class='mvp right'>".$_."</td><td colspan=4>&nbsp;</td></tr>";
Line 65... Line 76...
65
    print "<tr><td>&nbsp;</td><td>".$counter++."</td><td>".$_."</td><td>".$crew{$_}."</td></tr>";
76
	}
66
  }
77
		
Line 67... Line 78...
67
  print "</table><br><br><br><br><br><br><br><br><br><br><br><br>";
78
  print "</table><br><br>";