#!/usr/bin/perl BEGIN { my $homedir = ( getpwuid($>) )[7]; my @user_include; foreach my $path (@INC) { if ( -d $homedir . '/perl' . $path ) { push @user_include, $homedir . '/perl' . $path; } } unshift @INC, @user_include; } use CGI; use Mysql; require('config.pl'); $query = new CGI; get_params(); $dbh = Mysql->connect("$db_host","$db","$db_user","$db_password"); print $query->header; get_colors(); $select_query = "SELECT *, WEEKDAY(datee) as dow FROM sheffieldbros ORDER BY datee"; $sth = $dbh->query($select_query); print"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"; print <

Sheffield Brothers

EOP while (%info = $sth->fetchhash){ $date1 = `/bin/date --date="$info{datee}" +"%B %e, %Y"`; $today = `/bin/date +%Y%m%d`-1; chomp($today); $info{datee} =~ /(\d\d\d\d)-(\d\d)-(\d\d)/; $date = $info{'datee'} ; $month = substr($date,5,2); $day = substr($date,8,2); $year = substr($date,0,4); $today = `/bin/date +%Y-%m-%d`; chomp($today); if ($month eq "01" ){ $month = "January"; }; if ($month eq "02" ){ $month = "February"; }; if ($month eq "03" ){ $month = "March"; }; if ($month eq "04" ){ $month = "April"; }; if ($month eq "05" ){ $month = "May"; }; if ($month eq "06" ){ $month = "June"; }; if ($month eq "07" ){ $month = "July"; }; if ($month eq "08" ){ $month = "August"; }; if ($month eq "09" ){ $month = "September"; }; if ($month eq "10" ){ $month = "October"; }; if ($month eq "11" ){ $month = "November"; }; if ($month eq "12" ){ $month = "December"; }; if (substr($day,0,1) eq "0" ){ $day = substr($day,1,1); }; if ($info{'dow'} eq "1" ){ $dow = "Tuesday"; }; if ($info{'dow'} eq "2" ){ $dow = "Wednesday"; }; if ($info{'dow'} eq "3" ){ $dow = "Thursday"; }; if ($info{'dow'} eq "4" ){ $dow = "Friday"; }; if ($info{'dow'} eq "5" ){ $dow = "Saturday"; }; if ($info{'dow'} eq "6" ){ $dow = "Sunday"; }; if ($info{'dow'} eq "7" ){ $dow = "Monday"; }; $test= "1"; $today = `/bin/date +%Y%m%d`-1; chomp($today); $info{datee} =~ /(\d\d\d\d)-(\d\d)-(\d\d)/; $date = $1.$2.$3; if ($date > $today){ $test = $test +1; print "

$dow, $month $day

$info{'wheree'}

$info{'timee'}
$info{'other'}

$info{'directions'}
"; } ; } if ($test eq ""){ print "

WOW !
No Bookings
"; };