|
|
| version 1.6, 2013/05/29 03:27:02 | version 1.11, 2016/11/03 12:54:10 |
|---|---|
| Line 1 | Line 1 |
| #!/usr/bin/perl -wT | #!/usr/bin/perl -w |
| =begin comment info | =begin comment info |
| +------------------------------------------------------------------------------ | +------------------------------------------------------------------------------ |
| Line 23 use Getopt::Long; | Line 23 use Getopt::Long; |
| use Pod::Usage; | use Pod::Usage; |
| use Data::Dumper; | use Data::Dumper; |
| use Calendar::Simple; | use Calendar::Simple; |
| use Date::Calendar::Year qw( :all ); | use Date::Pcalendar::Year qw( :all ); |
| use Date::Calendar::Profiles qw( $Profiles ); | use Date::Pcalendar::Profiles qw( $Profiles ); |
| my $VERSION = q/$Id$/; | my $VERSION = '$Id$'; |
| my $DEBUG = ""; | my $DEBUG = ""; |
| my $URL = "http://demandred.dyndns.org/cgi-bin/ConnorCalendar/index.cgi"; | my $URL = "http://demandred.dyndns.org/cgi-bin/ConnorCalendar/index.cgi"; |
| my %post_in = ( ); | my %post_in = ( ); |
| Line 35 my @list = ( ); | Line 35 my @list = ( ); |
| my @months = qw/ January February March April May June July | my @months = qw/ January February March April May June July |
| August September October November December /; | August September October November December /; |
| my %holidays = ( | my %holidays = ( |
| "Easter Sunday" => 'even', | |
| "Christmas Day" => 'even', | "Christmas Day" => 'even', |
| "Christmas Eve" => 'odd', | "Christmas Eve" => 'odd', |
| "Father's Day" => 'all', | "Father's Day" => 'all', |
| "Independence Day" => 'even', | "Independence Day" => 'even', |
| "Labor Day" => 'even', | "Labor Day" => 'even', |
| "Memorial Day" => 'odd', | "Memorial Day" => 'odd', |
| "New Year's Day" => 'even', | "New Year's Day" => 'odd', |
| "New Year's Eve" => 'odd', | "New Year's Eve" => 'odd', |
| "Thanksgiving Day" => 'odd', | "Thanksgiving Day" => 'odd', |
| ); | ); |
| Line 50 my %specials = ( | Line 51 my %specials = ( |
| "11/28" => "even", | "11/28" => "even", |
| "5/6" => "odd", | "5/6" => "odd", |
| ); | ); |
| my @weekend = qw/ 2011 8 12 /; | ## Change this @weekend to 'qw/ 2011 8 12 /' for original schedule |
| my @weekend = qw/ 2011 8 19 /; | |
| my %weekends = &calcWeekends( @weekend ); | my %weekends = &calcWeekends( @weekend ); |
| &ReadParse( ); | &ReadParse( ); |
| my $yr = sprintf( "%d", $post_in{'cy'} ) || ( ( localtime )[5] + 1900 ); | my $yr = sprintf( "%d", $post_in{'cy'} ) || ( ( localtime )[5] + 1900 ); |
| my $YEAR = sprintf( "%d", $yr ); | my $YEAR = sprintf( "%d", $yr ); |
| push @list, 'Easter Sunday' if ( $YEAR % 2 == 0 ); | |
| print "Content-type: text/html\n\n"; | print "Content-type: text/html\n\n"; |
| print &header( ); | print &header( ); |
| print &css( ); | print &css( ); |
| print "<h1>Calendar for $YEAR</h1>\n"; | my $year_us = Date::Pcalendar::Year->new( $YEAR, $Profiles->{'US-FL'} ); |
| my $year_us = Date::Calendar::Year->new( $YEAR, $Profiles->{'US-FL'} ); | |
| my @hdays = $year_us->labels( ); | my @hdays = $year_us->labels( ); |
| #$DEBUG = "Holidays for $YEAR:\n"; | print "<h1><center><a href=\"$URL?cy=" . ( $YEAR - 1 ) . |
| #foreach ( sort @hdays ) { $DEBUG .= $_ ."\n"; } | "\"><--</a> " . |
| "Calendar Days Connor Visits for $YEAR" . | |
| "<a href=\"$URL?cy=" . ( $YEAR + 1 ) . "\"> --></a></h1>"; | |
| print "<center><a href=\"$URL?cy=" . ( $YEAR - 1 ) . | |
| "\"><--</a> <b>$YEAR</b> " . | |
| "<a href=\"$URL?cy=" . ( $YEAR + 1 ) . "\">--></a></center>"; | |
| my $row = 0; | my $row = 0; |
| print "<table align=center border=0><tr>"; | print "<table align=center border=0><tr>"; |
| for( my $month = 1; $month <= 12; $month++ ) | for( my $month = 1; $month <= 12; $month++ ) |
| Line 118 print "Today is <font color=blue>Blue</f | Line 117 print "Today is <font color=blue>Blue</f |
| print "Weekends and special days I have Connor are in <font color=green>Green</font>\n</p>"; | print "Weekends and special days I have Connor are in <font color=green>Green</font>\n</p>"; |
| print "<br /><table width=35% align=center border=0><tr><td>List of Special/Holidays " . | print "<table width=35% align=center border=0><tr><td>List of Special/Holidays " . |
| "I have Connor:<br /><pre>"; | "I have Connor:<br /><p class=Legend>"; |
| print map { $_ . "\n" } sort @list; | print map { $_ . "<br />\n" } sort @list; |
| print "</td></tr></table>\n"; | print "</p></td></tr></table>\n"; |
| print "</pre><p class=\"footer\">Version: <font color=green>$VERSION</font><br />"; | print "</pre><p class=\"footer\">Version: <font color=green>$VERSION</font><br />"; |
| print "CVS: <a target=\"_new\" href=\"http://demandred.dyndns.org/cgi-bin/cvsweb/ConnorCalendar/\">http://demandred.dyndns.org/cgi-bin/cvsweb/ConnorCalendar/</a>"; | print "CVS: <a target=\"_new\" href=\"http://demandred.dyndns.org/cgi-bin/cvsweb/ConnorCalendar/\">http://demandred.dyndns.org/cgi-bin/cvsweb/ConnorCalendar/</a>"; |
| print "</center></p>"; | print "</center></p>"; |
| Line 167 sub isSpecial | Line 166 sub isSpecial |
| sub isWeekend | sub isWeekend |
| { | { |
| my $y = shift || return 0; | my $y = shift || return 0; |
| my $m = shift || return 0; | my $m = shift || return 0; |
| my $d = shift || return 0; | my $d = shift || return 0; |
| $m--; | $m--; |
| my $ds = sprintf( "$y/$months[$m]/%02d", $d ); | my $ds = sprintf( "$y/$months[$m]/%02d", $d ); |
| Line 306 padding-bottom: 0px; | Line 305 padding-bottom: 0px; |
| font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; | font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; |
| #font-family: Geneva, Arial, Helvetica, sans-serif; | #font-family: Geneva, Arial, Helvetica, sans-serif; |
| font-size: 12pt; | font-size: 12pt; |
| background:url(lowerright.jpg) no-repeat bottom right; | background: #eeeeee; |
| color:#000000; | color:#000000; |
| Line 325 p.Legend { | Line 324 p.Legend { |
| font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; | font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; |
| font-size: 8pt; | font-size: 8pt; |
| margin: auto; | margin: auto; |
| width: 28%; | width: 300px; |
| background-color : transparent; | background-color : transparent; |
| border-top: 1px solid #888888; | border-top: 1px solid #888888; |
| border-left: 1px solid #888888; | border-left: 1px solid #888888; |
| Line 394 p.footer { | Line 393 p.footer { |
| font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; | font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; |
| font-size: 8pt; | font-size: 8pt; |
| margin: auto; | margin: auto; |
| width: 48%; | width: 500px; |
| background-color : transparent; | background-color : transparent; |
| border-top: 1px solid #888888; | border-top: 1px solid #888888; |
| padding-top: 3px; | padding-top: 3px; |