(a) After the trial, continuance of the cause or discharge of the witness, the clerk must, on his application and upon his oath, give the witness a certificate setting forth the cause in which he was a witness, the party by whom he was summoned or on whose request he attended, the number of day he attended as a witness and the sum to which he is entitled for his attendance, travel, ferriage and tolls, which he must also enter, either upon the subpoena docket or book to be kept for that purpose.
(b) The witness must prove his attendance within five days after his attendance as such witness.