#!/usr/bin/perl
# Get the environment variables passe to the script
use CGI qw/:standard :html3 :netscape/;
use CGI::Cookie;
use DBI;
require "./AR_Common.pl";
$db_user = "agentrobin_01_";
$db_pass = "J0shKr1s";
$dsn_name = 'dbi:mysql:dreamhome_01_:dobrooks.ipowermysql.com:3306';
$area='SRV';
@Major=('San Ramon Valley','Mill Valley Area');
########### Process ANy Form Data
@FormValues = split(/&/, $ENV{QUERY_STRING});
$FV1 = @FormValues;
for ($x=0;$x<=$FV1-1;$x++) {
@Attributes = split(/=/,$FormValues[$x]);
if ($Attributes[0] eq "City") {
$s_community=$Attributes[1]; $s_community =~ tr/+/ /; $s_community =~ s/%([1-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$city=$Attributes[1]; $city =~ tr/+/ /; $city =~ s/%([1-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
}
if ($Attributes[0] eq "Area") {
$area=$Attributes[1]; $area =~ tr/+/ /; $area =~ s/%([1-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
}
}
#### These are the general header calls
printheader();
under_image(171);
print "<DIV style='position: relative; top: -301px; margin: 0 auto; width: 1024px; height: 1000px; border-style: solid; border-width: 0px; float: middle;'>\n";
place_heading();
make_menu();
bread_crumb("comm1");
#### This is the page structure overflow: hidden; height: 550px;
print " <DIV style='position: absolute; left: 0px; top: 190px; width: 1024px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'>\n";
build_area_list();
if ($area eq "SRV") {
build_body_community();
}
if ($area eq "MC") {
build_body_MC();
}
print "</DIV>\n";
print "</DIV>\n";
printending();
exit(0);
##############################################################################
################### GENERIC PAGE SETUP HEADING AND METADATA ###################
##############################################################################
sub printheader() {
$description = "AgentRobin Tri-valley Real Estate";
# print "<!DOCTYPE html '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>";
print "Content-type: text/html\n\n";
print "<HTML xmlns='http://www.w3.org/1999/xhtml'>\n";
print "<HEAD>\n";
print "<TITLE>$title11</title>\n";
print "<link type='text/css' href='$baseurl/Default_files/AgentRobin_CSS.CSS' rel='stylesheet'>\n";
print "<meta name=\"description\" content=\"$title\">\n";
print "<meta name=\"keywords\" content=\"$NArea, CA, Housing, Real Estate, Homes, Update, Status, Market\">\n";
#### HORIZONTAL MENU FUNCTIONS
# print "<link rel='stylesheet' type='text/css' href='$baseurl/css/hor_menu.css'/>\n";
print "<link rel='stylesheet' type='text/css' href='$baseurl/CSS/AR_Menu.css'/>\n";
print "<!--[START-LJ]--><script type='text/javascript' src='$baseurl/scripts/AR_Menu.js'></script><!--[END-LJ]-->\n";
####
print "</head>\n";
print "<body>\n";
}
################### GENERIC PAGE SETUP ENDING ###################
sub printending {
print "</body>\n";
print "</html>\n";
}
sub build_area_list() {
$SQL ="SELECT * FROM areas ORDER BY sort_order";
$dbh = DBI->connect('dbi:mysql:dreamhome_01_:dobrooks.ipowermysql.com:3306','agentrobin_01_','J0shKr1s') or die("Couldn't connect");
$sth = $dbh->prepare($SQL);
$sth->execute;
$aw = "240px";
$count = 0;
$top=50;
$tpx = $top . "px";
print "<DIV style='position: absolute; left: 5px; top: 0px; width: $aw; border-style:dotted; border-color: rgb(0,28,85); border-width: 0px 0px 0px 0px; text-align: center; vertical-align: top; background: white url(\"$baseurl/Img/lt_blue.png\");'>\n";
print " <DIV style='position: absolute; left: -1px; top: -1px; width: $aw; height: 38px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'><SPAN class='topical'><IMG BORDER=0 SRC='http://agentrobin.com/Img/maroon_back.png' WIDTH=100% HEIGHT=100%></SPAN></DIV>\n";
print " <DIV style='position: absolute; left: 10px; top: 0px; width: $aw; height: 38px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'><SPAN style='font-family: Segoe UI Light; font-size: 15pt; color: black;'>AREAS OF SERVICE</SPAN></DIV>\n";
# goto BREAK1;
$rows = $sth->rows();
for ($i = 0; $i < $rows; $i++) {
@data=$sth->fetchrow_array();
print "$i\n";
if ($area eq "SRV") {
$bullet = "<IMG SRC='$baseurl/Img/comm_bullet.png'>";
$bullet1 = "<IMG SRC='$baseurl/Img/comm_bullet1.png'>";
}
if ($area eq "MC") {
$bullet = "<IMG SRC='$baseurl/Img/comm_bullet1.png'>";
$bullet1 = "<IMG SRC='$baseurl/Img/comm_bullet.png'>";
}
$ca = uc($data[1]);
$ca =~ s/^\s+//;
$ca =~ s/\s+$//;
print " <DIV style='position: absolute; left: 1px; top: $tpx; height: 20px; width: 340px; border-style: inset; border-width: 1px; text-align: left; overflow: hidden;'>\n";
print " $bullet<A HREF='$baseurl/community.pl?Area=SRV'><SPAN style='font-family: Segoe UI; font-size: 12pt; color: black;'>$ca</SPAN></A>\n";
print " </DIV>\n";
$top=$top+25;
$tpx = $top . "px";
@cities = split(/\,/,$data[2]);
$c_count = @cities;
for ($t=0; $t < $c_count; $t++) {
$ct = uc($cities[$t]);
$ct =~ s/^\s+//;
$ct =~ s/\s+$//;
print " <DIV style='position: absolute; left: 45px; top: $tpx; height: 20px; width: 210px; border-style: inset; border-width: 0px; text-align: left;'>\n";
print " <A HREF='$baseurl/community_info.pl?Community=$ct'><SPAN style='font-family: Segoe UI Light; font-size: 10pt; color: black;'>$ct</SPAN></A>\n";
print " </DIV>\n";
$top=$top+25;
$tpx = $top . "px";
}
$top=$top+5;
$tpx = $top . "px";
}
BREAK1:
print "</DIV>\n";
close_db();
}
sub build_body_community() {
print "<DIV style='position: absolute; overflow: hidden; left: 250px; top: 0px; width: 780px; height: 570px; border-style:dotted; border-color: rgb(0,28,85); border-width: 0px 0px 0px 0px; text-align: center; vertical-align: top; background: white url(\"$baseurl/Img/lt_blue.png\");'>\n";
print " <DIV style='position: absolute; left: -1px; top: -1px; width: 780px; height: 38px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'><SPAN class='topical'><IMG BORDER=0 SRC='http://agentrobin.com/Img/maroon_back.png' WIDTH=100% HEIGHT=100%></SPAN></DIV>\n";
print " <DIV style='position: absolute; left: 10px; top: 0px; width: 780px; height: 38px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'><SPAN style='font-family: Segoe UI Light; font-size: 15pt; color: black;'>COMMUNITIES of SAN RAMON VALLEY</SPAN></DIV>\n";
# Community Map TIle
if ($area eq "SRV") {
print " <DIV style='position: absolute; left: 1px; top: 45px; height: 560px; width: 250px; border-style: inset; border-width: 0px; float: left;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/srvmap.png'>\n";
print " </DIV>\n";
}
if ($area eq "MC") {
print " <DIV style='position: absolute; left: 1px; top: 45px; height: 560px; width: 250px; border-style: inset; border-width: 0px; float: left;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/mcmap.png'>\n";
print " </DIV>\n";
}
# Alamo Tile
print " <DIV style='position: absolute; left: 320px; top: 45px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <A HREF='$baseurl/community_info.pl?Community=Alamo'><IMG Name=WelcomePic SRC='$baseurl/Img/alamo.png'></A>\n";
print " </DIV>\n";
# Blackhawk Tile
print " <DIV style='position: absolute; left: 465px; top: 45px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/blackhawk.png'>\n";
print " </DIV>\n";
# danville Tile
print " <DIV style='position: absolute; left: 610px; top: 45px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/danville1.png'>\n";
print " </DIV>\n";
# dublin Tile
print " <DIV style='position: absolute; left: 320px; top: 170px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/dublin.png'>\n";
print " </DIV>\n";
# Lafayette Tile
print " <DIV style='position: absolute; left: 465px; top: 170px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/lafayette.png'>\n";
print " </DIV>\n";
# Livermore Tile
print " <DIV style='position: absolute; left: 610px; top: 170px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/livermore.png'>\n";
print " </DIV>\n";
# Pleasanton
print " <DIV style='position: absolute; left: 320px; top: 295px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/pleasanton.png'>\n";
print " </DIV>\n";
# San Rmaon
print " <DIV style='position: absolute; left: 465px; top: 295px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/sanramon.png'>\n";
print " </DIV>\n";
# Walnut Creek Tile
print " <DIV style='position: absolute; left: 610px; top: 295px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/walnutcreek.png'>\n";
print " </DIV>\n";
# Charity Tile
# print " <DIV style='position: absolute; left: 406px; top: 310px; height: 238px; width: 426px; border-style: inset; border-width: 1px; float: middle;'>\n";
# print " <IMG Name=WelcomePic SRC='$baseurl/Img/charity_tile.png'>\n";
# print " </DIV>\n";
print "</DIV>\n";
}
sub build_body_MC() {
print "<DIV style='position: absolute; overflow: hidden; left: 250px; top: 0px; width: 840px; height: 570px; border-style:dotted; border-color: rgb(0,28,85); border-width: 0px 0px 0px 0px; text-align: center; vertical-align: top; background: white url(\"$baseurl/Img/lt_blue.png\");'>\n";
print " <DIV style='position: absolute; left: -1px; top: -1px; width: 840px; height: 38px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'><SPAN class='topical'><IMG BORDER=0 SRC='http://agentrobin.com/Img/maroon_back.png' WIDTH=100% HEIGHT=100%></SPAN></DIV>\n";
print " <DIV style='position: absolute; left: 10px; top: 0px; width: 840px; height: 38px; border-style:solid; border-width: 0px; text-align: center; vertical-align: top;'><SPAN style='font-family: Segoe UI Light; font-size: 15pt; color: black;'>COMMUNITIES of SAN RAMON VALLEY</SPAN></DIV>\n";
# Community Map TIle
if ($area eq "SRV") {
print " <DIV style='position: absolute; left: 1px; top: 45px; height: 560px; width: 250px; border-style: inset; border-width: 0px; float: left;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/srvmap.png'>\n";
print " </DIV>\n";
}
if ($area eq "MC") {
print " <DIV style='position: absolute; left: 1px; top: 45px; height: 560px; width: 250px; border-style: inset; border-width: 0px; float: left;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/mcmap.jpg'>\n";
print " </DIV>\n";
}
# Corte Madera Tile
print " <DIV style='position: absolute; left: 320px; top: 45px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <A HREF='$baseurl/community_info.pl?Community=CorteMadera'><IMG Name=WelcomePic SRC='$baseurl/Img/cortemadera.jpg'></A>\n";
print " </DIV>\n";
# larkspur Tile
print " <DIV style='position: absolute; left: 465px; top: 45px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/larkspur.jpg'>\n";
print " </DIV>\n";
# Mill VAlley Tile
print " <DIV style='position: absolute; left: 610px; top: 45px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/millvalley.jpg'>\n";
print " </DIV>\n";
# Saualito Tile
print " <DIV style='position: absolute; left: 320px; top: 170px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/sausalito.jpg'>\n";
print " </DIV>\n";
# Tiburoin Tile
print " <DIV style='position: absolute; left: 465px; top: 170px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/tiburon.jpg'>\n";
print " </DIV>\n";
# Kentfield Tile
print " <DIV style='position: absolute; left: 610px; top: 170px; height: 120px; width: 140px; border-style: inset; border-width: 0px; float: middle;'>\n";
print " <IMG Name=WelcomePic SRC='$baseurl/Img/rosskentfield.jpg'>\n";
print " </DIV>\n";
# Charity Tile
# print " <DIV style='position: absolute; left: 406px; top: 310px; height: 238px; width: 426px; border-style: inset; border-width: 1px; float: middle;'>\n";
# print " <IMG Name=WelcomePic SRC='$baseurl/Img/charity_tile.png'>\n";
# print " </DIV>\n";
print "</DIV>\n";
}
sub bread_crumb() {
print " <DIV style='position: absolute; left: 1px; top: 115px; height: 15px; width: 840px; border-style: inset; border-width: 0px; text-align: left;'>\n";
print " <SPAN style='font-family: Segoe UI Light; font-size: 10pt; color: white;'><A style='color: white;' HREF='$baseurl/'>properties</A></SPAN>\n";
print " <SPAN style='font-family: Segoe UI Light; font-size: 10pt; color: white;'>> <A style='color: white;' HREF='$baseurl/community.pl'>communites</A></SPAN>\n";
print " </DIV>\n";
}