<?php
include('/home/rtpadmin/config/ps_config.php');
$result_property_unit = mysqli_query($db,"SELECT unit_number,bedrooms,baths,rent, deposit,address1,link
                       FROM ps_unit,ps_property 
                       WHERE ps_property.id = ps_unit.property_id
                       AND (available = 'Y' 
                       OR available = 'y')");

echo "<table cellpadding=2 cellspacing=1 border=5>"; 
echo "<tr align=center><td bgcolor=#FFFF99 colspan=4><H3><font face=arial><B>Available Rentals</b></font></h3></td></tr>";
$alternate = "2"; 
while ($row_property_unit = mysqli_fetch_array($result_property_unit)) 
{
   $address1 = $row_property_unit["address1"];
   $unit_number = $row_property_unit["unit_number"];
   $bedrooms = $row_property_unit["bedrooms"];
   $baths = $row_property_unit["baths"];
   $rent = $row_property_unit["rent"];
   $deposit = $row_property_unit["deposit"];
   $link = $row_property_unit["link"];
   if ($alternate == "1") 
   { 
      $color = "#FFCC66"; 
      $alternate = "2"; 
   } 
   else 
   { 
      $color = "#FFCC66"; 
      $alternate = "1"; 
   } 
   echo "<tr bgcolor=$color>";
   echo "<td><h4><font face=arial><b>$address1, Unit:$unit_number</b></font></h4></td>";
   echo "<td><h4><font face=arial><b>Bedrooms: $bedrooms, Baths: $baths</b></font></h4></td>";
   echo "<td><h4><font face=arial><b>Rent: $rent, Deposit: $deposit</b></font></h4></td>";
   echo "<td><h4><font face=arial><B><a href=$link>Photos</a></b></font></h4></td>";
   echo "</tr>";
} 
echo "</table>";
?> 
