Time Control

This is a time tracking system designed to monitor and display the working hours of agents within an organization, such as a police department in a FiveM roleplay server. The system provides both a detailed history of clock-ins and clock-outs and a leaderboard of top workers based on total minutes worked.

On the left side, the โ€œTime Historyโ€ panel shows individual sessions for a specific agent. Each row contains:

  • Agent: The name and badge ID of the agent (e.g., Daniel Lopez (0000)).

  • Clock In / Clock Out: The start and end time of the session.

  • Total: The duration of the session in minutes.

At the bottom, there's pagination to browse through the complete history, and a dynamic message to indicate the currently displayed records.

On the right, the โ€œTop Workersโ€ panel ranks agents based on their accumulated minutes. This ranking gives visibility into the most active personnel.

The second image shows the underlying database structure. Each row represents a time record and includes the following fields:

  • id: Unique identifier for the time record.

  • citizenid: Unique citizen identifier, used to associate logs with in-game players.

  • name: The agentโ€™s name with badge ID.

  • clockin / clockout: Timestamps marking the start and end of a work session.

  • minutes: Total minutes worked for that session.

  • job: The job name (e.g., police), which can be used to separate records by department.

This structure makes it easy to store, query, and aggregate work time per agent or department, enabling systems like shift validation, leaderboard rewards, and activity tracking.

Last updated