I have a list of places in a MySql database (with id, latitude, longitude, counter, timestamp). To add them to the map I make an asynchronous call to a php file where there is a search query. Places are displayed correctly on a map with Leaflet Js.
For each place I have a popup where there is a button with a data-id that refers to the id of the place present in the database. Clicking increases a numeric field. I did this so as to have the field with the timestamp always updated.
This button is used to specify that the user is in that specific place.
Once pressed I would like the current icon to change to a special one and stay that way for at least 1 hour. If in the meantime other users press the button the time must not be added, but the limit remains 1 hour. After 1 hour the standard icon returns.
How can I achieve this? Thank you so much for the advice!
I tried saving the current timestamp with the one saved in the database, but with poor results..