(a) Excepting those cases in which the sentence for the conviction of a crime was imprisonment not exceeding 1 month, or a fine not exceeding $100, any person convicted before any alderman or mayor of any incorporated city or town in this State for the violation of any city or town ordinance may appeal from such conviction to the Court of Common Pleas of the county in which the person has been so convicted, upon giving bond to the State with surety satisfactory to the alderman or mayor before whom such person was convicted, binding the person taking the appeal to appear before the Court. Notice of such an appeal shall be given to such alderman or mayor within 15 days from the time of conviction, counting the date of conviction as 1, and the bond with surety shall be filed within 15 days. Such appeal shall be prosecuted and the proceedings therein shall be had as in an appeal from a conviction before a justice of the peace in the case of a violation of the laws relating to the operation of motor vehicles.
(b) In all criminal cases in all incorporated cities or towns where a mayor or alderman has jurisdiction to hear and determine the matter and the accused has the right to elect to have the case tried by the Court of Common Pleas, every mayor or alderman shall advise such accused of the right to so elect, before the mayor or alderman shall have jurisdiction to try the case.