A comprehensive web-based prison management system built with PHP and MySQL.
- Admin Management: Add and manage officers, jailors, and visitors
- Officer Dashboard: Manage prisoners, crimes, and prison operations
- Jailor Dashboard: View and manage prisoners and sections
- Visitor Management: Handle visitor registrations and visits
- Prisoner Management: Track prisoner information, crimes, and status
- XAMPP (Apache + MySQL + PHP)
- Web browser
-
Clone/Download the project to your XAMPP htdocs folder:
C:\xampp\htdocs\PMS\Prison-Management-System\ -
Database Setup:
- Start XAMPP and ensure Apache and MySQL are running
- Open phpMyAdmin (http://localhost/phpmyadmin)
- Import the database schema from
config/database.sql - The database will be created as
prisondb
-
Configuration:
- Database configuration is in
config/config.php - Default settings:
- Host: localhost
- Database: prisondb
- Username: root
- Password: (empty)
- Database configuration is in
-
Access the Application:
- Navigate to:
http://localhost/PMS/Prison-Management-System/ - The application will automatically redirect to the public directory
- Navigate to:
- Username:
admin - Password:
password
- Username:
officer1 - Password:
officer1
- Username:
jailor1 - Password:
jailor1
The application uses a centralized routing system located in public/index.php. All pages are accessed through the ?page= parameter:
?page=home- Home/About page?page=signin-admin- Admin login?page=signin-officer- Officer login?page=signin-jailor- Jailor login?page=admin- Admin dashboard?page=officer-dashboard- Officer dashboard?page=jailor-dashboard- Jailor dashboard
Prison-Management-System/
├── config/ # Configuration files
│ ├── config.php # Main configuration
│ └── database.sql # Database schema
├── public/ # Public entry point
│ ├── index.php # Main routing file
│ ├── .htaccess # URL rewriting rules
│ └── assets/ # Static assets
├── src/ # Application source
│ ├── controllers/ # Controller files
│ ├── includes/ # Database and auth includes
│ └── views/ # View templates
└── README.md # This file
The system includes several database views that provide organized and filtered data for different user roles and reporting needs.
Purpose: Provides key statistics for the admin dashboard Columns:
Total_Prisoners- Count of all active prisonersActive_Jailors- Count of active jailorsActive_Officers- Count of active officersTotal_Sections- Count of prison sectionsToday_Visits- Number of visits scheduled for todayViolent_Criminals- Count of prisoners with violent crime categoriesHigh_Risk_Prisoners- Count of prisoners with high risk levels
Usage: Perfect for admin dashboard widgets and overview statistics
Purpose: Provides comprehensive section information with occupancy data Columns:
Section_id- Section identifierSection_name- Name of the section (A, B, C, etc.)Capacity- Maximum capacity of the sectionCurrent_population- Current number of prisonersSecurity_level- Security classification (Minimum, Medium, Maximum, Super Maximum)Jailor_Name- Full name of the assigned jailorJailor_phone- Contact number of the jailorOccupancy_Percentage- Calculated occupancy percentage
Usage: Ideal for jailor dashboards and section management screens
Purpose: Comprehensive prisoner information with associated crimes and jailor details Columns:
Prisoner_id- Unique prisoner identifierFull_Name- Complete name of the prisonerDate_in- Date of admissionDate_out- Expected release dateStatus_inout- Current status (in, out, transferred, etc.)Crime_category- Category of crimes committedRisk_level- Security risk assessmentSection_name- Assigned sectionJailor_Name- Responsible jailorCrimes- Comma-separated list of all crimesDays_Remaining- Days left until release
Usage: Perfect for prisoner management screens and detailed prisoner reports
Purpose: Organized visit information with visitor and prisoner details Columns:
Visit_id- Unique visit identifierDate_visit- Scheduled visit dateTime_slot- Time slot for the visitStatus- Visit status (Scheduled, Completed, Cancelled, No-Show)Visitor_Name- Full name of the visitorVisitor_Phone- Visitor's contact numberRelationship_with_prisoner- Relationship to the prisonerPrisoner_Name- Full name of the prisoner being visitedSection_name- Section where the prisoner is located
Usage: Essential for visit management and scheduling screens
- ✅ Centralized routing system implemented
- ✅ Fixed hardcoded relative paths in all controllers
- ✅ Updated form actions to use proper routing
- ✅ Fixed authentication redirects
- ✅ Updated navigation links to use routing system
- ✅ Fixed database connection paths
- ✅ Added proper logout functionality
- ✅ Centralized database connection
- ✅ Proper session management
- ✅ Input sanitization functions
- ✅ CSRF protection ready
- ✅ Secure file access restrictions
-
Database Connection Error:
- Ensure MySQL is running in XAMPP
- Check database credentials in
config/config.php - Verify database
prisondbexists
-
Page Not Found:
- Ensure you're accessing through
public/index.php - Check that Apache mod_rewrite is enabled
- Verify
.htaccessfile is present
- Ensure you're accessing through
-
Login Issues:
- Use the provided default credentials
- Check session configuration
- Clear browser cookies if needed
- Add route in
public/index.php - Create controller file in
src/controllers/ - Update navigation links to use
?page=your-page
- Update
config/database.sql - Modify relevant includes in
src/includes/database/ - Update controllers as needed
This project is for educational purposes.
- Ayuj
- Tuhin
- Anish