Event Management System (Barcode-Based)
This version replaces QR codes with barcodes, uses shared sidebar and header components in a layout
folder, and organizes roles in a dedicated folder (except Users page).
1. Technology Stack
• Backend: PHP (OOP)
• Frontend: HTML, CSS, JavaScript, Bootstrap
• Database: MySQL
• Barcode: Picqer PHP Barcode Generator
2. Folder Structure
ems/
│
├── admin/
│ ├── [Link]
│ ├── [Link]
│ ├── [Link]
│ └── [Link] # USERS PAGE (NOT inside roles)
│
├── roles/
│ ├── admin/
│ │ ├── [Link]
│ │ └── manage_events.php
│ │
│ ├── cashier/
│ │ ├── [Link]
│ │ └── scan_barcode.php
│ │
│ └── verifier/
│ ├── [Link]
│ └── scan_barcode.php
│
├── layout/
│ ├── [Link]
│ ├── [Link]
│ └── [Link]
│
├── includes/
1
│ ├── [Link]
│ ├── [Link]
│ ├── [Link]
│ ├── [Link]
│ └── [Link]
│
├── barcodes/
│ └── generate_barcode.php
│
├── uploads/
│ └── barcodes/
│
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
│
├── user/
│ ├── [Link]
│ ├── [Link]
│ └── my_tickets.php
│
├── [Link]
└── [Link]
3. Layout System (Reusable Header & Sidebar)
layout/[Link]
• Contains navbar
• Loads Bootstrap, CSS, JS
layout/[Link]
• Role-based menu
• Links shown based on session role
Each page includes:
require_once '../layout/[Link]';
require_once '../layout/[Link]';
2
4. User Roles
Role Permissions
Admin Full access, manage events, users, reports
Cashier Scan barcode, validate tickets
Verifier Scan barcode only
User Buy tickets, view barcodes
Roles logic handled in:
/includes/[Link]
5. Database Tables (Updated)
tickets
ticket_id (PK)
user_id (FK)
event_id (FK)
barcode_value (VARCHAR)
status (Valid / Used)
purchase_date
6. Barcode Generation (Instead of QR)
barcodes/generate_barcode.php
• Generates CODE128 barcode
• Saves PNG in /uploads/barcodes/
Barcode value example:
EVT2026-USER15-TK8921
3
7. Ticket Purchase Flow
1. User buys ticket
2. System generates unique barcode
3. Barcode image stored on server
4. User sees barcode in my_tickets.php
8. Barcode Scanning & Validation
Cashier / Verifier
• Uses JS barcode scanner (camera or USB scanner)
• Barcode value sent to PHP via AJAX
• System checks:
• Exists?
• Status = Valid?
On success:
• Status updated to Used
• Entry allowed
9. Security
• Password hashing ( password_hash() )
• Session-based authentication
• Role-based access control
• Middleware protection per folder
10. Advantages of Barcode Over QR
• Faster scanning with hardware scanners
• Easier printing
• Works offline with USB scanners
11. Next Steps (Optional)
• Payment gateway integration
• Attendance reports
• Export sales to Excel
• Offline scanning sync
4
If you want, I can: - Generate full PHP source code - Create database SQL file - Add barcode scanner JS -
Build Admin dashboard UI