The influence of the brittle-ductile transition zone on aftershock and foreshock occurrence