#!/usr/bin/perl require "cgi-lib.pl"; print &PrintHeader; &ReadParse; use CGI; use DBI; $query = new CGI; use CGI::Carp qw(fatalsToBrowser); $root="/home/29/54/3025429"; $rootdir="$root/content"; $dbh = DBI->connect("dbi:mysql:database=stpaul6;stpaul6.stpaul-lcms-md.org:3306","stpaul6","C#t5Y9C2") or die("Couldn't connect"); sub hitOut { if($sth->rows == 0) { $output= "No information available"; } else { while( $resptr = $sth->fetch() ) { $output .= ""; $h = $fullname; if (-f "$rootdir/../cemetery/images/$fullname.JPG") { $h = "" . "$fullname"; } $output .= "" . $h . ""; $output .= "" . $dob .""; $output .= "" . $dod .""; $output .= "" . $section .""; $output .= "" . $lot .""; $output .= "" . $grave .""; #$output .= "" . $note .""; $output .= "" . $extra .""; $output .= "\n"; } } } sub startsWith { $query="select * from cemetery where dod > 0000-00-00 and fullname like '". $in{"letter"}."%' order by fullname"; $sth = $dbh->prepare($query) or die("Couldn't prepare"); $sth->execute(); $sth->bind_columns(undef, \$imagename, \$lastname, \$fullname, \$dob, \$dod, \$section, \$lot, \$grave, \$extra, \$note, \$soldto, \$deednum, \$doburial, \$caretaker, \$funeralhome, \$burialnum, \$boardsec, \$recid ); &hitOut(); $sth->finish(); } if ($in{"func"} eq "startsWith") { open (IN,"<$rootdir/../cemetery/header.shtml");while(){ print; } close IN; open (IN,"<$rootdir/../cemetery/nav.shtml");while(){ print; } close IN; $output= "" . "" . "" . "" . "" . #"" . "" . ""; &startsWith; $output .= "
NameBirthDeceasedLot NumberNoteExtra
"; open (IN,"<$rootdir/../cemetery/intern.shtml"); while(){ if ($_ =~ /REPLACEME/) { print $output; } else { print; } } close IN; #} elsif ($in{"func"} eq "forsale"){ #&forsale; #} elsif ($in{"func"} eq "find"){ #&find; } open (IN,"<$rootdir/../cemetery/footer.shtml");while(){ print; } close IN; $dbh->disconnect;