PHP Pharmacy Management Design
PHP Pharmacy Management Design
localhost. The system should be developed using HTML, CSS, PHP, MySQL, and
1. LOGIN PAGE
The system should have a login page where users can enter their username and password.
A 'Forgot Password' link that redirects users to a page for resetting their password.
The system should authenticate users by checking the credentials from a MySQL database.
There should be role-based access control, meaning the system must recognize whether the user
is a Super Admin, Admin, or Pharmacist after login and redirect them to their respective
dashboards.
2. USER ROLES
Super Admin: Has full control over all system settings, user management, and can view and
Admin: Manages one or more pharmacies, their inventory, and can add users under their
assigned pharmacy.
Pharmacist: Can manage the inventory and prescriptions within their assigned pharmacy.
After logging in, the Super Admin should be able to access a dashboard that includes:
User Management: View all users, add new users (Admins and Pharmacists), edit user details,
Pharmacy Management: Add new pharmacies, edit pharmacy details, and assign pharmacies to
Admins.
Sales Reports: Ability to generate sales reports across all pharmacies with filters by date,
System Settings: Control over various system settings like changing the database connection or
Pharmacy Overview: Admins should be able to see an overview of the pharmacies they
Inventory Management: Admins can add, edit, and delete medicines. This includes:
Adding new medicine details such as name, batch number, expiry date, quantity, and price.
Sales Management: Admins should be able to track sales, view receipts, and generate reports
5. PHARMACIST DASHBOARD
Sell Medicines: Record sales by selecting medicines from the inventory and generating a receipt
for customers.
Manage Prescriptions: View and manage customer prescriptions. Option to mark medicines as
6. INVENTORY SYSTEM
Adding New Medicines: Including name, quantity, expiry date, and purchase price.
Batch Management: Manage medicines by batches (e.g., batch number and expiry).
Search and Filter: Search inventory by name, batch number, or expiration date, and filter based
Real-Time Stock Updates: Whenever a sale is made or new stock is added, the system should
Sales Management: Pharmacists can sell medicines by selecting items from the inventory and
prescriptions and log information about which medicines were dispensed for which prescription.
Sales Reports: Generate daily, weekly, or monthly sales reports for each pharmacy with the
Users: For storing user details like username, password (hashed), role (Super Admin, Admin,
Pharmacies: Details of each pharmacy, including name, location, and contact information.
Medicines: Store medicine information, including name, batch number, expiry date, quantity,
and price.
Sales: Logs sales transactions, including date, user who processed the sale, medicines sold, and
total amount.
9. Security
Passwords should be stored in the database using a secure hashing algorithm (e.g., bcrypt).
The system should implement session management to track logged-in users and prevent
unauthorized access.
Admin pages should be protected, and only authorized users should have access based on their
role.
Input validation and sanitization should be in place to protect against SQL injection and XSS
attacks.
The frontend should use HTML and CSS for structure and styling, while JavaScript will
The backend should use PHP to handle server-side logic, including user authentication, inventory
AJAX (Asynchronous JavaScript and XML) should be used to allow for real-time updates to
The system should be designed to run locally using the XAMPP server.
All database operations should connect to a MySQL database hosted locally on XAMPP.
Instructions should be provided on how to configure the php.ini and httpd.conf files if needed to
Search Functionality: A global search bar that allows users to search for medicines,
Notifications System: Notifications for low stock, expired medicine, or upcoming expiry within
30 days.
Backup/Restore Functionality: The ability to back up the database and restore it from a file.
Based on the above requirements, please provide me with the code architecture, folder structure,