Skip to content

A complete PHP-MySQL based web application designed to streamline billing, payments, and data management for public utilities such as electricity and water services.

License

Notifications You must be signed in to change notification settings

Divyansh3105/Public-Utility-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

Public Utility Management System

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


PHP MySQL HTML5 CSS3 JavaScript License Status


πŸ“‹ Table of Contents


🎬 Demo

Live Demo

πŸš€ Try it now: Live Demo Link

Quick Demo Setup

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-system

Demo Credentials

Test 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.

Demo Features to Try

As Admin:

  1. βœ… View dashboard with real-time statistics
  2. βœ… Add new employee account
  3. βœ… Generate monthly revenue report
  4. βœ… Update electricity/water rates
  5. βœ… View activity logs

As Employee:

  1. βœ… Generate a new electricity bill
  2. βœ… Process customer payment
  3. βœ… Search customer records
  4. βœ… View payment history
  5. βœ… Generate daily report

As Customer:

  1. βœ… View current bills
  2. βœ… Make online payment
  3. βœ… Download bill PDF
  4. βœ… Check payment history
  5. βœ… Update profile information

Sample Data Included

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

πŸ“– About The Project

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.

🎯 Problem Statement

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

βœ… Solution

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

✨ Features

πŸ‘‘ Admin Dashboard

  • 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

πŸ‘· Employee Dashboard

  • 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

πŸ‘€ Customer Portal

  • 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

πŸ› οΈ Tech Stack

Frontend

  • 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

Backend

  • PHP 8.0+ - Server-side logic
    • Object-oriented programming
    • Secure session management
    • Database abstraction layer

Database

  • MySQL 10.4+ - Relational database
    • Normalized schema design
    • Optimized queries with indexing
    • Transaction support

Server Environment

  • Apache - Web server
  • XAMPP/LAMP/WAMP - Development stack

βš™οΈ Installation

Prerequisites

Before you begin, ensure you have the following installed:

Step-by-Step Installation

  1. Clone the Repository

    git clone https://github.com/Divyansh3105/Public-Utility-Management-System.git
    cd public-utility-management-system
  2. 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/
  3. Database Setup

    a. Open phpMyAdmin

    http://localhost/phpmyadmin
    

    b. Create a new database

    CREATE DATABASE public_utility_system;

    c. Import the SQL file

    • Click on the public_utility_system database
    • Navigate to the "Import" tab
    • Choose the file public_utility_system.sql
    • Click "Go" to execute
  4. Configure Database Connection

    Edit db_connect.php if needed:

    <?php
    $host = 'localhost';
    $dbname = 'public_utility_system';
    $username = 'root';
    $password = ''; // Your MySQL password
    ?>
  5. Start the Server

    • Open XAMPP Control Panel
    • Start Apache and MySQL services
    • Ensure both are running (green indicators)
  6. Access the Application

    http://localhost/public-utility-management-system
    

Default Login Credentials

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.


πŸ’» Usage

For Administrators

  1. Login to the admin dashboard
  2. Manage Users - Add/edit employees and customers
  3. Monitor Operations - View real-time statistics
  4. Generate Reports - Access comprehensive analytics
  5. Configure System - Update rates and settings

For Employees

  1. Login to the employee dashboard
  2. Generate Bills - Enter meter readings and create bills
  3. Process Payments - Verify and update payment records
  4. Customer Support - Access customer information
  5. Reports - View performance metrics

For Customers

  1. Login to the customer portal
  2. View Bills - Check current and past bills
  3. Make Payments - Pay bills online or record cash payments
  4. Download Documents - Get PDF bills and receipts
  5. Track History - Monitor payment and billing history

πŸ—‚οΈ Project Structure

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

πŸ—„οΈ Database Schema

Core Tables

admin

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
email VARCHAR(100) Contact email
created_at TIMESTAMP Account creation date

employee

Manages employee information and authentication.

Column Type Description
employee_id INT (PK) Unique identifier
name VARCHAR(100) Full name
email 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

customer

Stores customer profiles and service connections.

Column Type Description
customer_id INT (PK) Unique identifier
name VARCHAR(100) Full name
email 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

electric_bill

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

water_bill

Manages water billing information (similar structure to electric_bill).

payment

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

activity_log

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

report_data

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

πŸ–ΌοΈ Screenshots

Admin Dashboard

Admin Dashboard

Comprehensive overview with revenue tracking, bill statistics, and quick actions

Admin Dashboard

Billing Interface

Intuitive interface for meter reading entry and bill generation

Customer Portal

Customer Portal

User-friendly portal for viewing bills and making payments

Dark Mode

Dark Mode

Eye-friendly dark theme for extended usage


πŸ” Security Features

  • 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

πŸš€ Roadmap

Phase 1 - Current Features βœ…

  • User management (Admin, Employee, Customer)
  • Bill generation and management
  • Payment processing
  • Reporting system
  • Activity logging

Phase 2 - Short Term 🎯

  • 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

Phase 3 - Medium Term πŸ“±

  • 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

Phase 4 - Long Term 🌐

  • Multi-utility Support

    • Gas billing
    • Internet services
    • Other utilities
  • AI Integration

    • Consumption pattern prediction
    • Fraud detection
    • Chatbot support

🀝 Contributing

Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

How to Contribute

  1. Fork the Project

    # Click the 'Fork' button on GitHub
  2. Clone Your Fork

    git clone https://github.com/Divyansh3105/Public-Utility-Management-System.git
    cd public-utility-management-system
  3. Create a Feature Branch

    git checkout -b feature/AmazingFeature
  4. Make Your Changes

    • Write clean, documented code
    • Follow existing code style
    • Test thoroughly
  5. Commit Your Changes

    git add .
    git commit -m "Add: Amazing new feature"
  6. Push to Your Branch

    git push origin feature/AmazingFeature
  7. Open a Pull Request

    • Go to the original repository
    • Click "New Pull Request"
    • Describe your changes in detail

Contribution Guidelines

  • 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

πŸ› Bug Reports & Feature Requests

Found a bug or have a feature suggestion?

Please include:

  • Clear description
  • Steps to reproduce (for bugs)
  • Expected vs actual behavior
  • Screenshots if applicable
  • Environment details (OS, browser, PHP version)

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License Summary

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Private use
  • ⚠️ Liability and warranty disclaimer

πŸ‘€ Author

Divyansh

πŸŽ“ B.Tech in Computer Science & Engineering πŸ’» Full-Stack Developer | Student Innovator 🌟 Passionate about building practical solutions

Email GitHub LinkedIn


πŸ™ Acknowledgments

  • Icons: Icons8
  • Badges: Shields.io
  • Inspiration: Real-world utility management challenges
  • Testing: Community feedback and beta testers

πŸ“ž Support

Need help? Here's how to get support:


⭐ If this project helped you, please give it a star! ⭐


"Digitizing utility management for a smarter, more efficient future."


Made with ❀️ by Divyansh

Visitors