Ionization and dissociation by electron impact II. NH3 and PH3