The man in the blue cap is apparently the head of the temple here and the ceremony. The man in green robe in the lower left was the king's officer. We were told that the color (and pattern) of the scarf men wear show his rank or status.
The festival was (at least partly) organized or sponsored by different villages or organizations, and their representatives were hanging out money to the monks participated in the ceremony, first to the monks at the head, then the first row, then the second row, etc... (But these men were not wearing fancy shoes?!)