#!/usr/bin/perl # alpha.html: Alphabetical list of sales property from RandR98 database # User can Select a property from this form to view # Modified 12/05/97 by Celeste require "OLconfig.pl"; require "custom/vdslib.pl"; use Mysql; # mSQL database routines # Initialize CGI environment use CGI qw/:standard/; # retrieve the CGI variables. print header(); $top = &VDS::readFile('top.html'); $top =~ s/BROWSERTITLE/$clientName - $clientLocation: $Number: $Name/; $top =~ s#PAGETITLE#Alphabetic Listing of Properties#; $top =~ s#BANNER#Rental Search#; print $top; # Connect to server my $conn = Mysql->Connect($dbserver, $db) or print qq("alpha.html Connect: Sorry, we are temporarily unable to process your search request. Please try again in a little while. $Mysql::db_errstr"); $result = $conn->Query(qq{SELECT Name, Num, ID FROM $dbtable ORDER BY Name}) or print qq{"alpha.html Select: Sorry, we are temporarily unable to process your search request. Try resubmitting your search request in a couple of minutes.

$Mysql::db_errstr"}; if ($result->numrows() != 0) { print "

Alphabetic Property Listing

"; #print "There are " . $result->numrows() . " properties:

"; print "

"; $letter='A'; while( $letter lt 'Z' ){ $navBar .= "$letter | "; $letter++; } $navBar .= "Z"; #print "Click on the letter that begins the name of the property you are interested in viewing.
$navBar
"; print "$navBar"; print "

"; $lastLetter = "FIRST"; $col = 4; while (($Name, $Num, $ID ) = $result->fetchrow()) { $SendName = $Name; $SendName =~ s/ /+/g; $letter = substr($Name, 0, 1); if ($lastLetter ne $letter) { $col = 4; } $col += 1; if ($col > 4) { if( $lastletter ne "FIRST" ){ print "\n"; } print $newRow; if ($lastLetter ne $letter) { print "\n"; $lastLetter = $letter; } else { print "\n"; } $col = 2; } $sendNum = $ID; $sendNum =~ s/ /+/g; $sendNum =~ s/\&/\%26/g; $sendNum =~ s/\#/\%23/g; print "\n"; } # end-while print "
$letter
$Name $condoString
"; } # end-if print ""; $bottom = &VDS::readFile('bottom.html'); print $bottom; exit;