$height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } //gets the new value and applies the percentage, then rounds the value $width = round($width * $percentage); $height = round($height * $percentage); /*returns the new sizes in html image tag format...this is so you can plug this function inside an image tag and just get the*/ return "width=\"$width\" height=\"$height\""; } // Query the database $query = "SELECT l.id, l.rent, l.heat, l.appliances, l.address, l.water, l.garage, date_format(l.available, '%m/%d/%Y') as available, l.gas, l.pets, l.bedrooms, l.electric, l.section8, l.active, li.image, u.membershipLevel FROM listings l left outer join listingImages li on l.id = li.listingId AND li.primary = 'yes' right join users u on l.owner = u.username "; $query .=" WHERE "; if(!$session->logged_in) { $query .=" active='yes' and "; } if($_GET['t'] != 'Any' && $_GET['t']!=''){ $where .= ' l.rentaltype = \''.$_GET['t'].'\' and'; } if($_GET['b'] != 'Any' && $_GET['b']!=''){ $where .= ' l.bedrooms = \''.$_GET['b'].'\' and'; } if($_GET['min'] != 'Any' && $_GET['min']!=''){ $where .= ' l.rent >= \''.$_GET['min'].'\' and'; } if($_GET['max'] != 'Any' && $_GET['max'] !=''){ $where .= ' l.rent <= \''.$_GET['max'].'\' and'; } if($_GET['p'] != 'Any' && $_GET['p']!=''){ $where .= ' l.pets LIKE \''.$_GET['p'].'%\' and'; } if($_GET['s'] != 'Any' && $_GET['s']!=''){ $where .= ' l.section8 = \''.$_GET['s'].'\' and'; } if((isset($_GET['z'])) && ($_GET['z'] != '')){ $where .= ' l.zipCode = \''.$_GET['z'].'\' and'; } if($session->logged_in){ $where .= ' l.owner = \''.$session->username.'\''; $query .= $where; } else { if(isset($where)){ $where = substr($where, 0,strlen($where)-4); $query .= $where; } } $query .= ' Order by available asc'; echo ''; $mysqldb->query($query); ?> RentRacine.com » Listings
RentRacine.com
   
numRows() >= 1){ $bg = 'altBG2'; ?> fetchObject()){ if($session->logged_in){ $link = 'edit'; if($row->active == 'yes'){ $bg = 'active'; } else { $bg = 'nonactive'; } } else { $link = 'individual'; if($bg == 'altBG2'){ $bg = 'altBG1'; } else { $bg = 'altBG2'; } } if(($session->logged_in) || (!($session->logged_in) && ($row->membershipLevel!="") && ($row->membershipLevel>0))) {?>
image == NULL) || ($row->image == '')){?>