A comprehensive PHP-based office management system that handles various business operations including employee management, inventory tracking, sales management, payroll processing, and attendance monitoring. Built with a custom MVC framework and designed for Indonesian businesses.
- π₯ Employee Management: Complete employee lifecycle management with NIP (Employee ID) system
- π¦ Inventory Management: Stock tracking, item management, and movement monitoring
- π° Sales Management: Transaction handling, customer management, and sales target tracking
- πΌ Payroll System: Automated payroll calculation with configurable settings
- β° Attendance Tracking: Check-in/check-out system with comprehensive reporting
- π User Access Control: Granular permission management for different user roles
- π Reporting System: Comprehensive reports for all modules with export capabilities
- Dual Authentication: Separate admin and employee login systems
- CSRF Protection: Built-in security measures
- Responsive Design: Mobile-friendly interface
- Multi-language Support: Indonesian language interface
- Export Functionality: PDF and Excel export capabilities
- Real-time Updates: Dynamic data updates without page refresh
- Backend: PHP 8.0+ with custom MVC framework
- Database: SQLite (default) / MySQL support
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Architecture: Custom MVC pattern with PSR-4 autoloading
- Security: Password hashing, CSRF tokens, input validation
- Timezone: Asia/Jakarta (Indonesian timezone)
- PHP 8.0 or higher
- Web server (Apache/Nginx) or PHP built-in server
- SQLite extension (default) or MySQL/MariaDB
- Composer (optional, for dependency management)
-
Clone the repository:
git clone https://github.com/yourusername/office-management-system.git cd office-management-system -
Set up the web server:
- Option A: Use PHP built-in server
php -S localhost:8000 -t public/
- Option B: Use XAMPP/WAMP
- Copy project to
htdocsfolder - Access via
http://localhost/office-management-system/public/
- Copy project to
- Option A: Use PHP built-in server
-
Configure the application:
- Update
config/config.phpif needed (default settings work for most cases) - Ensure
storage/directory is writable
- Update
-
Access the application:
- Open your browser and navigate to the application URL
- Default admin credentials:
admin@local/admin123 - Default employee credentials:
karyawan@local/karyawan123
The system automatically creates the database and tables on first run. You can configure the database in config/config.php:
'db' => [
'driver' => 'sqlite', // or 'mysql'
'host' => 'localhost', // MySQL only
'port' => '3306', // MySQL only
'database' => 'storage/database.sqlite', // SQLite path or MySQL db name
'username' => 'root', // MySQL only
'password' => '', // MySQL only
'charset' => 'utf8mb4', // MySQL only
],office_management_system/
βββ config/
β βββ config.php # Application configuration
βββ public/
β βββ index.php # Application entry point
β βββ .htaccess # URL rewriting rules
βββ src/
β βββ Controllers/ # MVC Controllers
β β βββ AuthController.php
β β βββ EmployeesController.php
β β βββ InventoryController.php
β β βββ SalesController.php
β β βββ PayrollController.php
β β βββ ...
β βββ Core/ # Core framework files
β β βββ Router.php # Custom routing system
β β βββ DB.php # Database abstraction layer
β β βββ Auth.php # Authentication system
β β βββ ...
β βββ Models/ # MVC Models
β β βββ Employee.php
β β βββ Item.php
β β βββ SalesTransaction.php
β β βββ ...
β βββ Views/ # MVC Views
β βββ layout.php # Main layout template
β βββ auth/ # Authentication views
β βββ employees/ # Employee management views
β βββ inventory/ # Inventory management views
β βββ ...
βββ storage/
β βββ database.sqlite # SQLite database file
βββ composer.json # Composer configuration
βββ .gitignore # Git ignore rules
βββ README.md # This file
- Login: Use the default credentials or create new users
- Navigation: Use the sidebar menu to access different modules
- Dashboard: View system overview and quick actions
- Add new employees with NIP (Employee ID)
- Manage employee information (department, position, contact)
- Set employee login credentials
- View employee list with search and filter
- Check-in/check-out functionality
- View attendance history
- Generate attendance reports
- Track working hours automatically
- Add/edit inventory items
- Stock in/out operations
- Category management
- Low stock alerts
- Inventory reports
- Customer management
- Sales transaction recording
- Sales target setting
- Sales analysis and reporting
- Configure payroll settings
- Calculate employee salaries
- Generate payroll reports
- Bulk payroll processing
- Admin: Full access to all modules
- Employee: Limited access to attendance and profile
The system provides RESTful API endpoints for various operations:
POST /login- User loginPOST /logout- User logout
GET /employees- List employeesPOST /employees/store- Create employeeGET /employees/edit- Edit employee formPOST /employees/update- Update employeePOST /employees/destroy- Delete employee
GET /inventory- List inventory itemsPOST /inventory/store-item- Create inventory itemPOST /inventory/store-stock-in- Stock in operationPOST /inventory/store-stock-out- Stock out operation
GET /sales/customers- List customersPOST /sales/customers/store- Create customerGET /sales/transactions- List transactionsPOST /sales/transactions/store- Create transaction
- Password Hashing: All passwords are securely hashed using PHP's
password_hash() - CSRF Protection: All forms include CSRF tokens
- Input Validation: Server-side validation for all inputs
- SQL Injection Prevention: Prepared statements for all database queries
- Session Management: Secure session handling
- Access Control: Role-based access control system
users- System administratorsemployees- Employee recordsattendance- Attendance trackinguser_access- Permission management
items- Inventory itemscategories- Item categoriesstock_movements- Stock transactionscustomers- Customer recordssales_transactions- Sales recordssales_targets- Sales targetspayroll- Payroll records
-
Server Requirements:
- PHP 8.0+
- Web server (Apache/Nginx)
- SSL certificate (recommended)
-
Configuration:
- Update
config/config.phpfor production settings - Set proper file permissions
- Configure web server virtual host
- Update
-
Security:
- Change default passwords
- Enable HTTPS
- Configure firewall rules
- Regular backups
FROM php:8.0-apache
COPY . /var/www/html/
RUN chown -R www-data:www-data /var/www/html/storage
EXPOSE 80We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Test your changes thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow PSR-4 autoloading standards
- Write clean, documented code
- Test all new features
- Update documentation as needed
- Follow the existing code style
-
Database Connection Error
- Check database configuration in
config/config.php - Ensure database file permissions are correct
- Verify SQLite extension is enabled
- Check database configuration in
-
Permission Denied
- Ensure
storage/directory is writable - Check file ownership and permissions
- Ensure
-
404 Errors
- Verify
.htaccessfile is present - Check web server URL rewriting configuration
- Verify
-
Login Issues
- Use default credentials:
admin@local/admin123 - Check if user exists in database
- Verify password hashing
- Use default credentials:
- Initial release
- Complete office management system
- All core modules implemented
- User authentication and authorization
- Comprehensive reporting system
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check this README and inline code comments
- Issues: Report bugs via GitHub Issues
- Discussions: Use GitHub Discussions for questions
- Email: Contact the maintainers for support
- Built with PHP and modern web technologies
- Inspired by Indonesian business management needs
- Thanks to all contributors and users
Made with β€οΈ for Indonesian businesses