The said mayor and council shall have power to prohibit, by ordinance, the keeping for unlawful sales any amount of whiskey, beer or intoxicating drinks, by whatever name or names the same shall be called; the keeping and maintaining of lewd women, or lewd houses; the keeping of any room or rooms for gambling; the having of any whiskey, beer or other intoxicating drinks for the purpose of sale or giving away on election day; the pursuing of one's ordinary avocation or labor on the Sabbath; from loitering or idling within the jurisdiction of said city. Police court of said city shall have jurisdiction to try persons for the commission of any of said offenses committed within the limits of said city, and upon conviction, punish offenders as hereinafter provided.