A comprehensive web-based gate pass and hostel in/out management system built with PHP, MySQL, and Bootstrap. Designed for educational institutions to digitally manage student gate passes, hostel movement logs, and campus security.
- π« Digital Gate Pass Generation β Students can request gate passes online with PDF/barcode download
- π· QR Code & Barcode Scanning β Security staff can scan passes via camera at entry/exit
- π¨βπΌ Multi-Role Dashboard β Separate dashboards for Admin, Staff, and Security
- π Analytics & Reports β Visual analytics for student movement trends
- π Export Options β Export records to PDF, Excel (.xlsx), or Word (.docx)
- π Auto-Expiry & Cleanup β Automatically deletes old/expired pass requests
- π Multi-Language Support β Language switcher with locale files
- π Dark Mode β System-wide dark/light mode toggle
- π Toast Notifications β Real-time feedback with toast alerts
- π± Responsive Design β Mobile-friendly layout
- βοΈ Admin Settings β Customizable system settings, background, master data
- π Dynamic Tables β Admin can create and manage custom data tables
Click to expand screenshots
| Admin Dashboard | Login Page |
|---|---|
![]() |
![]() |
| Student Request Gatepass | Staff Pending Requests |
|---|---|
![]() |
![]() |
| QR Scanner Camera | QR Barcode View |
|---|---|
![]() |
![]() |
| Analytics Dashboard | View Logs |
|---|---|
![]() |
![]() |
| Gatepass PDF | Dark Mode |
|---|---|
![]() |
![]() |
| Layer | Technology |
|---|---|
| Backend | PHP 8.x |
| Database | MySQL (via MySQLi) |
| PDF Library | dompdf v3.1 |
| QR Codes | PHP QR Code Library |
| Frontend | HTML5, CSS3, Bootstrap, Vanilla JS |
| Server | Apache (XAMPP recommended) |
| Package Mgr | Composer |
| Role | Description |
|---|---|
| Admin | Full system control β manage staff, students, settings, analytics, logs |
| Staff | Approve/reject gate pass requests, view pending requests and analytics |
| Security | Scan QR/barcode at gate, record entry/exit, verify passes |
| Student | Submit gate pass requests, view pass status, download gate pass PDF |
git clone https://github.com/hanak13/Digital-Gatepass-System.git
cd Digital-Gatepass-SystemOr download and extract the ZIP into your XAMPP htdocs folder.
composer install- Start Apache and MySQL via XAMPP Control Panel.
- Open http://localhost/phpmyadmin
- Create a new database named
db - Import
db.sqlvia the Import tab.
Open db_connect.php and update if needed:
$servername = "localhost";
$username = "root";
$password = ""; // Set your MySQL password here
$dbname = "db";Or use environment variables (recommended for production):
DB_HOST=localhost
DB_USER=root
DB_PASS=your_password
DB_NAME=db
| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
| Security | security |
security123 |
β οΈ Change these immediately after first login!
Visit: http://localhost/Digital-Gatepass-System/
After setting up, personalize the system for your institution by updating these strings in the source files:
| Placeholder | Replace With |
|---|---|
Your University / YOUR UNIVERSITY |
Your actual university name |
Your Institute Name |
Your institute's full name |
Your City, Your State |
Your address |
hostel@yourdomain.com |
Your hostel email |
Institution Founder |
Your founder's name (in footer quotes) |
Files to update: login.php, footer.php, staff-footer.php, security-footer.php, header.php, navbar.php (or set college_name in Admin Settings), and the export/download files.
You can also upload your logo through Admin Settings β Logo Upload.
| File | Purpose |
|---|---|
db_connect.php |
Database credentials & helper functions |
admin-settings.php |
System settings (UI, email, background, etc.) |
lang/ |
Language translation files |
uploads/ |
Uploaded files (gate pass documents, images) |
project/
βββ index.php # Landing page
βββ login.php # Login page (all roles)
βββ db_connect.php # DB connection & utility functions
β
βββ admin-dashboard.php # Admin main dashboard
βββ admin-staff.php # Staff management
βββ admin-analytics.php # Admin analytics & charts
βββ admin-settings.php # System settings
βββ admin-masters.php # Master data management
βββ admin-dynamic-tables.php # Custom dynamic tables
βββ admin-security-users.php # Security user management
β
βββ staff-pending-requests.php # Staff: pending approvals
βββ staff-analytics.php # Staff: analytics view
β
βββ student-request-gatepass.php # Student: submit gate pass
βββ student-view-qr.php # Student: QR code view
βββ student-show-barcode.php # Student: barcode view
β
βββ security-dashboard.php # Security staff dashboard
βββ qr-scanner-camera.php # Camera-based QR scanner
β
βββ download-gatepass.php # Gate pass PDF download
βββ download-bulk-gatepass.php # Bulk PDF download
βββ export-pdf.php # Records export to PDF
βββ export-excel.php # Records export to Excel
βββ export-word.php # Records export to Word
β
βββ view-logs.php # View all in/out logs
βββ view-applications.php # View all applications
β
βββ theme.css # Main stylesheet
βββ responsive.css # Mobile responsiveness
βββ dark-mode.js # Dark/light mode toggle
β
βββ lang/ # Language files
βββ uploads/ # User-uploaded files
βββ qrcodes/ # Generated QR codes
βββ dompdf-3.1.4/ # PDF generation library
βββ vendor/ # Composer dependencies
- Student submits a gate pass request β
student-request-gatepass.php - Staff reviews and approves/rejects β
form-approve-request.php - Student downloads QR/barcode pass β
student-view-qr.php - Security scans the pass at the gate β
qr-scanner-camera.php - Entry/exit is logged β
view-logs.php
- Gate pass serials:
BLOCK + HOSTEL + TYPE + YYMM + 4-digit seq
Example:ABDP26020014 - Request serials:
YYMM-LETTER-4DIGITS
Example:2602-A-0001
- PDF via dompdf
- Excel via PhpSpreadsheet
- Word via PhpOffice/PHPWord
- β Prepared Statements β All queries use parameterized statements (no SQL injection)
- β CSRF Protection β Token-based CSRF validation on all forms
- β Password Hashing β Bcrypt with cost factor 12
- β Session Timeout β Auto-logout after inactivity (default: 1 hour)
- β File Upload Validation β MIME type + extension validation + image re-encoding
- β
Input Sanitization β
cleanInput()applied to all user input - β
XSS Protection β
htmlspecialchars()on all output
Language files are located in the lang/ directory. Use the language switcher (lang-switcher.php) to toggle between available languages.
This project is licensed under the MIT License.
Note: Make sure the
uploads/andqrcodes/directories have proper write permissions on your server.









