dbClass = new dbClass(); } function getLatitudeLongitude($zip) { //Returns latitude and longitude of a given zipcode $query = "SELECT latitude, longitude FROM ctrak_zipcodes WHERE zipcode = ".$zip; $results = $this->dbClass->query($query); return $results; } function getZipArray($zip, $distance = 10) { //Given a zipcode and a distance, returns an comma separated list of zipcodes within this distance //If distance = 0 change to a very small distance if ($distance==0) $distance = 0.001; //Get zipcode location $location = $this->getLatitudeLongitude($zip); if(isset($location[0])) { $latitude = $location[0]['latitude']; $longitude = $location[0]['longitude']; //Get rectangle area $this->RadiusAssistant($latitude, $longitude, $distance); //Select all zipcodes within rectangle $query = "SELECT zipcode FROM ctrak_zipcodes WHERE latitude <= ".$this->maxLat." AND latitude >= ".$this->minLat; $query.= " AND longitude <= ".$this->maxLong." AND longitude >= ".$this->minLong; $results = $this->dbClass->query($query); $list = array(); foreach ($results as $key=>$value) { $list[] = $value['zipcode']; } $result = implode(",",$list); } else { $result =""; } return $result; } function Calculate( $dblLat1, $dblLong1, $dblLat2, $dblLong2 ) { $EARTH_RADIUS_MILES = 3963; $dist = 0; //convert degrees to radians $dblLat1 = $dblLat1 * M_PI / 180; $dblLong1 = $dblLong1 * M_PI / 180; $dblLat2 = $dblLat2 * M_PI / 180; $dblLong2 = $dblLong2 * M_PI / 180; if ($dblLat1 != $dblLat2 || $dblLong1 != $dblLong2) { //the two points are not the same $dist = sin($dblLat1) * sin($dblLat2) + cos($dblLat1) * cos($dblLat2) * cos($dblLong2 - $dblLong1); $dist = $EARTH_RADIUS_MILES * (-1 * atan($dist / sqrt(1 - $dist * $dist)) + M_PI / 2); } return $dist; } function RadiusAssistant($Latitude, $Longitude, $Miles) { $EQUATOR_LAT_MILE = 69.172; $this->maxLat = $Latitude + $Miles / $EQUATOR_LAT_MILE; $this->minLat = $Latitude - ($this->maxLat - $Latitude); $this->maxLong = $Longitude + $Miles / (cos($this->minLat * M_PI / 180) * $EQUATOR_LAT_MILE); $this->minLong = $Longitude - ($this->maxLong - $Longitude); } } ?> Everyhomepro.com provides the most comprehensive online directory of home improvement professionals
EVERYHOMEPRO.com site sponsor
 
welcome to our website
Target Your Search
      Enter Zip Code         and      Click a Selection Below   
Architects & Engineers
Architects, Engineers, more...
Insect & Pest Control
Bugs, Insects, Pests, more...
Attic, Basement & Garage
Garage Doors, Remodeling, more...
Interior Designers
Decorators, Designers, more...
Auctioneers, Liquidators & Appraisers
Appraisals, Auctioneers, more...
Kitchen, Bath & Closets
Cabinets, Remodelers, more...
Carpentry Work
Furniture, Woodwork, more...
Masonry & Stonework
Brick Work, Stonework, Tiling, more...
Ceiling, Floors & Walls
Carpeting, Painters, Tiling, more...
Moisture Control
Waterproofing, Weather Stripping, more...
Concrete Work
Driveways, Repair, more...
Outdoor Work
Landscapers, Gardeners, more...
Disasters & Major Construction
Construction, Disaster Recovery, more...
Plumbing, Heating & Cooling
Heating, Cooling, Plumbers, more...
Electrical & Mechanical Work
Electricians, Home Theaters, more...
Recreation
Pools, Putting Greens, more...
Fine Arts & Collectibles
Paintings, Restoration, more...
Roofing & Metal Work
Mobile, Roofers, Siding, more...
Fire, Safety & Security
Alarms, Locksmiths, more...
Specialty Home Structures
Mobile, Prefabricated, more...
Home & Property Inspections
Asbestos, Engineers, Home, Property, more...
Testing & Remediation
Asbestos, Environmental, Lead, more...
Home Cleaning & Maintenance
Carpet, Upholstery, House, more...
Windows, Doors & Fabrics
Installations, Treatments, more...
 
 
SEARCH OPTIONS
Company Name
Phone Number
Enter Phone Number:
- -  
See All Categories
 
RATINGS & REVIEWS
 Check Rating
 Rate A Pro
 
Get the Flash Player to see this player.