A complete PHP & MySQL web-based system for managing public utility operations like billing, payments, and user administration with a modern UI.
Streamlining customer service, automated billing, and real-time revenue tracking for electricity and water utilities.
Explore Features Β»
View Demo
Β·
Installation Guide
Β·
Usage
Β·
Contributing
- About the Project
- Demo
- Features
- Tech Stack
- Installation
- Usage
- Database Schema
- Screenshots
- Security Features
- Roadmap
- Contributing
- Bug Reports & Feature Requests
- License
- Author
- Acknowledgments
- Support
π Try it now: Live Demo Link
Want to test locally? Here's the fastest way:
# Quick setup (requires XAMPP running)
git clone https://github.com/Divyansh3105/Public-Utility-Management-System.git
cd public-utility-management-system
# Import database
mysql -u root -p < database/public_utility_system.sql
# Open in browser
http://localhost/public-utility-management-systemTest the system with these pre-configured accounts:
| Role | Email/Username | Password | Access Level |
|---|---|---|---|
| π Admin | admin |
1234 |
Full system access, user management, reports |
| π· Employee | employee@gmail.com |
emp123 |
Bill generation, payment processing |
| π€ Customer 1 | divyansh.tech01@gmail.com |
cust201 |
View bills, make payments |
| π€ Customer 2 | john@gmail.com |
cust202 |
View bills, make payments |
β οΈ Note: These are demo credentials. In production, ensure all default passwords are changed immediately.
- β View dashboard with real-time statistics
- β Add new employee account
- β Generate monthly revenue report
- β Update electricity/water rates
- β View activity logs
- β Generate a new electricity bill
- β Process customer payment
- β Search customer records
- β View payment history
- β Generate daily report
- β View current bills
- β Make online payment
- β Download bill PDF
- β Check payment history
- β Update profile information
The demo includes:
- π₯ 5 Customer Accounts with varied billing history
- π¨βπΌ 3 Employee Accounts with different roles
- π 20+ Sample Bills across multiple months
- π° 15+ Payment Records showing various payment methods
- π Pre-generated Reports for testing
The Public Utility Management System is a full-featured web application designed to modernize and automate the operations of public utility services. Built with PHP and MySQL, it provides a robust platform for managing electricity and water billing, customer accounts, employee operations, and financial reporting.
Traditional utility management systems often suffer from:
- Manual billing processes prone to errors
- Lack of real-time payment tracking
- Poor customer service experience
- Inefficient employee workflows
- Limited administrative oversight
This system addresses these challenges by providing:
- Automated billing generation for electricity and water services
- Real-time payment processing and verification
- Role-based access control for security and efficiency
- Comprehensive reporting and analytics
- User-friendly interfaces for all stakeholders
-
User Management
- Create, update, and delete employee accounts
- Manage customer profiles and service connections
- Assign roles and permissions
-
Financial Oversight
- Monitor total revenue and outstanding payments
- View real-time billing statistics
- Track payment trends and patterns
-
Reporting & Analytics
- Generate comprehensive reports (daily, monthly, yearly)
- Export data in multiple formats (PDF, Excel, CSV)
- Visualize key performance indicators
-
System Configuration
- Update utility rates dynamically
- Configure billing cycles
- Manage system settings
-
Activity Monitoring
- Complete audit trail of all operations
- Track user actions and system events
- Security logs and access records
-
Billing Operations
- Generate bills based on meter readings
- Update existing bill information
- Apply discounts and adjustments
- Handle bill corrections
-
Payment Management
- Process and verify customer payments
- Update payment status (pending, completed, failed)
- Handle cash and online transactions
- Generate payment receipts
-
Customer Service
- View comprehensive customer records
- Search and filter customer data
- Access payment and billing history
- Manage service requests
-
Performance Tracking
- View personal performance metrics
- Generate employee-specific reports
- Track daily activities
-
Bill Management
- View current and past bills
- Download bills in PDF format
- Track billing history
- View detailed consumption data
-
Payment Services
- Make secure online payments
- Record cash payments
- View payment confirmation
- Download payment receipts
-
Account Management
- Update personal information
- View connection details
- Track service status
- Access support resources
-
Notifications
- Real-time bill generation alerts
- Payment due reminders
- Service announcements
- HTML5 - Structure and semantic markup
- CSS3 - Modern styling with custom themes
- Responsive grid layouts
- Dark/Light mode toggle
- CSS animations and transitions
- JavaScript (Vanilla) - Interactive functionality
- Form validation
- Dynamic content loading
- Real-time search and filtering
- PHP 8.0+ - Server-side logic
- Object-oriented programming
- Secure session management
- Database abstraction layer
- MySQL 10.4+ - Relational database
- Normalized schema design
- Optimized queries with indexing
- Transaction support
- Apache - Web server
- XAMPP/LAMP/WAMP - Development stack
Before you begin, ensure you have the following installed:
- XAMPP (v8.0+) or LAMP/WAMP
- PHP (β₯ 8.0)
- MySQL (β₯ 10.4)
- Modern web browser (Chrome, Firefox, Edge, Safari)
-
Clone the Repository
git clone https://github.com/Divyansh3105/Public-Utility-Management-System.git cd public-utility-management-system -
Move to Web Server Directory
# For XAMPP on Windows copy public-utility-management-system C:\xampp\htdocs\ # For XAMPP on Linux/Mac cp -r public-utility-management-system /opt/lampp/htdocs/
-
Database Setup
a. Open phpMyAdmin
http://localhost/phpmyadminb. Create a new database
CREATE DATABASE public_utility_system;
c. Import the SQL file
- Click on the
public_utility_systemdatabase - Navigate to the "Import" tab
- Choose the file
public_utility_system.sql - Click "Go" to execute
- Click on the
-
Configure Database Connection
Edit
db_connect.phpif needed:<?php $host = 'localhost'; $dbname = 'public_utility_system'; $username = 'root'; $password = ''; // Your MySQL password ?>
-
Start the Server
- Open XAMPP Control Panel
- Start Apache and MySQL services
- Ensure both are running (green indicators)
-
Access the Application
http://localhost/public-utility-management-system
| Role | Username/Email | Password |
|---|---|---|
| Admin | admin |
1234 |
| Employee | employee@gmail.com |
emp123 |
| Customer | divyansh.tech01@gmail.com |
cust201 |
β οΈ Security Notice: Change default passwords immediately after first login in a production environment.
- Login to the admin dashboard
- Manage Users - Add/edit employees and customers
- Monitor Operations - View real-time statistics
- Generate Reports - Access comprehensive analytics
- Configure System - Update rates and settings
- Login to the employee dashboard
- Generate Bills - Enter meter readings and create bills
- Process Payments - Verify and update payment records
- Customer Support - Access customer information
- Reports - View performance metrics
- Login to the customer portal
- View Bills - Check current and past bills
- Make Payments - Pay bills online or record cash payments
- Download Documents - Get PDF bills and receipts
- Track History - Monitor payment and billing history
public_utility_management_system/
β
βββ π assets/
β βββ style.css # Main stylesheet
β
βββ π admin/
β βββ dashboard_admin.php # Admin dashboard
β βββ manage_customers.php # Customer management
β βββ manage_employees.php # Employee management
β βββ activity_log.php # System logs
β βββ view_logs.php # Log viewer
β βββ view_bills.php # Bill viewer
β βββ view_payments.php # Payment history
β βββ report_data.php # Report generation
β
βββ π employee/
β βββ dashboard_employee.php # Employee dashboard
β βββ employee_generate_bill.php # Bill creation
β βββ employee_update_payment.php # Payment processing
β βββ employee_reports.php # Employee reports
β βββ employee_logs.php # Log viewer
β
βββ π customer/
β βββ dashboard_customer.php # Customer dashboard
β βββ customer_view_bills.php # Bill viewer
β βββ customer_make_payment.php # Payment portal
β βββ customer_payment_history.php # Payment history
β
βββ π includes/
β βββ db_connect.php # Database connection
β βββ log_functions.php # Logging utilities
β
βββ π database/
β βββ public_utility_system.sql # Database schema
β
βββ index.php # Landing/Login page
βββ logout.php # Session termination
βββ README.md # Documentation (this file)
βββ LICENSE # MIT License
Stores administrator credentials and access levels.
| Column | Type | Description |
|---|---|---|
| admin_id | INT (PK) | Unique identifier |
| username | VARCHAR(50) | Login username |
| password | VARCHAR(255) | Hashed password |
| VARCHAR(100) | Contact email | |
| created_at | TIMESTAMP | Account creation date |
Manages employee information and authentication.
| Column | Type | Description |
|---|---|---|
| employee_id | INT (PK) | Unique identifier |
| name | VARCHAR(100) | Full name |
| VARCHAR(100) | Email (login) | |
| password | VARCHAR(255) | Hashed password |
| phone | VARCHAR(15) | Contact number |
| role | ENUM | Job role/designation |
| hired_date | DATE | Employment start date |
| status | ENUM | Active/Inactive |
Stores customer profiles and service connections.
| Column | Type | Description |
|---|---|---|
| customer_id | INT (PK) | Unique identifier |
| name | VARCHAR(100) | Full name |
| VARCHAR(100) | Email (login) | |
| password | VARCHAR(255) | Hashed password |
| phone | VARCHAR(15) | Contact number |
| address | TEXT | Service address |
| connection_type | ENUM | Electric/Water/Both |
| meter_number | VARCHAR(50) | Meter identifier |
| registration_date | TIMESTAMP | Account creation date |
Tracks electricity billing records.
| Column | Type | Description |
|---|---|---|
| bill_id | INT (PK) | Unique identifier |
| customer_id | INT (FK) | Customer reference |
| bill_month | VARCHAR(20) | Billing period |
| previous_reading | DECIMAL(10,2) | Last meter reading |
| current_reading | DECIMAL(10,2) | Current meter reading |
| units_consumed | DECIMAL(10,2) | Usage amount |
| rate_per_unit | DECIMAL(10,2) | Current rate |
| total_amount | DECIMAL(10,2) | Bill total |
| due_date | DATE | Payment deadline |
| status | ENUM | Paid/Unpaid/Overdue |
| generated_by | INT (FK) | Employee who created |
| created_at | TIMESTAMP | Bill generation date |
Manages water billing information (similar structure to electric_bill).
Records all payment transactions.
| Column | Type | Description |
|---|---|---|
| payment_id | INT (PK) | Unique identifier |
| bill_id | INT (FK) | Associated bill |
| customer_id | INT (FK) | Customer reference |
| amount | DECIMAL(10,2) | Payment amount |
| payment_method | ENUM | Cash/Online/Card |
| payment_date | TIMESTAMP | Transaction date |
| verified_by | INT (FK) | Employee who verified |
| status | ENUM | Success/Pending/Failed |
| transaction_id | VARCHAR(100) | External reference |
Audit trail for system operations.
| Column | Type | Description |
|---|---|---|
| log_id | INT (PK) | Unique identifier |
| user_id | INT | User who performed action |
| user_type | ENUM | Admin/Employee/Customer |
| action | VARCHAR(255) | Action description |
| table_name | VARCHAR(50) | Affected table |
| record_id | INT | Affected record |
| timestamp | TIMESTAMP | Action time |
| ip_address | VARCHAR(45) | User IP |
Stores generated reports and analytics.
| Column | Type | Description |
|---|---|---|
| report_id | INT (PK) | Unique identifier |
| report_type | VARCHAR(50) | Report category |
| generated_by | INT (FK) | Creator reference |
| date_from | DATE | Report start date |
| date_to | DATE | Report end date |
| total_bills | INT | Bills in period |
| total_revenue | DECIMAL(15,2) | Revenue amount |
| created_at | TIMESTAMP | Generation timestamp |
Comprehensive overview with revenue tracking, bill statistics, and quick actions
Intuitive interface for meter reading entry and bill generation
User-friendly portal for viewing bills and making payments
Eye-friendly dark theme for extended usage
-
Authentication & Authorization
- Secure session management
- Role-based access control (RBAC)
- Password hashing using PHP's
password_hash()
-
Data Protection
- SQL injection prevention with prepared statements
- XSS protection through input sanitization
- CSRF token implementation
-
Audit Trail
- Complete activity logging
- IP address tracking
- Timestamp recording for all actions
-
Best Practices
- Secure password policies
- Session timeout implementation
- Error handling without information disclosure
- User management (Admin, Employee, Customer)
- Bill generation and management
- Payment processing
- Reporting system
- Activity logging
-
Payment Gateway Integration
- UPI payments (PhonePe, Google Pay, Paytm)
- Credit/Debit card processing
- Net banking
-
Enhanced Reporting
- Interactive charts (Chart.js)
- Advanced analytics dashboard
- Export to multiple formats
-
Notification System
- Email notifications (bill generation, payment reminders)
- SMS alerts
- In-app notifications
-
Mobile Application
- REST API development
- Android app (React Native/Flutter)
- iOS app
-
Advanced Features
- Automated meter reading integration
- Predictive consumption analytics
- Smart billing algorithms
-
Customer Self-Service
- Service request management
- Complaint tracking
- Live chat support
-
Multi-utility Support
- Gas billing
- Internet services
- Other utilities
-
AI Integration
- Consumption pattern prediction
- Fraud detection
- Chatbot support
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
-
Fork the Project
# Click the 'Fork' button on GitHub -
Clone Your Fork
git clone https://github.com/Divyansh3105/Public-Utility-Management-System.git cd public-utility-management-system -
Create a Feature Branch
git checkout -b feature/AmazingFeature
-
Make Your Changes
- Write clean, documented code
- Follow existing code style
- Test thoroughly
-
Commit Your Changes
git add . git commit -m "Add: Amazing new feature"
-
Push to Your Branch
git push origin feature/AmazingFeature
-
Open a Pull Request
- Go to the original repository
- Click "New Pull Request"
- Describe your changes in detail
- Code Style: Follow PSR-12 coding standards for PHP
- Documentation: Update README for new features
- Testing: Ensure all functionality works before submitting
- Commits: Use clear, descriptive commit messages
- Issues: Check existing issues before creating new ones
Found a bug or have a feature suggestion?
- Bug Reports: Open an issue with the "bug" label
- Feature Requests: Open an issue with the "enhancement" label
Please include:
- Clear description
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Screenshots if applicable
- Environment details (OS, browser, PHP version)
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use
- β Modification
- β Distribution
- β Private use
β οΈ Liability and warranty disclaimer
π B.Tech in Computer Science & Engineering π» Full-Stack Developer | Student Innovator π Passionate about building practical solutions
- Icons: Icons8
- Badges: Shields.io
- Inspiration: Real-world utility management challenges
- Testing: Community feedback and beta testers
Need help? Here's how to get support:
- π Documentation: Check this README and code comments
- π¬ Discussions: GitHub Discussions
- π Issues: Report bugs
- π§ Email: divyanshgarg3105@gmail.com



