(a) A county is authorized to prohibit and punish any act, matter, or thing which the laws of this state make a misdemeanor and to prescribe penalties for all offenses in violation of any ordinance of the county not greater nor less than the penalties prescribed for similar offenses against the laws of this state.
(b) Upon conviction of any person under such ordinance by any court, the conviction shall operate as a bar to further prosecution in any of the courts of this state for the same offense.