PHP based control panel for GTA 5 game server

The company where I was doing my traineeship had a request for me to program in PHP from scratch a working control panel for a game server on GTA 5 which was running a MySQL database, slow loading times weren't acceptable so I've had to be creative and do something unique.

They've supplied me the frontend design for their control panel and I've had to do only the logics and functionality of the control panel, they already had a big MySQL database which I was demanded to work with.

Registration/login system

The registration should save the player's e-mail address as well as his unique in-game identifier and the players can only register by using a unique token they can get by entering a command in the game, all those variables then get sanitized and inserted in the same database the game server uses.

The login was pretty simple to do with the "password_verify" PHP function and the PHP sessions function, the passwords are not encrypted, I've used hashing for the password because the security level is much higher.

Homepage

On the homepage you can see multiple variables such as "online players", "players in a faction", "registered players", "banned players", "VIP players" and "online staff" which get pulled directly from the MySQL database with some optimized SQL queries.

Staff page

I've used a simple HTML table while pulling the required information from the game server's database in a simple PHP loop.

Online players page

Here things get much more complicated because I need to see the live online players and get their information from the database but there's no information in the database which I can pull to show on the website, the game server has an information HTTP page where you can get the players and their in-game licenses, after getting that information in a PHP loop I've checked their license against the database and retrieved the required information to display on the page.

Factions page

Another simple HTML table was used here with a simple PHP loop to query the database and show the required information. At this page you can also send a request to the staff team via the website to join a faction which was done using a simple HTML form to a PHP script that inserts the data to the database, after that the admins, faction leader or the faction co leader can accept any request that the player posts.

Search a player page

This search page was made possible with a simple javascript code to update the live information based on a REGEX SQL query directly in the database with some sanitization on the variable written by the visitor.

Report a player page

A much more complicated system was required here because when the players are logged in on the panel they should have the access to post a form to the database with some user entered variables to report a player and when the admins are logged in on the panel they should see another box where they can accept, deny or delete any user posted data.

Banned players page

Another simple HTML table was used here with a simple PHP loop to query the database and show the required information.

Unban requests page

The same system like the "Report a player page" was required here too, some modifications were made in order to accomodate the user entered post form.

Security features

I've also implemented an automatic session deletion (automatic logout) for every 30 minutes when no action is done on the website. A lot of variables sanitization has been done too and checks with the database.

A simple check for the user's IP address was also implemented, it works in this way, when a user is already logged in on the website it will be automatically logged out if the PHP script has detected a new IP address connecting to his account.

Caching system for slow loading

The caching system was a must have, because some pages were heavily loaded with data and the processing was slow, so I've implemented a simple PHP script that saves every one hour the slow loading results to the database and it will display the results directly from the database instead of doing all the computation work again, this system also updates the cache from the database everytime a user is accessing a page that has been cached to the database but it was cached for more than one hour.

I will leave some photos below with the finished project.