It is unlawful for any public officer or employee, directly or indirectly, to promise employment, position, work, compensation, contracts, loans, grants, appropriations or other benefits provided principally from public funds as a consideration, favor or reward for any political activity, support or opposition to any candidate, party or measure in any election.