StarSMP MySQL / cPanel setup
============================

1. In cPanel > MySQL Databases, create/confirm this database and user:
   Database: starsmpc_staffplaytime
   User:     starsmpc_staffplaytime

2. Add the user to the database and grant ALL PRIVILEGES.

3. Upload every file in this folder together to public_html (or the desired
   subfolder). Do not open index.html directly from your computer; access it
   through the website URL so api.php can run.

4. The API automatically creates the app_state table on first use. You may
   alternatively import database.sql through cPanel > phpMyAdmin.

5. Open api.php in the browser. A successful setup returns JSON containing
   "ok":true. Then open index.html. Existing browser data is uploaded on the
   first visit and all browsers using this installation sync every 3 seconds.

Important: "localhost" is correct only when these website files and the MySQL
database are hosted in the same cPanel account/server. If the site is hosted
elsewhere, replace the host in config.php with cPanel's remote MySQL hostname
and allow that web server under cPanel > Remote MySQL.

Security note: config.php contains the database password. The included
.htaccess blocks direct web access on Apache/cPanel. PHP must be enabled.

Table fields added in this version:
- LOA: True or False
- LOA Length defaults to N/A and supports 3 Days through 31 Days.
- Approved LOAs automatically expire after their approved number of days.
- Requests over 31 days, including 1 month or 4.5 weeks, are rejected.
- The LOA form includes TESTING, which displays as 1 Minute (TESTING) in the
  main table and automatically expires after 60 seconds.
- Rank: Fired
- Status: Not Counted

Live viewer synchronization:
- Only an unlocked Admin Panel session writes table changes to MySQL.
- Viewer sessions are read-only and receive updates every 3 seconds.
- Remote updates refresh the visible table without reloading or blanking it.
