Increment visits

Hi everyone, here is my problem:
A visitor of my page should be able to enter his/her personal ID (e.g. mobile phone). When clicking “submit”, it should be checked if the ID already exists, if yes, the number of visits should be incremented +1. If not existing, it should lead to a registration form. If the number of visit = 5, 10, 15, etc., it should increment but also lead to a specific reward page.
So far, I have the initial DB created, the forms and landing page. I have little understanding of coding, can you please help me?
As you can see, the use case is “Loyatly”. We want to have a kiosk in our shop instead of the classic punch card. Many thanks!

Does the user have to log in to the site before submitting the info?

Hi JD, no. The page will be available only on the kiosk in our shop. Thank you!