Categories: Php Project
Tags:

Download the Admin Template from here

https://startbootstrap.com/template/sb-admin

Create the Database for part 1 using following sql commands:

CREATE DATABASE school_management;
USE school_management;

-- Institute Master Table
CREATE TABLE institutemaster (
    instituteid INT AUTO_INCREMENT PRIMARY KEY,
    institutename VARCHAR(255) NOT NULL,
    instituteemail VARCHAR(255) UNIQUE NOT NULL,
    institutepassword VARCHAR(255) NOT NULL,
    isactive BOOLEAN DEFAULT 1,
    createdon TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Department Master Table
CREATE TABLE departmentmaster (
    departmentid INT AUTO_INCREMENT PRIMARY KEY,
    departmentname VARCHAR(255) NOT NULL,
    instituteid INT NOT NULL,
    isactive BOOLEAN DEFAULT 1,
    createdon TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (instituteid) REFERENCES institutemaster(instituteid) ON DELETE CASCADE
);

-- Staff Type Table
CREATE TABLE stafftype (
    stafftypeid INT AUTO_INCREMENT PRIMARY KEY,
    stafftypename VARCHAR(255) NOT NULL,
    instituteid INT NOT NULL,
    departmentid INT NOT NULL,
    isactive BOOLEAN DEFAULT 1,
    createdon TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (instituteid) REFERENCES institutemaster(instituteid) ON DELETE CASCADE,
    FOREIGN KEY (departmentid) REFERENCES departmentmaster(departmentid) ON DELETE CASCADE
);

-- Staff Table
CREATE TABLE staff (
    staffid INT AUTO_INCREMENT PRIMARY KEY,
    staffname VARCHAR(255) NOT NULL,
    stafftype INT NOT NULL,
    staffemail VARCHAR(255) UNIQUE NOT NULL,
    staffpassword VARCHAR(255) NOT NULL,
    instituteid INT NOT NULL,
    departmentid INT NOT NULL,
    isactive BOOLEAN DEFAULT 1,
    createdon TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (stafftype) REFERENCES stafftype(stafftypeid) ON DELETE CASCADE,
    FOREIGN KEY (instituteid) REFERENCES institutemaster(instituteid) ON DELETE CASCADE,
    FOREIGN KEY (departmentid) REFERENCES departmentmaster(departmentid) ON DELETE CASCADE
);

-- Create a PHP CRUD system for managing the institutemaster

-- View all institutes (index.php)
-- Add a new institute (add.php)
-- Edit an institute (edit.php)
-- Delete an institute (delete.php)

Folder structure