X-ray absorption study of effective coordination charges of iron in crystals and amorphous solids