Every municipality may enact, make, amend, revise, or repeal all such ordinances, resolutions, and regulations as may be proper and necessary to carry into effect the powers13 granted thereto, and to provide for the punishment of each violation thereof by a fine not to exceed the fine established by subdivision 22-6-2(2), by imprisonment not exceeding thirty days, or by both the fine and imprisonment. Any person who violates this section shall be assessed a fine by the court in the amount of twenty-five dollars per violation and not to exceed five hundred dollars at the time of judgement. The fine shall be deposited in the municipal general fund.