Skip to content

hanak13/Digital-Gatepass-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏫 Digital Gatepass System

Hostel In-Out Log & Gate Pass Management System

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.


✨ Features

  • 🎫 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

πŸ“Έ Screenshots

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

πŸ›  Tech Stack

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

πŸ‘₯ User Roles

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

βœ… Prerequisites

  • XAMPP (PHP 8.0+ & MySQL 5.7+)
  • Composer
  • A modern web browser (Chrome, Firefox, Edge)

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/hanak13/Digital-Gatepass-System.git
cd Digital-Gatepass-System

Or download and extract the ZIP into your XAMPP htdocs folder.

2. Install PHP Dependencies

composer install

3. Import the Database

  1. Start Apache and MySQL via XAMPP Control Panel.
  2. Open http://localhost/phpmyadmin
  3. Create a new database named db
  4. Import db.sql via the Import tab.

4. Configure Database Connection

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

5. Default Login Credentials

Role Username Password
Admin admin admin123
Security security security123

⚠️ Change these immediately after first login!

6. Run the Application

Visit: http://localhost/Digital-Gatepass-System/


🎨 Customization

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.


βš™οΈ Configuration

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 Structure

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

πŸ”‘ Key Modules

Gate Pass Flow

  1. Student submits a gate pass request β†’ student-request-gatepass.php
  2. Staff reviews and approves/rejects β†’ form-approve-request.php
  3. Student downloads QR/barcode pass β†’ student-view-qr.php
  4. Security scans the pass at the gate β†’ qr-scanner-camera.php
  5. Entry/exit is logged β†’ view-logs.php

Auto Serial Numbering

  • Gate pass serials: BLOCK + HOSTEL + TYPE + YYMM + 4-digit seq
    Example: ABDP26020014
  • Request serials: YYMM-LETTER-4DIGITS
    Example: 2602-A-0001

Export & Reports

  • PDF via dompdf
  • Excel via PhpSpreadsheet
  • Word via PhpOffice/PHPWord

πŸ”’ Security

  • βœ… 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

🌐 Multi-Language Support

Language files are located in the lang/ directory. Use the language switcher (lang-switcher.php) to toggle between available languages.


πŸ“ License

This project is licensed under the MIT License.


Note: Make sure the uploads/ and qrcodes/ directories have proper write permissions on your server.