Skip to content

tama027/office_management_system

Repository files navigation

Office Management System (SIM Kantor)

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.

πŸš€ Features

Core Modules

  • πŸ‘₯ 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

Advanced Features

  • 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

πŸ›  Technology Stack

  • 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)

πŸ“‹ Requirements

  • 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)

πŸš€ Installation

Quick Start

  1. Clone the repository:

    git clone https://github.com/yourusername/office-management-system.git
    cd office-management-system
  2. 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 htdocs folder
      • Access via http://localhost/office-management-system/public/
  3. Configure the application:

    • Update config/config.php if needed (default settings work for most cases)
    • Ensure storage/ directory is writable
  4. Access the application:

    • Open your browser and navigate to the application URL
    • Default admin credentials: admin@local / admin123
    • Default employee credentials: karyawan@local / karyawan123

Database Configuration

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
],

πŸ“ Project Structure

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

🎯 Usage Guide

Getting Started

  1. Login: Use the default credentials or create new users
  2. Navigation: Use the sidebar menu to access different modules
  3. Dashboard: View system overview and quick actions

Module Overview

Employee Management

  • Add new employees with NIP (Employee ID)
  • Manage employee information (department, position, contact)
  • Set employee login credentials
  • View employee list with search and filter

Attendance System

  • Check-in/check-out functionality
  • View attendance history
  • Generate attendance reports
  • Track working hours automatically

Inventory Management

  • Add/edit inventory items
  • Stock in/out operations
  • Category management
  • Low stock alerts
  • Inventory reports

Sales Management

  • Customer management
  • Sales transaction recording
  • Sales target setting
  • Sales analysis and reporting

Payroll System

  • Configure payroll settings
  • Calculate employee salaries
  • Generate payroll reports
  • Bulk payroll processing

User Roles

  • Admin: Full access to all modules
  • Employee: Limited access to attendance and profile

πŸ”§ API Endpoints

The system provides RESTful API endpoints for various operations:

Authentication

  • POST /login - User login
  • POST /logout - User logout

Employee Management

  • GET /employees - List employees
  • POST /employees/store - Create employee
  • GET /employees/edit - Edit employee form
  • POST /employees/update - Update employee
  • POST /employees/destroy - Delete employee

Inventory Management

  • GET /inventory - List inventory items
  • POST /inventory/store-item - Create inventory item
  • POST /inventory/store-stock-in - Stock in operation
  • POST /inventory/store-stock-out - Stock out operation

Sales Management

  • GET /sales/customers - List customers
  • POST /sales/customers/store - Create customer
  • GET /sales/transactions - List transactions
  • POST /sales/transactions/store - Create transaction

πŸ›‘ Security Features

  • 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

πŸ“Š Database Schema

Core Tables

  • users - System administrators
  • employees - Employee records
  • attendance - Attendance tracking
  • user_access - Permission management

Business Tables

  • items - Inventory items
  • categories - Item categories
  • stock_movements - Stock transactions
  • customers - Customer records
  • sales_transactions - Sales records
  • sales_targets - Sales targets
  • payroll - Payroll records

πŸš€ Deployment

Production Deployment

  1. Server Requirements:

    • PHP 8.0+
    • Web server (Apache/Nginx)
    • SSL certificate (recommended)
  2. Configuration:

    • Update config/config.php for production settings
    • Set proper file permissions
    • Configure web server virtual host
  3. Security:

    • Change default passwords
    • Enable HTTPS
    • Configure firewall rules
    • Regular backups

Docker Deployment (Optional)

FROM php:8.0-apache
COPY . /var/www/html/
RUN chown -R www-data:www-data /var/www/html/storage
EXPOSE 80

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Test your changes thoroughly
  5. Commit your changes:
    git commit -m 'Add amazing feature'
  6. Push to the branch:
    git push origin feature/amazing-feature
  7. Open a Pull Request

Development Guidelines

  • Follow PSR-4 autoloading standards
  • Write clean, documented code
  • Test all new features
  • Update documentation as needed
  • Follow the existing code style

πŸ› Troubleshooting

Common Issues

  1. Database Connection Error

    • Check database configuration in config/config.php
    • Ensure database file permissions are correct
    • Verify SQLite extension is enabled
  2. Permission Denied

    • Ensure storage/ directory is writable
    • Check file ownership and permissions
  3. 404 Errors

    • Verify .htaccess file is present
    • Check web server URL rewriting configuration
  4. Login Issues

    • Use default credentials: admin@local / admin123
    • Check if user exists in database
    • Verify password hashing

πŸ“ Changelog

Version 1.0.0

  • Initial release
  • Complete office management system
  • All core modules implemented
  • User authentication and authorization
  • Comprehensive reporting system

πŸ“„ License

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

πŸ‘₯ Support

  • 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

πŸ™ Acknowledgments

  • Built with PHP and modern web technologies
  • Inspired by Indonesian business management needs
  • Thanks to all contributors and users

Made with ❀️ for Indonesian businesses

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages