Any violation of any provision of this chapter is an infraction punishable by a fine of not more than one hundred dollars ($100) for the first offense and is a misdemeanor punishable by a fine of not less than one hundred dollars ($100) or more than one thousand dollars ($1,000) or by imprisonment in the county jail for not more than six months, or by both the fine and imprisonment, for a second or subsequent offense committed within three years of a prior conviction under this chapter.