Subversion Repositories VORC

Rev

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

Rev 239 Rev 296
Line 16... Line 16...
16
my $dbh = getDBConnection ();
16
my $dbh = getDBConnection ();
17
my $DEPT = getDepartments ();
17
my $DEPT = getDepartments ();
Line 18... Line 18...
18
 
18
 
19
my $RCidListQuery=<<endRCidListQuery;
19
my $RCidListQuery=<<endRCidListQuery;
20
  select distinct RCid from (
20
  select distinct RCid from (
21
  	select distinct RCid from v_shift             where year(date) = year(curdate()) and dept <> "PER" and dept <> "CLA" union
21
  	select distinct RCid from v_shift             where year(date) = year(curdate()) and dept <> "PER" and dept <> "CLA" and dept <> "SEM" union
22
    select distinct RCid from v_shift_announcer   where year(date) = year(curdate()) union
22
    select distinct RCid from v_shift_announcer   where year(date) = year(curdate()) union
23
    select distinct RCid from v_shift_officiating where year(date) = year(curdate())
23
    select distinct RCid from v_shift_officiating where year(date) = year(curdate())
24
    ) t1
24
    ) t1
25
  where RCid <> ''
25
  where RCid <> ''
26
  order by cast(RCid as unsigned)
26
  order by cast(RCid as unsigned)
27
endRCidListQuery
27
endRCidListQuery
Line 28... Line 28...
28
my $sth1 = $dbh->prepare($RCidListQuery);
28
my $sth1 = $dbh->prepare($RCidListQuery);
29
 
29
 
30
my $SchedQuery=<<endSchedQuery;
30
my $SchedQuery=<<endSchedQuery;
31
  select * from (
31
  select * from (
32
  	select id, date, dayofweek,          location, time, volhours,          dept, role, '' as teams from v_shift             where year(date) = year(curdate()) and RCid = ? and dept <> "PER" and dept <> "CLA" union
32
  	select id, date, dayofweek,          location, time, volhours,          dept, role, '' as teams from v_shift             where year(date) = year(curdate()) and RCid = ? and dept <> "PER" and dept <> "CLA" and dept <> "SEM" union
33
    select id, date, dayofweek, track as location, time, volhours, "ANN" as dept, role,       teams from v_shift_announcer   where year(date) = year(curdate()) and RCid = ? union
33
    select id, date, dayofweek, track as location, time, volhours, "ANN" as dept, role,       teams from v_shift_announcer   where year(date) = year(curdate()) and RCid = ? union
34
    select id, date, dayofweek, track as location, time, volhours, "OFF" as dept, role,       teams from v_shift_officiating where year(date) = year(curdate()) and RCid = ?
34
    select id, date, dayofweek, track as location, time, volhours, "OFF" as dept, role,       teams from v_shift_officiating where year(date) = year(curdate()) and RCid = ?
35
      ) temp
35
      ) temp