A man has been banned from entering two Bradford district areas for five years.