Period–luminosity relations for type II Cepheids and their application