Subversion Repositories ORC

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
40 - 1
#!/usr/bin/perl
2
 
3
use strict;
4
use cPanelUserConfig;
5
use RollerCon;
6
use WebDB;
7
use tableViewer;
8
use CGI;
9
use CGI::Cookie;
10
use DateTime;
11
 
12
my $cookie_string = authenticate(2) || die;
13
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
14
my $user = getUser($EML);
15
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
16
 
17
my $dt = DateTime->today;
18
my $day = $dt->day_name;
19
my $date = $dt->date;
20
 
21
## Uncomment and update to test:
22
$day = "Wednesday";
23
$date = "2022-07-13";
24
 
25
my $dbh = WebDB::connect ();
26
 
27
print CGI::header(-cookie=>$RCAUTH_cookie);
28
 
29
print<<output;
30
<html><head><title>RollerCon VORC - MVP Class Sign-Ups - $day ($date)</title>
31
<link rel="stylesheet" type="text/css" href="/rollercon.css">
32
</head>
33
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
34
output
35
 
36
my $gcount = 1; my $tcount = '';
37
my $sth = $dbh->prepare("select distinct note, role, location, time from v_shift where dept = ? and date = ? order by location, time");
38
my $crewhan = $dbh->prepare("select v_shift.derby_name, real_name from v_shift, official where v_shift.RCid = official.RCid and date = ? and dept = ? and isnull(v_shift.derby_name) = 0 and location = ? and time = ? order by v_shift.derby_name");
39
 
40
 
41
$sth->execute("CLA", $date);
42
while (my $g = $sth->fetchrow_hashref()) {
43
	if ($tcount ne $g->{location}) { #pagebreak whenever we change tracks
44
		print "<div class='pagebreak'><hr></div>\n" unless !$tcount;
45
		print "<div class='pagebreak'><hr></div>\n";
46
		$gcount = 1;
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;
54
	}
55
 
56
	print<<game;
57
<table>
58
  <tr><td colspan=4>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>
60
	<tr><td colspan=4>Coach: $g->{role}</td></tr>
61
	<tr><td colspan=4>&nbsp;</td></tr>
62
game
63
  my $counter = 1;
64
  foreach (sort keys %crew) {
65
    print "<tr><td>&nbsp;</td><td>".$counter++."</td><td>".$_."</td><td>".$crew{$_}."</td></tr>";
66
  }
67
  print "</table><br><br><br><br><br><br><br><br><br><br><br><br>";
68
 
69
	$gcount++ % 2 == 0 ? print "<div class='pagebreak'><hr></div>\n" : { };
70
}
71
 
72
 
73
 
74
print<<tail;
75
</BODY>
76
</HTML>
77
tail