Ising model of phase transitions in ultrathin films