A complete web-based Point of Sale (POS) application built with PHP and MySQL, designed for small-to-medium businesses to manage sales, products, inventory, and customers.
- Admin and Cashier Login: Role-based access control
- Session-based Security: Secure session management
- Password Hashing: Bcrypt encryption for user passwords
- User Management: Admins can create, edit, and manage user accounts
- Invoice-style Interface: Professional sales interface
- Auto Calculation: Automatic totals and change calculation
- Product Selection: Easy product search and quantity selection
- Discount Support: Apply discounts to sales
- Payment Methods: Support for cash and card payments
- Receipt Generation: Print-friendly sales receipts
- Product CRUD: Add, edit, delete products
- Category Management: Organize products by categories
- Stock Management: Track inventory levels
- Low Stock Alerts: Automatic notifications for low stock items
- Stock Thresholds: Configurable low stock warnings
- Customer CRUD: Add, edit, delete customer information
- Purchase History: View complete customer transaction history
- Customer Analytics: Track customer spending patterns
- Sales Reports: Daily, weekly, monthly sales reports
- Date Range Filtering: Customizable report periods
- CSV Export: Export sales data to CSV format
- Visual Charts: Interactive sales charts using Chart.js
- Sales Analytics: Total sales, transactions, discounts, and averages
- Admin: Full access to all features including reports and user management
- Cashier: Limited access to sales, products, and customers
- Backend: PHP 7.4+
- Database: MySQL 5.7+
- Frontend: HTML5, CSS3, JavaScript
- UI Framework: Bootstrap 5.1.3
- Icons: Font Awesome 6.0.0
- Charts: Chart.js
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Web server (Apache/Nginx)
- Modern web browser
- Clone or Download the project to your web server directory
- Configure Database:
- Create a MySQL database named
smartpos - Update database credentials in
config/database.phpif needed
- Create a MySQL database named
- Set Permissions:
- Ensure web server has read/write permissions
- Access the Application:
- Navigate to
http://your-domain/smartpos/ - Login with default admin credentials
- Navigate to
admin
-
Username:
admin -
Password:
admin123create your Own Cashiers like on below | -------------------------------------------------- | Cashier1 | | - Username:
Cashier| | - Password:123456789| | -------------------------------------------------- | Cashier2 | | - Username:abdi| | - Password:1234567890| | --------------------------------------------------
smartpos/
βββ config/
β βββ database.php # Database configuration
βββ includes/
β βββ functions.php # Utility functions
β βββ header.php # Header template
β βββ footer.php # Footer template
βββ pages/
β βββ dashboard.php # Dashboard page
β βββ sales.php # Sales management
β βββ products.php # Product management
β βββ customers.php # Customer management
β βββ reports.php # Sales reports
β βββ users.php # User management
βββ index.php # Main application entry
βββ login.php # Login page
βββ logout.php # Logout script
βββ README.md # This file
The application automatically creates the following tables:
- users: User accounts and authentication
- categories: Product categories
- products: Product inventory
- customers: Customer information
- sales: Sales transactions
- sale_items: Individual sale line items
- New Sale: Click "New Sale" from dashboard
- Add Products: Select products and quantities
- Apply Discounts: Optional discount application
- Complete Sale: Choose payment method and finalize
- Print Receipt: Generate and print sales receipt
- Add Products: Create new products with categories
- Stock Tracking: Monitor inventory levels
- Low Stock Alerts: Automatic warnings for low stock
- Stock Updates: Automatic stock reduction on sales
- Customer Profiles: Store customer information
- Purchase History: Track all customer transactions
- Customer Analytics: View spending patterns
- Sales Reports: Filter by date ranges
- Export Data: Download reports as CSV
- Visual Analytics: Interactive charts and graphs
- Summary Statistics: Key performance indicators
- Password Hashing: Bcrypt encryption
- Session Management: Secure session handling
- SQL Injection Prevention: Prepared statements
- XSS Protection: Input sanitization
- Role-based Access: Admin/Cashier permissions
- Responsive Design: Works on desktop and mobile
- Modern UI: Clean, professional interface
- Intuitive Navigation: Easy-to-use menu system
- Real-time Updates: Dynamic calculations and updates
- Streamlined Sales: Faster transaction processing
- Inventory Control: Better stock management
- Customer Insights: Track customer behavior
- Financial Reporting: Comprehensive sales analytics
- Multi-user Support: Multiple cashiers and admins
The application is designed to be easily customizable:
- Styling: Modify CSS in header.php
- Features: Add new functionality to existing pages
- Database: Extend database schema for additional features
- Reports: Create custom report templates
-
Database Connection Error:
- Check database credentials in
config/database.php - Ensure MySQL service is running
- Check database credentials in
-
Permission Errors:
- Ensure web server has read/write permissions
- Check file ownership
-
Login Issues:
- Verify default credentials: admin/admin123
- Check session configuration
For issues or questions:
- Check the error logs
- Verify database connectivity
- Ensure all requirements are met
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
SmartPOS - Empowering businesses with efficient point of sale management.