Skip to content

About

Vehicle parking slot reservation and management web portal with multi-role authentication (Admin/User), interactive slot selection, and Chart.js analytics built using PHP Native & MySQL.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

🚗 Smart Parking Reservation System

PHP MySQL Chart.js License

A full-featured web-based vehicle parking management and slot reservation portal built with PHP Native, MySQL, and Chart.js. The platform provides role-based access control, an interactive graphical parking layout (denah), audit logging, and analytical visualization of parking spot occupancy.


📌 Features & Architecture

flowchart TD
    User["Vehicle Owner / User"] -->|Register / Login| Auth["Authentication System (config.php)"]
    Admin["System Administrator"] -->|Admin Credentials| Auth

    Auth -->|Role: User| UserDashboard["User Dashboard (user_page.php)"]
    Auth -->|Role: Admin| AdminDashboard["Admin Dashboard (admin_page.php)"]

    UserDashboard --> Denah["Interactive Slot Selector (denah.php)"]
    Denah -->|Assign Slot & Log Plate| DB[("MySQL Database (user_db)")]

    AdminDashboard --> Analytics["Occupancy Analytics (graphic.php via Chart.js)"]
    AdminDashboard --> History["Vehicle Parking Logs (history.php)"]
    AdminDashboard --> CRUD["User & Slot Management (modul/edit.php, delete.php)"]

    Analytics --> DB
    History --> DB
    CRUD --> DB
Loading

🔑 Key Modules

  1. Role-Based Access Control (RBAC):
    • Admin Portal: High-level administrative control, vehicle registration logs, slot release, and real-time analytical charts.
    • User Portal: Personalized dashboard displaying vehicle plate number, active parking slot reservation, and check-in/check-out actions.
  2. Interactive Visual Denah:
    • Interactive seat/slot layout allowing drivers to claim available slots in real time.
    • Prevents slot double-booking by locking claimed areas to registered license plates (plat).
  3. Occupancy Analytics:
    • Integrated Chart.js telemetry illustrating real-time parking density and slot availability.
  4. Audit Trail & History:
    • Historical record of vehicle check-ins with timestamps (riwayat_parkir).

🗄️ Database Architecture

The system operates on the user_db relational database with two core entities:

user_db
├── user_form       # User credentials, license plate (plat), role, and active assigned slot (area)
└── riwayat_parkir  # Immutable log of vehicle parking transactions (plat, area, timestamp)
Table Column Type Description
user_form id INT AUTO_INCREMENT PRIMARY KEY Unique account identifier
user VARCHAR(100) Username / display name
plat VARCHAR(20) UNIQUE Vehicle license plate number
password VARCHAR(255) Encrypted account password (MD5)
user_type ENUM('admin', 'user') Access control role
area VARCHAR(50) NULL Currently occupied parking slot ID
riwayat_parkir id INT AUTO_INCREMENT PRIMARY KEY Audit record identifier
plat VARCHAR(20) Parked vehicle license plate
area VARCHAR(50) Occupied parking slot code
waktu TIMESTAMP Check-in timestamp

📁 Repository Structure

smart-parking-reservation-system/
├── admin_page.php          # Admin control center and navigation hub
├── user_page.php           # Vehicle owner reservation interface
├── login_form.php          # Authentication login endpoint
├── register_form.php       # Account registration with vehicle plate binding
├── logout_form.php         # Session termination
├── config.php              # MySQL database connection configuration
├── script.js               # Frontend client interactivity
├── css/                    # Custom stylesheets (style.css, style1.css, style2.css)
├── images/                 # Graphical assets and layout graphics
├── database/
│   └── schema.sql          # DDL and sample seed records
├── konten/
│   ├── denah.php           # Interactive parking slot layout & assignment logic
│   ├── graphic.php         # Chart.js visualization of parking occupancy
│   └── history.php         # Historical parking log table
└── modul/
    ├── edit.php            # Record modification endpoint
    ├── delete.php          # User / slot release deletion endpoint
    └── exit.php            # Session destroy helper

⚡ Quickstart & Installation

1. Requirements

  • Web Server: Apache (via XAMPP, Laragon, WampServer, or native Apache2)
  • PHP: 7.4+ or 8.x
  • Database: MySQL 5.7+ or MariaDB

2. Setup Database

  1. Open phpMyAdmin or MySQL CLI.
  2. Import the schema file located at database/schema.sql:
    mysql -u root -p < database/schema.sql
    (This creates the user_db database, required tables, and default seed accounts).

3. Configure Connection

Edit config.php to match your local database credentials if needed:

<?php
$conn = mysqli_connect('localhost', 'root', '', 'user_db');
?>

4. Run Application

  • Using XAMPP / Laragon: Place this repository inside htdocs/smart-parking-reservation-system (or www/), then visit: http://localhost/smart-parking-reservation-system/login_form.php

  • Using PHP Built-in Server:

    cd smart-parking-reservation-system
    php -S localhost:8000

    Then open http://localhost:8000/login_form.php in your browser.

5. Default Credentials (Demo)

  • Admin: Username: Admin | Plate: B1234ADM | Password: admin123
  • User: Username: Demo User | Plate: B5678XYZ | Password: admin123

👩‍💻 Author

Zeiniah (@zeyniaa)
AI & Backend Engineer

About

Vehicle parking slot reservation and management web portal with multi-role authentication (Admin/User), interactive slot selection, and Chart.js analytics built using PHP Native & MySQL.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages