#!/usr/bin/perl

print "Content-type: text/html\n\n";

require "config.idx";

$long = $ENV{'QUERY_STRING'};

if ($long) {
	@pairs=split(/&/,$long);
	foreach $item(@pairs) {
		($name,$content)=split (/=/,$item,2);
		$content=~tr/+/ /;
		$content=~ s/%(..)/pack("c",hex($1))/ge;
		if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$content; }
		else { $INPUT{$name} = $content; }
	}
}
else {
	read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
	@pairs = split(/&/, $buffer);
	foreach $pair (@pairs) {
		($name, $value) = split(/=/, $pair);
		$value =~ tr/+/ /;
		$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
		if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; }
		else { $INPUT{$name} = $value; }
	}
}



my $pasth = $dbh->prepare("select * from listings_com3 where mlsnum = '$INPUT{mlsnumber}'");
$pasth->execute;

while (($MLSNUM,$Class,$Type,$Area,$Price,$AddressNumber,$AddressDirection,$AddressStreet,$Address2,$City,$State,$Zip,$Status,$SaleRent,$RailroadSpur,$NearAirport,$Signage,$Blank18,$SecurityGate,$Stories,$NUMOfElevators,$Blank22,$AgentID,$AgentName,$AgentPhone,$ListingOffice1ID,$ListingOffice1Name,$ListingOffice1Phone,$CoAgentID,$CoAgentName,$CoAgentPhone,$ListingOffice2ID,$ListingOffice2Name,$ListingOffice2Phone,$Blank35,$Blank36,$PhotoVideo,$Blank38,$Blank39,$LinkedMLSNUM,$Blank41,$Blank42,$Blank43,$County,$Township,$Subdivision,$Zoning,$Legal,$Blank49,$Irregular,$Acres,$PricePerAcre,$InterstateHwy,$RoadFrontage,$DistanceToAirport,$TrafficCount,$PresentUse,$YRBuilt,$Blank59,$NUMExitDoors,$Blank61,$Blank62,$Blank63,$Blank64,$Blank65,$NUMEmpParking,$NUMCustomerParking,$NUMHandicapParking,$LightedParking,$OfficeSqFt,$WarehouseSqFt,$RetailSqFt,$ManufacturingSqFt,$TotalSqFt,$OfficeSqFtSource,$WarehouseSqFtSource,$RetailSqFtSource,$ManufacturingSqFtSource,$Blank79,$OfficeSprinklers,$WarehouseSprinklers,$RetailSprinklers,$ManufacturingSprinklers,$OfficeDetectors,$WarehouseDetectors,$RetailDetectors,$ManufacturingDetectors,$RestroomsFemale,$RestroomsMale,$HandicapAccess,$PhoneSystem,$SecuritySystem,$Blank93,$Blank94,$Blank95,$Blank96,$Blank97,$Blank98,$Defects,$Reserved,$Blank101,$Directions,$Blank103,$Blank104,$TaxIDNUM,$LandValue,$ImproveValue,$EstimatedAnnualTax,$Blank109,$DitchFee,$OtherExp,$OtherExpPerQMY,$BlueRiverFee,$Gas,$Electric,$Water,$Sewer,$AssocDues,$AssocDuesPerQMY,$Auction,$AuctionDate,$Assumption,$Remarks,$Blank124,$ContractDate,$Blank126,$Blank127,$Blank128,$Blank129,$Blank48,$Blank131,$Blank132,$Blank133,$Blank134,$Blank135,$Blank136,$Blank137,$Blank138,$Blank139,$Blank140,$Blank141,$Blank142,$Blank143,$Blank144,$Blank145,$Blank146,$Blank147,$Blank148,$FeaturesDB) = $pasth->fetchrow_array()) {


$TotalSqFt = &commas($TotalSqFt);

open(DBFILE,"remarksdb.txt");
@dbfile = <DBFILE>;
close(DBFILE);

foreach $dbline (@dbfile) {
$dbline =~ s/\n//gi;
if ($dbline) {
$Remarks =~ s/(.*?)$dbline//gi;
}
#$makestuff .= "$dbline\n";
}


$preprice = $Price;

	$principal = "$Price";
	$interest = 6.5;
	$monthlyinterest = ($interest)/1200;
	$termyear = 30;
	$numberofmonths = $termyear*12;
	
	$temp = 1 + $monthlyinterest;
	
	$expon = 1;
	for ($p = 0; $p < $numberofmonths; $p++)
	{
		$expon = $temp * $expon;
	}
	
	$expon = 1 / $expon;
	$expon = 1 - $expon;
	$expon = $monthlyinterest / $expon;
	
	$monthlypayment = $principal * $expon;

	$monthlypayment=sprintf("%.2f",$monthlypayment);
	$monthlypayment = &commas($monthlypayment);

	$Price = &commas($Price);

	$monthlypayment = &commas($monthlypayment);
	$mortgagetax = $EstimatedAnnualTax;
	$EstimatedAnnualTax = &commas($EstimatedAnnualTax);


if ($SaleRent eq "S") {
$SaleRent = "For Sale";
}
else {
$SaleRent = "For Rent";
}

if ($Address2) {
$Address2 = "$Address2<br>";
}
else {
}

if ($ListingOffice1ID eq "48") {
$printoffice = "<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=images/era_showlogo.gif></td><td><b>Offered By:</b><br><a href=\"http://www.munciemls.com/agents.idx?action=showagent&agent=$AgentID\">$AgentName</a><br>$ListingOffice1Name<br>765-741-9111</td></tr></table>"
}
else {
$printoffice = "<b>Offered By</b><br>$AgentName<br>$ListingOffice1Name<br>"
}


@thefeatures = split(/\|/,$FeaturesDB);


$startcount = "0";
foreach $one (@thefeatures) {

$yasth = $dbh->prepare("select featurename,categoryname from features where codenum = '$one'");
$yasth->execute;

while (($realname,$categoryname) = $yasth->fetchrow_array()) {

$categoryname = lc($categoryname);
$realname = lc($realname);

$realname =~ s/CHR1/\'/gi;
$realname =~ s/CHR2/\"/gi;
$categoryname =~ s/CHR1/\'/gi;
$categoryname =~ s/CHR2/\"/gi;


$showfeaturestable .= "<td><img src=images/dot.gif>$categoryname<b>$realname</b></td>";

if ($startcount eq "1") {
$showfeaturestable .= "</tr><tr>";
$startcount = "0";
}
else {
$startcount++;
}

}
}
if ($OfficeSqFt eq "" || $OfficeSqFt eq "0") {
}
else {
$cOfficeSqFt = "SqFt. <b>$OfficeSqFt</b><br>Source <b>$Office</b><br>";
}

if ($Office2 eq "" || $Office2 eq "0") {
}
else {
$cOffice2 = "Sprinklers <b>$Office2</b><br>";
}
if ($Office3 eq "" || $Office3 eq "0") {
}
else {
$cOffice3 = "Detectors <b>$Office3</b><br>";
}


if ($WarehouseSqFt eq "" || $WarehouseSqFt eq "0") {
}
else {
$cWarehouseSqFt = "SqFt. <b>$WarehouseSqFt</b><br>Source <b>$Warehouse</b><br>";
}

if ($Warehouse2 eq "" || $Warehouse2 eq "0") {
}
else {
$cWarehouse2 = "Sprinklers <b>$Warehouse2</b><br>";
}
if ($Warehouse3 eq "" || $Warehouse3 eq "0") {
}
else {
$cWarehouse3 = "Detectors <b>$Warehouse3</b><br>";
}


if ($RetailSqFt eq "" || $RetailSqFt eq "0") {
}
else {
$cRetailSqFt = "SqFt. <b>$RetailSqFt</b><br>Source <b>$Retail</b><br>";
}

if ($Retail2 eq "" || $Retail2 eq "0") {
}
else {
$cRetail2 = "Sprinklers <b>$Retail2</b><br>";
}
if ($Retail3 eq "" || $Retail3 eq "0") {
}
else {
$cRetail3 = "Detectors <b>$Retail3</b><br>";
}

if ($ManufacturingSqFt eq "" || $ManufacturingSqFt eq "0") {
}
else {
$cManufacturingSqFt = "SqFt. <b>$ManufacturingSqFt</b><br>Source <b>$Manufacturing</b><br>";
}

if ($Manufacturing2 eq "" || $Manufacturing2 eq "0") {
}
else {
$cManufacturing2 = "Sprinklers <b>$Manufacturing2</b><br>";
}
if ($Manufacturing3 eq "" || $Manufacturing3 eq "0") {
}
else {
$cManufacturing3 = "Detectors <b>$Manufacturing3</b><br>";
}


if (($OfficeSqFt eq "0" || $OfficeSqFt eq "") && ($Office2 eq "0" || $Office2 eq "") && ($Office3 eq "0" || $Office3 eq "")) {
}
else {
$ShowOffice = "<b>Office</b>";
}

if (($WarehouseSqFt eq "0" || $WarehouseSqFt eq "") && ($Warehouse2 eq "0" || $Warehouse2 eq "") && ($Warehouse3 eq "0" || $Warehouse3 eq "")) {
}
else {
$ShowWarehouse = "<b>Warehouse</b>";
}

if (($RetailSqFt eq "0" || $RetailSqFt eq "") && ($Retail2 eq "0" || $Retail2 eq "") && ($Retail3 eq "0" || $Retail3 eq "")) {
}
else {
$ShowRetail = "<b>Retail</b>";
}

if (($ManufacturingSqFt eq "0" || $ManufacturingSqFt eq "") && ($Manufacturing2 eq "0" || $Manufacturing2 eq "") && ($Manufacturing3 eq "0" || $Manufacturing3 eq "")) {
}
else {
$ShowManufacturing = "<b>Manufacturing</b>";
}



if (($OfficeSqFt eq "0" || $OfficeSqFt eq "") && ($Office2 eq "0" || $Office2 eq "") && ($Office3 eq "0" || $Office3 eq "")&& ($WarehouseSqFt eq "0" || $WarehouseSqFt eq "") && ($Warehouse2 eq "0" || $Warehouse2 eq "") && ($Warehouse3 eq "0" || $Warehouse3 eq "") && ($RetailSqFt eq "0" || $RetailSqFt eq "") && ($Retail2 eq "0" || $Retail2 eq "") && ($Retail3 eq "0" || $Retail3 eq "") && ($ManufacturingSqFt eq "0" || $ManufacturingSqFt eq "") && ($Manufacturing2 eq "0" || $Manufacturing2 eq "") && ($Manufacturing3 eq "0" || $Manufacturing3 eq "")) {
$ShowLine = "";
$ShowBgcolor = "white";
}
else {
$ShowLine = "<img src=images/line_spacer.gif height=3 width=1><br><img src=images/black_fill.gif height=1 width=335><br>";
$ShowBgcolor = "silver";
}

if (($NUMEmpParking eq "" || $NUMEmpParking eq "0") && ($NUMCustomerParking eq "" || $NUMCustomerParking eq "0") && ($NUMHandicapParking eq "N/A" || $NUMHandicapParking eq "") && ($LightedParking eq "" || $LightedParking eq "x")) {
$ShowBadParking = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadParking = "";
}


if ($NUMEmpParking eq "") {
$cNUMEmpParking = "";
}
else {
$cNUMEmpParking = "<tr bgcolor=white><td valign=top>\# Employee</td><td valign=top><b>$NUMEmpParking</b><br></td></tr>";
}

if ($NUMCustomerParking eq "") {
$cNUMEmpParking = "";
}
else {
$cNUMEmpParking = "<tr bgcolor=white><td valign=top>\# Customer</td><td valign=top><b>$NUMCustomerParking</b><br></td></tr>";
}

if ($NUMHandicapParking eq "") {
$cNUMHandicapParking = "";
}
else {
$cNUMHandicapParking = "<tr bgcolor=white><td valign=top>\# Handicap</td><td valign=top><b>$NUMHandicapParking</b><br></td></tr>";
}

if ($LightedParking eq "") {
$cLightedParking = "";
}
else {
$cLightedParking = "<tr bgcolor=white><td valign=top>Lighted</td><td valign=top><b>$LightedParking</b><br></td></tr>";
}

if ($RailroadSpur eq "") {
$cRailroadSpur = "";
}
else {
$cRailroadSpur = "Railroad Spur <b>$RailroadSpur</b><br>";
}

if ($FloodPlain eq "") {
$cFloodPlain = "";
}
else {
$cFloodPlain = "FloodPlain <b>$FloodPlain</b><br>";
}

if ($SecurityGate eq "") {
$cSecurityGate = "";
}
else {
$cSecurityGate = "Security Gate <b>$SecurityGate</b><br>";
}

if ($NUMOfElevators eq "") {
$cNUMOfElevators = "";
}
else {
$cNUMOfElevators = "Number of Elevators <b>$NUMOfElevators</b><br>";
}

if ($ApproxLotSize eq "" || $ApproxLotSize eq "X" || $ApproxLotSize eq "x") {
$cApproxLotSize = "";
}
else {
$cApproxLotSize = "Lot Size <b>$ApproxLotSize</b><br>";
}

if ($NUMExitDoors eq "") {
$cNUMExitDoors = "";
}
else {
$cNUMExitDoors = "Number of Exit Doors <b>$NUMExitDoors</b><br>";
}

if ($OverheadDoorsQTY eq "") {
$cOverheadDoorsQTY = "";
}
else {
$cOverheadDdoorsQTY = "<tr bgcolor=white><td>Quantity</td><td>$OverheadDoorsQTY</td></tr>";
}

if ($Height eq "") {
$cHeight = "";
}
else {
$cHeight = "<tr bgcolor=white><td>Height</td><td>$Height</td></tr>";
}

if ($Columns eq "" || $Columns eq "N/A") {
$cColumns = "";
}
else {
$cColumns = "<tr bgcolor=white><td>Columns</td><td>$Columns</td></tr>";
}

if (($OverheadDoorsQTY eq "" || $OverheadDoorsQTY eq "0") && ($Height eq "" || $Height eq "0") && ($Columns eq "N/A" || $Columns eq "")) {
$ShowBadDoor = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadDoor = "";
}

if ($LoadingDock eq "") {
$cLoadingDock = "";
}
else {
$cLoadingDock = "Loading Dock<b>$LoadingDock</b><br>"
}

if ($Male eq "") {
$cMale = "";
}
else {
$cMale = "<tr bgcolor=white><td>Male</td><td>$Male</td></tr>";
}
if ($Female eq "") {
$cFemale = "";
}
else {
$cFemale = "<tr bgcolor=white><td>Female</td><td>$Female</td></tr>";
}

if (($Male eq "" || $Male eq "0") && ($Female eq "" || $Female eq "0")) {
$ShowBadRestrooms = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadRestrooms = "";
}



if ($ElectricCo eq "") {
$cElectricCo = "";
}
else {
$cElectricCo = "<tr bgcolor=white><td>Electric Co.</td><td>$ElectricCo</td></tr>";
}

if ($GasCo eq "") {
$cGasCo = "";
}
else {
$cGasCo = "<tr bgcolor=white><td>Gas Co.</td><td>$GasCo</td></tr>";
}

if ($WaterCo eq "") {
$cWaterCo = "";
}
else {
$cWaterCo = "<tr bgcolor=white><td>Water Co.</td><td>$WaterCo</td></tr>";
}

if ($SewerCo eq "") {
$cSewerCo = "";
}
else {
$cSewerCo = "<tr bgcolor=white><td>Sewer Co.</td><td>$SewerCo</td></tr>";
}

if ($CableCo eq "") {
$cCableCo = "";
}
else {
$cCableCo = "<tr bgcolor=white><td>Cable Co.</td><td>$CableCo</td></tr>";
}

if ($PhoneCo eq "") {
$cPhoneCo = "";
}
else {
$cPhoneCo = "<tr bgcolor=white><td>Phone Co.</td><td>$PhoneCo</td></tr>";
}

if ($HandicapAccess eq "" || $HandicapAccess eq "0") {
$cHandicapAccess = "";
}
else {
$cHandicapAccess = "<img src=images/dot.gif>Handicap Access <b>$HandicapAccess</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($PhoneSystem eq "" || $PhoneSystem eq "0") {
$cPhoneSystem = "";
}
else {
$cPhoneSystem = "<img src=images/dot.gif>Phone System <b>$PhoneSystem</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($SecuritySystem eq "" || $SecuritySystem eq "0") {
$cSecuritySystem = "";
}
else {
$cSecuritySystem = "<img src=images/dot.gif>Security System <B>$SecuritySystem</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($LandValue eq "" || $LandValue eq "0") {
$cLandValue = "";
}
else {
$cLandValue = "<img src=images/dot.gif>Land Value <b>$LandValue</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($ImproveValue eq "" || $ImproveValue eq "0") {
$cImproveValue = "";
}
else {
$cImproveValue = "<img src=images/dot.gif>Improv. Value <b>$ImproveValue</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

$LandValue = &commas($LandValue);
$ImproveValue = &commas($ImproveValue);

if (($cElectricCo eq "") && ($cGasCo eq "") && ($cWaterCo eq "") && ($cSewerCo eq "") && ($cCableCo eq "") && ($cPhoneCo eq "")) {
$ShowBadUtilities = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadUtilities = "";
}







&pull_photo_data_for_property_details_page($MLSNUM,4);  # routine at the bottom of config.idx



if ($totalpictures > 1) {
$showgallery = "<font face=\"Arial, Helvetica, sans-serif\"><font size=\"3\">photo<b>gallery</b></font></font><br><img src=\"images/line_spacer.gif\" height=\"3\" width=\"1\"><br><table border=\"0\" cellpadding=\"0\" cellspacing=\"1\"><tr>$showthumbs</tr></table><br>";
}
else {
$showgallery = "";
}


$searchstrings = "City=$INPUT{City}&County=$INPUT{County}&MinPrice=$INPUT{MinPrice}&MaxPrice=$INPUT{MaxPrice}&MinBed=$INPUT{MinBed}&MinBath=$INPUT{MinBath}&Acreage=$INPUT{Acreage}&YBuilt=$INPUT{YBuilt}&MinSF=$INPUT{MinSF}&MaxSF=$INPUT{MaxSF}&Address=$INPUT{Address}&Remarks=$INPUT{Remarks}&Show=$INPUT{Show}&sortby=$INPUT{sortby}&orderby=$INPUT{orderby}&Page=$INPUT{Page}";


if ($ENV{QUERY_STRING} =~ /City/) {
$showresultsback = "<a href=\"search_com.idx?$searchstrings\">Return To Search Results</a>";
}
else {
$showresultsback = "";
}


if ($INPUT{gate} eq "email") {
$checksave = "";
}
else {
$checksave = "<a href=\"javascript:save=window.open('save.idx?mlsnumber=$MLSNUM&type=com','save','width=320, height=325, scrollbars=no'); save.focus();\"><img src=\"images/actions/savethishome.gif\" border=0></a><br>";
}


print <<"STARTOFTHEPAGE";

<html><head><title>MuncieMLS.com</title>
<script Language="JavaScript">
testurl = new Array($bigcount);

$buildscript



			function showupdate(photoIndex, photoDisplayType)
			{
			document['picture'].src = testurl[photoIndex];
			
			return;
			}
			
</script>



STARTOFTHEPAGE

&header;






print <<"STARTPAGECONTENT";
<td valign="top" width="581">
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td colspan="2">
<img src="images/headers/commercial_propertydetails.gif" height="33" width="581" alt="Commercial Property Details"><Br>
</td>
</tr>
<td valign="top">&nbsp;</td>
<td valign="top" align="right">
<img src="images/line_spacer.gif" alt="" width="4" height="1">$showresultsback <br><br>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td width="341" valign="top">
<table border="0" cellpadding="6" cellspacing="0" width="341">
<tr>
<td width="335" valign="top">
	<img src="$showpicture" name=picture><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<center>
<table border="0" cellpadding="0" cellspacing="0" width="300">
<tr>
<td colspan="3" valign="top">
<font face="Arial, Helvetica, sans-serif"><font size="3">visitor<b>actions</b></font></font><br>
<img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/black_fill.gif" height="1" width="335"><br>
<img src="images/line_spacer.gif" height="1" width="1"><br>
</td>
</tr>
<tr>
<td valign="top" width="150">
<center>
<a href="http://www.gettherightloan.com/loan.cgi"><img src="images/actions/applyforloan.gif" border=0></a><br>
<a href="javascript:email=window.open('email.idx?action=listingmain&mlsnumber=$MLSNUM&type=_commercial','email','width=375, height=450, scrollbars=no'); email.focus();"><img src="images/actions/emailthishome.gif" border=0></a><br>
<a href="http://www.mapquest.com/maps/map.adp?country=US&address=$AddressNumber $AddressDirection $AddressStreet&city=$City&State=IN$state&zipcode=$Zip" target="_new"><img src="images/actions/mapproperty.gif" border="0"></a><br>
</center>
</td>
<td valign="top" width="150">
<center>
<a href="javascript:requestshowing=window.open('showing.idx?mls=$MLSNUM&address=$AddressNumber $AddressDirection $AddressStreet&city=$City&state=IN&zip=$Zip','requestshowing','width=465, height=540, scrollbars=yes'); requestshowing.focus();"><img src="images/actions/requestashowing.gif" border=0></a><br>
<a href="javascript:printversion=window.open('showdetails_commercial_print.idx?mlsnumber=$MLSNUM','printversion','width=635, height=540, scrollbars=yes'); printversion.focus();"><img src="images/actions/printer.gif" border="0" alt="Printer Friendly Version"></a><br>
$checksave
</center>
</td>
</tr>
</table>
</center>
<img src="images/line_spacer.gif" height="5" width="1"><br>
<font face="Arial, Helvetica, sans-serif"><font size="3">property<b>remarks</b></font></font><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/black_fill.gif" height="1" width="335"><br>
<img src="images/line_spacer.gif" height="1" width="11">$Remarks<br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>

$ShowLine
<center>
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr bgcolor="$ShowBgcolor">
<td valign="top">$ShowOffice</td>
<td valign="top">$ShowWarehouse</td>
<td valign="top">$ShowRetail</td>
<td valign="top">$ShowManufacturing</td>
</tr>

<tr>
<td valign="top">
	$cOfficeSqFt
	$cOffice2
	$cOffice3
</td>
<td valign="top">
	$cWarehouseSqFt
	$cWarehouse2
	$cWarehouse3
</td>
<td valign="top">
	$cRetailSqFt
	$cRetail2
	$cRetail3
</td>
<td valign="top">
	$cManufacturingSqFt
	$cManufacturing2
	$cManufacturing3
</td>
</tr>
<tr>
<td valign="top" colspan="4">
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/black_fill.gif" height="1" width="335"><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
</td>
</tr>
<tr>
<td colspan="4" valign="top">
	<table border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr>
	<td valign="top" width="50%">

		<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="silver">
		<tr>
		<td valign="top" colspan="2"><b>Parking</b></td>
		</tr>
		$cNUMCustomerParking
		$cNUMHandicapParking
		$cLightedParking
		$ShowBadParking
		$cNUMEmpParking
		$cNUMCustomerParking
		$cNUMHandicapParking
		$ShowBadParking
		</table>
		<br>
		<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="silver">
		<tr>
		<td valign="top" colspan="2"><b>Overhead Doors</b></td>
		</tr>
		$cOverheadDoorsQTY
		$cHeight
		$cColumns
		$ShowBadDoor
		</table>
		<br>
		<table border=0 cellpadding=1 cellspacing=1 width=100% bgcolor=silver>
		<tr>
		<td valign=top colspan=2><b>Restrooms</b></td></tr>
		$cMale
		$cFemale
		$ShowBadRestrooms
		</table>		
		<br>
	</td>
	<td valign="top" width="50%">

		<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="silver">
		<tr>
		<td valign="top" colspan="2"><b>Utilities</b></td>
		</tr>
		$cElectricCo
		$cGasCo
		$cWaterCo
		$cSewerCo
		$cCableCo
		$cPhoneCo
		$ShowBadUtilities
		</table>
		<img src="images/line_spacer.gif" height="3" width="1"><br>
		$cRailroadSpur
		$cFloodPlain
		$cSecurityGate
		$cNUMOfElevators		
		$cApproxLotSize
		$cNUMExitDoors
		$cLoadingDock
	</td>
	</tr>
	</table>
</td>
</tr>
</table>
</center>

</td>
</tr>
</table>
</td>
<td width="240" valign="top" bgcolor="#E2E2E2">
<table border="0" cellpadding="6" cellspacing="0" width="100%">
<tr>
<td valign="top">
<font face="Arial, Helvetica, sans-serif"><font size="4">property<b>overview</b></font></font><br>
$Type $Status $SaleRent<br>
$AddressNumber $AddressDirection $AddressStreet<br>
$Address2
$ShowCity{$City}, IN $Zip<br>
MLS <b>#$MLSNUM</b><br>
<font color="#990000"><b>\$$Price</b> / <b>\$$monthlypayment*</b> Monthly</font><br><a href="javascript:mortgagechange=window.open('mortgagechange.idx?price=$preprice&mlsnum=$MLSNUM&mortgagetax=$EstimatedAnnualTax','mortgagechange','width=384, height=385, scrollbars=yes'); mortgagechange.focus();">[Change Assumptions]</a><br>
<br>
$printoffice
<br>
<table border="0" cellpadding="3" cellspacing="1" border="1" bgcolor="navy">
<tr>
<td valign="top" bgcolor="navy"><font color="white"><b>Unique Listing Address</b></font></td>
</tr>
<td valign="top" bgcolor="#E2E2E2">
 <a href="http://$MLSNUM.MuncieMLS.com">http://$MLSNUM.MuncieMLS.com</a>
</td>
</tr>
</table>
<br>
$showgallery

<br>
<font face="Arial, Helvetica, sans-serif"><font size="3">property<b>details</b></font></font><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Number Of Buildings <b>$NUMBuildings</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">County <b>$County</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Township <b>$Township</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Area <b>$Area</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Subdivision <b>$Subdivision</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Acres <b>$Acres</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Year Built <b>$YRBuilt</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Square Feet <b>$TotalSqFt</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Stories <b>$Stories</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Interstate/Highway <b>$InterstateHwy</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Road Frontage <b>$RoadFrontage</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Near Airport <b>$NearAirport</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Signage <b>$Signage</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Distance To Airport <b>$DistanceToAirport</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Traffic Count <b>$TrafficCount</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Present Use <b>$PresentUse</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Est. Annual Taxes <b>\$$EstimatedAnnualTax</b><img src="images/line_spacer.gif" height="1" width="1"><br>
		$cHandicapAccess
		$cPhoneSystem
		$cSecuritySystem
		$cImproveValue
		$cLandValue
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" width="15">
<img src="images/dot.gif">
</td><td valign="top" width="100%">Directions: <b>$Directions $DirectionsContinued</b><br></td></tr></table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td valign="top" width="6"><img src="images/line_spacer.gif" height="1" width="6"><br></td>
<td valign="top" width="576">
<font face="Arial, Helvetica, sans-serif"><font size="3">property<b>features</b></font></font><br>
<img src="images/line_spacer.gif" height="2" width="1"><br>
<img src="images/black_fill.gif" height="2" width="576"><br>
<img src="images/line_spacer.gif" height="2" width="1"><br>
<table border=0 cellpadding=0 cellspacing=0 width=100%><tr>
$showfeaturestable</tr>
</table>
</td>
</tr>
</table>



$makestuff

</body>
</html>


STARTPAGECONTENT
}

@variables = ($Cook{userid},$INPUT{mlsnumber});
$sql_query = "INSERT INTO hits values (?,?,'res',now())";
my $zzaasth = $dbh->do($sql_query, undef, @variables);

my $uasth = $dbh->do("update users set lastlogin = now() where userid = '$Cook{userid}'");

$dbh->disconnect;


&footer;

sub commas {
	local($_)=@_;
	1 while s/(.*\d)(\d\d\d)/$1,$2/;
	$_;
}


