Moving the get_locations() function to the locations.php so any script can call it easily