Man charged with slapping child loses job