I need a suggestion on how to implement this condition: I have a system where there are admins that can edit student/user profiles, but my problem is I have multiple admins that is editing those profiles so what I dont want to happen is 2 or more admins are editing one specific profile at the same time. I am only familiar to javascript and a little in jquery and ajax.
my current solution in this has a flaws and limit where my condition is, whenever the admin clicks a profile it will trigger a status into the database that will update the column for currently_open profile into "Yes" so the other admins cant open the same profile anymore and for the admin that is currently editing the profile, the only way to trigger the status of the user is to click the save or submit button to update the database column currently_open into "No".
Well the problem of this method is whenever the browser is closed, refreshed, session time out or connection lost. the status will remain open and even the last admin that is editing the profile wont be able to access it anymore.