
require("class.mysql.php");
require("config.php");
$db = new mysql_db();
if(!$db->getConnect($host,$only_db,$username,$password)){
die ("Could not connect to DB");
exit;
};
$sql = "SELECT * FROM properties LEFT JOIN prices ON properties.ID = prices.Prop_ID WHERE properties.Featured = 'main'";
$obj = $db->query($sql, 0);
srand( time() + mktime() );
$obj = $obj [ rand ( 0, count ( $obj ) - 1 ) ];
$id = $obj->ID;
$sql1 = "SELECT * FROM photos WHERE Prop_ID = $id";
$photos = $db->query($sql1, 0);
$avail_date = $db -> query ( "SELECT MAX(End) FROM shedule WHERE PROP_ID = $id" );
@$free_date = strtotime($avail_date);
if ( ( $avail_date == '0000-00-00' ) or ( $free_date < time() ) ) $avail_date = "NOW!";
$street = $obj->Street;
$street = str_replace ( ", Albany NY 12203", "", $street );
$photo_link = "photos/" . $id . "/" . $photos[0]->Filename;
$big_photo_link = str_replace ( "_sm", "", $photo_link );
if ( $big_photo_link == $photo_link ) $big_photo_link = "";
if ( !file_exists ( $big_photo_link ) ) $big_photo_link = "";
?>
if ( $photos[0] ) {
echo " ";
} ?>
Available:
since =$avail_date?>
Price:
$=$obj->Price?>
Bedrooms:
=$obj->Bedrooms?>
Address:
=($obj->House . ", " . $street )?>











