rendered paste body<style type="text/css">img {border:0;}.TBLwrapper { padding:10px;}.resultTBL { border-collapse:collapse;}.resultTBL th { padding:3px;text-align:center;}.resultTBL td { border-bottom:2px solid #c0c0c0;padding:10px 3px 10px 3px;text-align:center;}.available { color:green;}.unavailable { color:#ccc;}.modsearch{ padding:10px;}</style><table class="resultTBL" width="95%"> <tr><td colspan="4"></td></tr><?php // Load the configuration file. $conf = parse_ini_file('../admin/config.ini'); // Create a connection to the mysql database. $link = mysql_connect($conf['dbhost'], $conf['dbuser'], $conf['dbpass']); mysql_select_db($conf['dbname']); // Delete any listings already in there (this will prevent multiple instances!) $sql = "SELECT * FROM listings WHERE 1 AND ".$filter.";"; $result = mysql_query($sql); $properties = array(); while ($row = mysql_fetch_array($result)) { if (!in_array($row['address'], $properties)) { $properties[md5($row['address'])] = array('address' => $row['address'], 'city' => $row['city'], 'proptype' => $row['proptype'], 'bedrooms' => $row['bedrooms'], 'path' => $row['path'], 'available' => false); } if ($row['available'] == 'y') { $properties[md5($row['address'])]['available'] = true; } } foreach ($properties as $property) { echo "<tr>"; echo " <td style=\"text-align:left;\"><a href=\"../properties/".$property['path']."/".$property['path'].".htm\" /><img src=\"../properties/".$property['path']."/".$property['path']."SM.jpg\" alt=\"".$property['address'].",".$property['city']."\" /></a></td>"; echo " <td style=\"text-align:left;\">".$property['address'].", ".$property['city']."</td>"; if ($property['proptype'] == 'Efficiency') { echo " <td style=\"text-align:left;\">". $property['proptype']." </td>"; }elseif ($property['proptype'] == 'Certified') { echo " <td style=\"text-align:left;\">U of I Cert. Women's Room</td>"; }else{ echo " <td style=\"text-align:left;\">".$property['bedrooms']." Bedroom ". $property['proptype']." </td>"; } if ($property['available']) { echo "<td style=\"text-align:left;\" class=\"available\">Available</td>"; }else{ echo "<td style=\"text-align:left;\" class=\"unavailable\">Leased</td>"; } echo "</tr>"; } if (mysql_num_rows($result) == 0) { echo "<tr><td colspan=\"3\">No results found</td></tr>"; } echo '</table>';?>