Skip to content

ertancurr1/product-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Product Management System

A PHP OOP learning project demonstrating:

  • Abstract classes and inheritance
  • Polymorphism (no if-else for product types)
  • PSR-4 autoloading
  • PDO database operations
  • MVC-like architecture

Tech Stack

  • PHP 8.2
  • MySQL/MariaDB
  • HTML/CSS/JavaScript (Vanilla)

Product Types

Type Special Attribute
DVD Size (MB)
Book Weight (KG)
Furniture Dimensions (HxWxL cm)

Project Structure

product-management/
├── public/
│   └── index.php          # Entry point & router
├── src/
│   ├── Database/          # Database connection (Singleton)
│   ├── Model/             # Product classes (Abstract + Inheritance)
│   ├── Repository/        # Database operations
│   └── View/              # HTML templates
├── config/                # Configuration files
├── css/                   # Stylesheets
├── js/                    # JavaScript
└── database/              # SQL schema

Setup

Prerequisites

  • PHP 7.4+ (8.0+ recommended)
  • MySQL 5.7+ or MariaDB
  • Composer
  • Apache with mod_rewrite

Installation

  1. Clone the repository
git clone https://github.com/ertancurr1/product-management.git
cd product-management
  1. Install dependencies
composer install
  1. Create database and import schema
mysql -u root -p < database/schema.sql

Or import database/schema.sql via phpMyAdmin.

  1. Configure database connection

Edit config/database.php with your credentials:

return [
    'host' => 'localhost',
    'dbname' => 'product_management',
    'username' => 'root',
    'password' => '',
    'charset' => 'utf8mb4'
];
  1. Start your web server and visit:
http://localhost/product-management/public/

Features

  • ✅ Add products (DVD, Book, Furniture)
  • ✅ View all products in grid layout
  • ✅ Mass delete with checkboxes
  • ✅ Form validation (client + server side)
  • ✅ Dynamic type-specific fields
  • ✅ SKU uniqueness validation

OOP Concepts Demonstrated

Concept Implementation
Abstract Class Product base class
Inheritance DVD, Book, Furniture extend Product
Polymorphism getSpecificAttribute() method
Encapsulation Private properties with getters/setters
Singleton Database connection class

Author

Ertan Curri

License

This project is open source and available for learning purposes.

About

PHP OOP learning project - Product Management System

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors