This guide will help you set up and run the Incentive Tracking System from scratch. Follow the steps carefully.
🚀 1. Setup Instructions
1️⃣ Install a Local Server
Ensure you have a local server environment like:
XAMPP (Windows, macOS)
MAMP (macOS)
WAMP (Windows)
Laragon (Windows)
2️⃣ Database Setup
Open phpMyAdmin or any MySQL client.
Create a new database:
CREATE DATABASE incentive_tracking;
Select the database:
USE incentive_tracking;
3️⃣ Create Tables
🔹 Users Table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
role ENUM('team_member', 'sales_executive', 'manager', 'boss') NOT NULL,
incentive_points INT DEFAULT 0
);
🔹 Projects Table
CREATE TABLE projects (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
status ENUM('Project Started', 'Submitted for Approval', 'Changes Given by Client', 'Approved', 'Payment Received') NOT NULL DEFAULT 'Project Started',
assigned_to INT NOT NULL,
payment_status ENUM('Pending', 'Completed') DEFAULT 'Pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (assigned_to) REFERENCES users(id) ON DELETE CASCADE
);
🔹 Points Table (For Overwriting)
CREATE TABLE points (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
points INT NOT NULL,
updated_by INT NOT NULL,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (updated_by) REFERENCES users(id) ON DELETE CASCADE
);
4️⃣ Setup the Project
Copy all files to htdocs/incentive_tracking/ (if using XAMPP).
Open db_config.php and update database details:
Start Apache & MySQL in XAMPP.
Open a browser and go to:
http://localhost/incentive_tracking/
First-Time Setup:
The first user who signs up will automatically be assigned the Boss role. After logging in, the Boss can add new users.