  The evolution of a stellar disk under the influence of viscous evolution,
photoevaporation from the central source, and photoevaporation by external
stars is studied. We take the typical parameters of TTSs and the Trapezium
Cluster conditions. The photoionizing flux from the central source is assumed
to arise both from the quiescent star and accretion shocks at the base of
stellar magnetospheric columns, along which material from the disk accretes.
The accretion flux is calculated self-consistently from the accretion mass loss
rate. We find that the disk cannot be entirely removed using only viscous
evolution and photoionization from the disk-star accretion shock. However, when
FUV photoevaporation by external massive stars is included the disk is removed
in 10^6 -10^7yr; and when EUV photoevaporation by external massive stars is
included the disk is removed in 10^5 - 10^6yr.
  An intriguing feature of photoevaporation by the central star is the
formation of a gap in the disk at late stages of the disk evolution. As the gap
starts forming, viscous spreading and photoevaporation work in resonance.
  There is no gap formation for disks nearby external massive stars because the
outer annuli are quickly removed by the dominant EUV flux. On the other hand,
at larger, more typical distances (d>>0.03pc) from the external stars the flux
is FUV dominated. As a consequence, the disk is efficiently evaporated at two
different locations; forming a gap during the last stages of the disk
evolution.
