Subversion Repositories ORC

Rev

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

Rev 35 Rev 43
Line 6... Line 6...
6
use cPanelUserConfig;
6
use cPanelUserConfig;
7
use CGI qw/param cookie header start_html url/;
7
use CGI qw/param cookie header start_html url/;
8
use HTML::Tiny;
8
use HTML::Tiny;
9
use tableViewer;
9
use tableViewer;
10
use RollerCon;
10
use RollerCon;
-
 
11
use DateTime;
-
 
12
#use DateTime::Duration;
-
 
13
my $now = DateTime->now (time_zone => 'America/Los_Angeles');
11
our $h = HTML::Tiny->new( mode => 'html' );
14
our $h = HTML::Tiny->new( mode => 'html' );
Line 12... Line 15...
12
 
15
 
13
my $cookie_string;
16
my $cookie_string;
14
our ($EML, $PWD, $LVL);
17
our ($EML, $PWD, $LVL);
Line 65... Line 68...
65
#my $dbh = WebDB::connect;
68
#my $dbh = WebDB::connect;
66
my $dbh = getRCDBH;
69
my $dbh = getRCDBH;
Line 67... Line 70...
67
 
70
 
68
sub modify_available {
71
sub modify_available {
-
 
72
	my $t = shift;
-
 
73
	
-
 
74
 	my ($yyyy, $mm, $dd) = split /\-/, $t->{date};
-
 
75
	my $cutoff = DateTime->new(
-
 
76
        year => $yyyy,
-
 
77
        month => $mm,
-
 
78
        day => $dd,
-
 
79
        hour => 5,
-
 
80
        minute => 0,
-
 
81
        second => 0,
-
 
82
        time_zone => 'America/Los_Angeles'
-
 
83
  );
-
 
84
  
-
 
85
  return "CLOSED" unless $now < $cutoff;
69
	my $t = shift;
86
  
70
	($t->{signedup}) = $dbh->selectrow_array ("select id from v_shift where RCid = ? and date = ? and start_time = ? and location = ?", undef, $RCid, $t->{date}, $t->{start_time}, $t->{location} );
87
	($t->{signedup}) = $dbh->selectrow_array ("select id from v_shift where RCid = ? and date = ? and start_time = ? and location = ?", undef, $RCid, $t->{date}, $t->{start_time}, $t->{location} );
71
	my $droplink = $h->a ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$t->{signedup}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DROP]");
88
	my $droplink = $h->a ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$t->{signedup}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DROP]");
72
	if (!$t->{available}) {
89
	if (!$t->{available}) {
73
	  my $full = "FULL";
90
	  my $full = "FULL";