count the time in different mode of a user during his login session
===

I want to store user login time.

After login, there are 4 modes
1. available
2. break
3. traning
4. email

When user select 1 of these modes, the timer of that modes start increasing.

then need to store logout time.

At admin end... admin can check the total timing of users in all individual modes.

So the question is that how to add timer and how that timers time changes in the database in 1 second interval?