Any teacher, principal, supervisor, service personnel or other person employed by a board of education who is subpoenaed to appear as a witness but not as a defendant in any criminal proceeding in any court of law may make such appearance without any loss of pay. The board shall pay to such employee the difference between the witness fee, exclusive of travel allowances, payable for such appearance by the court and the amount of salary due to the person for the time such employee is absent from his employment by reason of answering such subpoena.