Subversion Repositories ORC

Rev

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

Rev 25 Rev 38
Line 1... Line 1...
1
#!/usr/bin/perl
1
#!/usr/bin/perl
Line 2... Line 2...
2
 
2
 
3
use strict;
3
use strict;
4
use cPanelUserConfig;
4
use cPanelUserConfig;
5
use RollerCon;
5
use RollerCon;
-
 
6
use tableViewer;
6
use scanFunctions;
7
use WebDB;
7
use CGI;
8
use CGI;
8
use CGI::Cookie;
9
use CGI::Cookie;
Line 9... Line 10...
9
use DateTime;
10
use DateTime;
Line 18... Line 19...
18
my $day = $dt->day_name;
19
my $day = $dt->day_name;
19
my $date = $dt->date;
20
my $date = $dt->date;
20
my $curtime = $dt->hms;
21
my $curtime = $dt->hms;
Line 21... Line 22...
21
 
22
 
22
#$day = "Wednesday";
23
#$day = "Wednesday";
Line 23... Line 24...
23
#$date = "2019-07-17";
24
#$date = "2022-07-13";
24
 
25
 
25
my %class = qw(
26
my %class = qw(
26
	U Unrestricted
27
	U Unrestricted
27
	M Mens
28
	M Mens
28
	W Womens
29
	W Womens
Line 29... Line 30...
29
	SS Single-Gender
30
	SS Single-Gender
Line 30... Line 31...
30
);
31
);
Line 31... Line 32...
31
 
32
 
32
my $dbh = getDBConnection();
33
my $dbh = WebDB::connect ();
Line 45... Line 46...
45
output
46
output
Line 46... Line 47...
46
 
47
 
47
my $rnh = $dbh->prepare("select * from v_shift_admin_view where id = (select id from game where date = ? and track = ? and time < CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') and end_time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles'))");
48
my $rnh = $dbh->prepare("select * from v_shift_admin_view where id = (select id from game where date = ? and track = ? and time < CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') and end_time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles'))");
Line 48... Line 49...
48
my $nuh = $dbh->prepare("select * from v_shift_admin_view where id = (select id from game where date = ? and track = ? and time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') order by time limit 1)");
49
my $nuh = $dbh->prepare("select * from v_shift_admin_view where id = (select id from game where date = ? and track = ? and time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') order by time limit 1)");
49
 
50
 
Line 50... Line 51...
50
my $lrnh = $dbh->prepare("select * from v_lead_shift where id in (select id from lead_shift where date = ? and start_time < CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') and end_time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles')) order by track");
51
my $lrnh = $dbh->prepare("select * from v_shift where id in (select id from v_shift where dept = ? and date = ? and start_time < CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') and end_time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles')) order by location");
51
my $lnuh = $dbh->prepare("select * from v_lead_shift where id in (select id from lead_shift where date = ? and start_time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') order by track, start_time)");
52
my $lnuh = $dbh->prepare("select * from v_shift where id in (select id from v_shift where dept = ? and date = ? and start_time > CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles') order by location, start_time)");
52
 
53
 
53
#my $gcount = 1; my $tcount = '';
54
#my $gcount = 1; my $tcount = '';
Line 58... Line 59...
58
 
59
 
Line 59... Line 60...
59
print "<table>\n<tr><td colspan=5><b>Right Now [$day $curtime Track $track]</b></td></tr></table><br>\n";
60
print "<table>\n<tr><td colspan=5><b>Right Now [$day $curtime Track $track]</b></td></tr></table><br>\n";
60
 
61
 
61
 
62
 
62
print "<table>\n<tr><td colspan=5><b>All Leads On Duty</b></td></tr>\n";
63
print "<table>\n<tr><td colspan=5><b>All Leads On Duty</b></td></tr>\n";
63
$lrnh->execute($date);
64
$lrnh->execute("OFF", $date);
64
while (my $lshift = $lrnh->fetchrow_hashref()) {
65
while (my $lshift = $lrnh->fetchrow_hashref()) {
65
	print "<tr><td>$lshift->{track}</td><td>&nbsp;</td><td>$lshift->{time}</td><td>&nbsp;</td><td>$lshift->{derby_name}</td></tr>\n";
66
	print "<tr><td>$lshift->{location}</td><td>&nbsp;</td><td>$lshift->{time}</td><td>&nbsp;</td><td>$lshift->{derby_name}</td></tr>\n";
Line 66... Line 67...
66
}
67
}
Line 128... Line 129...
128
 
129
 
Line 129... Line 130...
129
 
130
 
130
print "<table>\n<tr><td colspan=5><b>Next Up...</b></td></tr></table>\n";
131
print "<table>\n<tr><td colspan=5><b>Next Up...</b></td></tr></table>\n";
131
 
132
 
132
print "<table>\n<tr><td colspan=5><b>Leads On Duty Later</b></td></tr>\n";
133
print "<table>\n<tr><td colspan=5><b>Leads On Duty Later</b></td></tr>\n";
133
$lnuh->execute($date);
134
$lnuh->execute("OFF", $date);
134
while (my $lshift = $lnuh->fetchrow_hashref()) {
135
while (my $lshift = $lnuh->fetchrow_hashref()) {
135
	print "<tr><td>$lshift->{track}</td><td>&nbsp;</td><td>$lshift->{time}</td><td>&nbsp;</td><td>$lshift->{derby_name}</td></tr>\n";
136
	print "<tr><td>$lshift->{location}</td><td>&nbsp;</td><td>$lshift->{time}</td><td>&nbsp;</td><td>$lshift->{derby_name}</td></tr>\n";
Line 136... Line 137...
136
}
137
}