The Problem

Salon owners need a single web interface to schedule appointments, keep customer records, manage staff rosters and inventory, and generate billing and reports. Existing low‑cost solutions often require manual data entry across separate spreadsheets or proprietary SaaS tools, leading to inconsistent data and wasted admin time.

What This Does

The repository ships a PHP‑based site under the my_salon/ directory. Core pages such as my_salon/index.php, my_salon/login.php, and the admin dashboard my_salon/admin/dashboard.php render HTML, invoke SQL through the shared my_salon/includes/dbconnection.php, and output JSON for AJAX calls in my_salon/admin/js/*.js.

  • Customer‑facing pages (appointment.php, register.php, service-list.php) collect data and persist it via includes/dbconnection.php.
  • Administrative pages (admin/add-services.php, admin/manage-services.php, admin/view-customer-details.php) perform CRUD on the same tables and generate PDF/HTML reports.
  • The mailer in my_salon/includes/mailer/PHPMailer.php is used by my_salon/message.php and my_salon/thank-you.php to send confirmation emails.

All UI styling relies on the bundled Bootstrap and Font‑Awesome assets (admin/css/*.css, admin/js/bootstrap.js).

How It Is Wired

Execution starts at the web server’s document root, typically my_salon/index.php. The script:

  1. Includes includes/header.php → outputs the navigation bar.
  2. Calls includes/dbconnection.php → creates a MySQLi connection ($con = new mysqli(...)).
  3. Routes the request based on $_GET['page'] or form submissions; each branch loads a specific PHP view (e.g., admin/add-services.php).

Inside an admin page, the typical flow is:

require '../includes/dbconnection.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $stmt = $con->prepare('INSERT INTO services (name, price) VALUES (?, ?)');
    $stmt->bind_param('sd', $_POST['name'], $_POST['price']);
    $stmt->execute();
}

The only external side‑effects are MySQL writes and optional email dispatch via PHPMailer. No external APIs or file writes beyond the static assets.

The import graph shows 20 internal modules with zero import edges, meaning each file is self‑contained; there are no shared libraries beyond the database connection and mailer. Consequently, any change to includes/dbconnection.php or includes/mailer/PHPMailer.php has the widest blast radius because every request includes them.

How To Use It

# Clone the exact repository
git clone https://github.com/moses-y/Salon-Management-System
cd Salon-Management-System

# Create the MySQL database and import the schema
mysql -u root -p < my_salon/Database/msmsdb.sql

# Adjust DB credentials in my_salon/includes/dbconnection.php
#   $con = new mysqli('localhost', 'user', 'pass', 'msmsdb');

# Serve the PHP files (example with built‑in server)
php -S localhost:8080 -t my_salon

No Dockerfile, Composer lock, or npm scripts are present, so the above manual steps are the only documented path. Environment variables are not used; credentials are hard‑coded in dbconnection.php.

Real‑World Use

A small salon could host the site on a cheap shared LAMP server. An employee logs in at http://example.com/my_salon/admin/, creates a new service via admin/add-services.php, and the form POST inserts the record directly into the services table. When a customer books through appointment.php, the same connection writes to appointments and triggers an email via mailer/PHPMailer.php.

Code Health & Issues

  • HIGH – License missing – No LICENSE file; default “all rights reserved” blocks reuse.
  • HIGH – No test suite – 78 source files, zero test files; regression risk is high.
  • HIGH – No CI pipeline – No .github/, Jenkinsfile, or similar; builds are never automatically verified.
  • HIGH – Deep nesting – 47 occurrences (e.g., my_salon/about.php, my_salon/admin/add-customer-services.php) with indentation depth up to 8, making logic hard to follow.
  • HIGH – Duplicated code – Repeated 6‑line blocks across 52 files (e.g., header/footer includes).
  • HIGH – Oversized files – includes/mailer/PHPMailer.php, admin/js/Chart.js, admin/js/bootstrap.js each exceed 3 000 lines, increasing maintenance cost.
  • MEDIUM – High branching density – 7 files contain >20 conditional branches in <100 lines, suggesting refactor to strategy tables.

The Bottom Line

The system provides a functional, all‑in‑one PHP front‑end for basic salon management, but the codebase suffers from poor modularity, no automated testing, and missing licensing. It is suitable only for quick internal prototypes or very small shops that can tolerate manual maintenance; larger operations should consider a more modern, test‑driven stack.