#!/usr/bin/perl use CGI qw (:standard); use CGI::Carp qw(fatalsToBrowser); print "Content-type: text/html\n\n"; $foo = new CGI; $output= $foo->param(output); $header = 'head.html'; $footer = 'foot.html'; $file='listings.tab'; open (FILE, "$header") || die print "Header File Not Found"; @header = ; close (FILE); open (FILE, "$footer") || die print "Footer File Not Found"; @footer = ; close (FILE); open (FILE, "$file") || die print "Listings File Not Found"; @listings = ; close (FILE); ############################## SHow All Listing if ($output eq ""){ foreach (@listings) { push (@thelistings, $_); } } ################ Show All Grove CIty Lsitings if ($output eq "gc") { foreach (@listings) { ($thetime, $id, $listinglevel, $date, $listingtype, $listingaddress, $listingaddress2, $listingcity, $listingstate, $listingzip, $schooldistrict, $rent, $securitydeposit, $bedrooms, $bedroomsizes, $bathrooms, $appliances, $laundry, $comments, $landlordname, $landlordaddress, $landlordaddress2, $landlordcity, $landlordstate, $landlordzip, $landlordemail, $phone1, $phone2, $times1, $times2, $website, $photo1, $photo2, $photo3, $photo4, $photo5) = split /\t/; if ($listingcity =~ /Grove/ig){ push (@thelistings, $_); } } } ######################### Show All Mercer Listings if ($output eq "mc") { foreach (@listings) { ($thetime, $id, $listinglevel, $date, $listingtype, $listingaddress, $listingaddress2, $listingcity, $listingstate, $listingzip, $schooldistrict, $rent, $securitydeposit, $bedrooms, $bedroomsizes, $bathrooms, $appliances, $laundry, $comments, $landlordname, $landlordaddress, $landlordaddress2, $landlordcity, $landlordstate, $landlordzip, $landlordemail, $phone1, $phone2, $times1, $times2, $website, $photo1, $photo2, $photo3, $photo4, $photo5) = split /\t/; if ($listingcity =~ /mercer/ig){ push (@thelistings, $_); } } } ######################################################## if ($output eq "other"){ foreach (@listings) { $other= "1"; ($thetime, $id, $listinglevel, $date, $listingtype, $listingaddress, $listingaddress2, $listingcity, $listingstate, $listingzip, $schooldistrict, $rent, $securitydeposit, $bedrooms, $bedroomsizes, $bathrooms, $appliances, $laundry, $comments, $landlordname, $landlordaddress, $landlordaddress2, $landlordcity, $landlordstate, $landlordzip, $landlordemail, $phone1, $phone2, $times1, $times2, $website, $photo1, $photo2, $photo3, $photo4, $photo5) = split /\t/; if ($listingcity =~ /mercer/ig){$other = "0";} if ($listingcity =~ /grove city/ig){$other = "0";} if ($other eq "1"){push (@thelistings, $_);} } } ############################################################## ############################################################################ print @header; foreach (@thelistings) { ($thetime, $id, $listinglevel, $date, $listingtype, $listingaddress, $listingaddress2, $listingcity, $listingstate, $listingzip, $schooldistrict, $rent, $securitydeposit, $bedrooms, $bedroomsizes, $bathrooms, $appliances, $laundry, $comments, $landlordname, $landlordaddress, $landlordaddress2, $landlordcity, $landlordstate, $landlordzip, $landlordemail, $phone1, $phone2, $times1, $times2, $website, $photo1, $photo2, $photo3, $photo4, $photo5) = split /\t/; ########################################################################################### if ($listinglevel == 1){ print " "; print< Listing: $id Location: $listingaddress , $listingaddress2 , $listingcity , $listingstate , $listingzip Web Site: $website HTML } #################################################################################### if ($listinglevel == 2){ print " "; print< Listing: $id Listing Type $listingtype Location: $listingaddress , $listingaddress2 , $listingcity , $listingstate Description Click Here HTML } ################################################################################################# if ($listinglevel == 3){ print " "; print< Listing: $id Listing Type $listingtype Location: $listingaddress , $listingaddress2 , $listingcity , $listingstate Description: Click Here HTML } ########################################################################################### if ($listinglevel == 4){ print " "; print< Listing: $id Listing Type $listingtype Location: $listingaddress $listingaddress2 $listingcity Phone: $phone1 HTML } #################################################################################### ################################################################################################# if ($listinglevel == 5){ print " "; print< For Sale By Owner: $id Listing Type $listingtype Location: $listingaddress , $listingaddress2 , $listingcity , $listingstate Description: Click Here HTML } ########################################################################################### } print @footer;