The magnetic solar photosphere and corona : observation, modeling, and prediction