Skip to content

joaopgamarques/PISID-LabirintoApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Web App

A simple web application for managing and monitoring maze-based games.

Overview

  • Games Management: Create, start, view, and terminate games.
  • Alerts/Messages: Fetches and displays real-time alerts.
  • Stored Procedures: Leverages MySQL procedures for core operations.

Requirements

  • PHP 7.4+ (e.g., via XAMPP)
  • MySQL 5.7+ (with correct privileges)
  • Web browser (Chrome, Firefox, etc.)

Setup

  1. Clone or Copy Project
    Place the files (e.g., games.php, game_edit.php, game_view.php, etc.) in your server’s document root (e.g., htdocs/ in XAMPP).

  2. Database

    • Create a MySQL database named Labirinto.
    • Run the SQL scripts provided to create tables and stored procedures.
    • Ensure each stored procedure is granted EXECUTE permission to the role or user.
  3. Credentials & Sessions

    • Adjust db_connection.php or your config file to match your MySQL host, user, and password.
    • auth_check.php ensures only authorized users (with the correct MySQL role) can access certain pages.
  4. Testing

    • In your browser, visit http://localhost/games.php.
    • Create, select, and start a game.
    • Check the messages/alerts area, which updates every second via AJAX.

File Descriptions

  • games.php
    Main entry point that displays a list of user’s games.
    Supports actions: criar, iniciar, terminar, and visualizar.

  • games_content.php
    Template for listing games and their status, plus a real-time alert section.

  • game_edit.php
    Form for editing a game’s description and alert visibility settings.

  • game_view.php
    Read-only view of a game’s configuration.

  • fetch_messages.php
    Returns the updated list of alert messages in HTML format.

  • db_connection.php
    Connection logic for MySQL (adjust credentials as needed).

  • auth_check.php
    Verifies that the user is logged in with the correct MySQL role.

Notes

  • If you see “execute command denied,” verify that the MySQL user has EXECUTE privileges on each stored procedure (e.g., GRANT EXECUTE ON PROCEDURE Labirinto.SomeProcedure TO 'username'@'localhost';).
  • The alert messages are refreshed via a small JavaScript snippet that calls fetch_messages.php every second.
  • To preserve a radio button selection on auto-refresh, you can implement an AJAX approach for refreshing only the relevant sections (similar to the alert messages).

About

Projeto desenvolvido no âmbito da unidade curricular de Projeto de Integração de Sistemas de Informação Distribuídos.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors