Skip to content

samikhan-1800/Student-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Student Management System - Role-Based

A comprehensive role-based student management system with separate dashboards for Admin, Teacher, and Student roles. Built with PHP, MySQL, and Bootstrap 5.

πŸ“‘ Table of Contents


✨ Features Overview

πŸ” Authentication System

  • Email-based login with password verification
  • Role-based signup for teachers and students
  • Pre-created admin account (no signup available)
  • Password hashing with bcrypt (PASSWORD_DEFAULT)
  • Automatic role-based redirects after login
  • Session-based authentication with role verification

πŸ‘¨β€πŸ’Ό Admin Features

  • Dashboard: View statistics (departments, courses, teachers, students count)
  • Department Management: Add/delete departments with duplicate checking
  • Course Management: Add/delete courses linked to departments
  • Course Assignment: Assign courses to teachers (department-based filtering)
  • Cross-Department Offerings: Offer courses from one department to another
  • Teacher Management: View all registered teachers with contact details
  • Student Management: View all registered students in table format

πŸ‘¨β€πŸ« Teacher Features

  • Dashboard: View all assigned courses with quick action buttons
  • My Courses: List of courses assigned by admin
  • Mark Attendance: Select course and date, mark students present/absent
  • Add Marks: Enter marks for quizzes, assignments, mid-term, final exams
  • Edit/Delete Marks: Modify or remove previously entered marks
  • View Students: See list of students enrolled in each course

πŸ‘¨β€πŸŽ“ Student Features

  • Dashboard:
    • 4 stat cards (enrolled courses with 5-limit, present count, absent count, attendance %)
    • Course cards showing course name and teacher name
    • Real-time attendance updates
  • Enroll Courses:
    • Enroll in department courses
    • View cross-department offered courses
    • Maximum 5 courses enrollment limit
    • Unenroll option
  • My Attendance:
    • View attendance records by course
    • Attendance percentage with visual progress bar
    • Warning if attendance < 75%
    • Date-wise attendance tracking
  • My Marks:
    • View marks for all assessment types
    • Progress bars for each mark
    • Overall performance tracking

πŸš€ Quick Setup Guide

Step 1: Database Setup

  1. Open phpMyAdmin in your browser: http://localhost/phpmyadmin/
  2. Click "New" to create a database
  3. Name it: student_system
  4. Select collation: utf8mb4_general_ci
  5. Click "Import" tab
  6. Choose file: database_new.sql
  7. Click "Go" to import
  8. Verify 13 tables are created

Step 2: Configure Database Connection

Open db.php and verify credentials:

<?php
$conn = new mysqli("localhost", "root", "", "student_system");

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
?>

Step 3: Access the System

  1. Start XAMPP Control Panel
  2. Start Apache and MySQL modules
  3. Open browser and visit: http://localhost/student-management-system/
  4. You'll be redirected to the login page

πŸ”‘ Default Admin Credentials

Email: admin@gmail.com
Password: sami12345

Note: Admin credentials are pre-created in the database. Teachers and students must sign up through the signup page.


πŸ“‚ Project Structure

student-management-system/
β”‚
β”œβ”€β”€ admin/                          # Admin Dashboard Pages
β”‚   β”œβ”€β”€ dashboard.php              # Admin home with stats
β”‚   β”œβ”€β”€ departments.php            # Manage departments
β”‚   β”œβ”€β”€ courses.php                # Manage courses
β”‚   β”œβ”€β”€ assign_courses.php         # Assign courses to teachers
β”‚   β”œβ”€β”€ course_offerings.php       # Cross-department offerings
β”‚   β”œβ”€β”€ teachers.php               # View all teachers
β”‚   └── students.php               # View all students
β”‚
β”œβ”€β”€ teacher/                        # Teacher Dashboard Pages
β”‚   β”œβ”€β”€ dashboard.php              # Teacher home with assigned courses
β”‚   β”œβ”€β”€ my_courses.php             # List assigned courses
β”‚   β”œβ”€β”€ mark_attendance.php        # Mark student attendance
β”‚   β”œβ”€β”€ add_marks.php              # Add/edit/delete marks
β”‚   └── view_students.php          # View enrolled students
β”‚
β”œβ”€β”€ student/                        # Student Dashboard Pages
β”‚   β”œβ”€β”€ dashboard.php              # Student home with stats & courses
β”‚   β”œβ”€β”€ enroll_courses.php         # Enroll/unenroll courses (5 max)
β”‚   β”œβ”€β”€ my_attendance.php          # View attendance records
β”‚   └── my_marks.php               # View all marks
β”‚
β”œβ”€β”€ db.php                          # Database connection
β”œβ”€β”€ index.php                       # Entry point (redirects to login)
β”œβ”€β”€ login_new.php                   # Login page with animations
β”œβ”€β”€ signup.php                      # Registration page
β”œβ”€β”€ logout.php                      # Logout handler
└── database_new.sql                # Complete database schema

πŸ—„οΈ Database Schema

Core Tables

Table Description
roles Three roles: admin (id:1), teacher (id:2), student (id:3)
users User authentication (email, password hash, role_id)
user_profiles Common profile data (first/last name, phone, address)
departments Academic departments
courses Course catalog with department association
teachers Teacher-specific data (department, qualifications)
students Student-specific data (enrollment number, department)

Relationship Tables

Table Description
teacher_courses Courses assigned to teachers by admin
enrollments Student course enrollments
attendance Attendance records (date, status: 1=present, 0=absent)
assessment_types Quiz, Assignment, Mid-term, Final (with max_marks)
marks Student marks (obtained_marks, total_marks)
exam_uploads File uploads for exams
course_offerings Cross-department course offerings

Key Columns

attendance table:

  • attendance_date (DATE) - Date of attendance
  • status (TINYINT) - 1 for present, 0 for absent

marks table:

  • obtained_marks (INT) - Marks obtained by student
  • total_marks (INT) - Maximum marks for that assessment

assessment_types table:

  • max_marks (INT) - Default maximum marks for assessment type

πŸ”§ Technology Stack

Category Technology
Backend PHP 8.2.12
Database MySQL (via phpMyAdmin)
Server Apache 2.4.58 on XAMPP
Frontend HTML5, CSS3, JavaScript
CSS Framework Bootstrap 5.3.0
Icons Font Awesome 6.0.0
Fonts Google Fonts (Inter)
Animations AOS (Animate On Scroll)
Security password_hash(), prepared statements

πŸ“‹ User Workflows

🎯 Teacher Workflow

  1. Sign Up

    • Visit signup page
    • Select role: "Teacher"
    • Enter details and department
    • Submit registration
  2. Login

    • Use email and password
    • Auto-redirect to teacher dashboard
  3. View Assigned Courses

    • Admin assigns courses
    • View in "My Courses" page
  4. Mark Attendance

    • Select course and date
    • Mark each student present (1) or absent (0)
    • Submit attendance
  5. Add Marks

    • Select course and assessment type
    • Enter marks for each student
    • Edit or delete marks as needed

🎯 Student Workflow

  1. Sign Up

    • Visit signup page
    • Select role: "Student"
    • Enter enrollment number and department
    • Submit registration
  2. Login

    • Use email and password
    • Auto-redirect to student dashboard
  3. Enroll in Courses

    • View available courses (own + offered from other departments)
    • Click "Enroll" (maximum 5 courses)
    • Unenroll if needed
  4. Check Attendance

    • View attendance by course
    • See percentage and warning if < 75%
    • Track date-wise attendance
  5. View Marks

    • See marks for all assessment types
    • View progress bars
    • Track overall performance

🎯 Admin Workflow

  1. Login

    • Use pre-created credentials
    • Auto-redirect to admin dashboard
  2. Manage Departments

    • Add new departments
    • Delete existing departments
    • Duplicate check enabled
  3. Manage Courses

    • Add courses to departments
    • Delete courses
    • Link to department
  4. Assign Courses

    • Select teacher
    • View only courses from teacher's department
    • Assign course to teacher
  5. Cross-Department Offerings

    • Select course from one department
    • Offer to another department
    • Students can see and enroll
  6. Monitor System

    • View total departments count
    • View total courses count
    • View all teachers
    • View all students

🎨 UI Features

  • Gradient Backgrounds: Purple to blue gradient theme
  • Animated Features: Floating icons on login page with border glow effects
  • AOS Animations: Fade, zoom, slide effects on scroll
  • Responsive Design: Mobile-friendly Bootstrap grid
  • Card-Based Layouts: Clean card designs for data display
  • Progress Bars: Visual attendance and marks representation
  • Color-Coded Stats:
    • Green for present/good performance
    • Red for absent/warnings
    • Blue for neutral information
  • Hover Effects: Interactive buttons and cards
  • Font Awesome Icons: Professional iconography
  • Google Fonts: Inter font family for modern look

πŸ”’ Security Features

Feature Implementation
Password Hashing password_hash() with PASSWORD_DEFAULT
Password Verification password_verify() on login
SQL Injection Protection Prepared statements with bind_param()
Session Management Session-based authentication
Role-Based Access Role checks on every protected page
Input Validation trim() and validation on all inputs
Session Destruction Proper logout with session_destroy()

πŸ› οΈ Troubleshooting

❌ Login Issues

Problem: "Invalid email or password"

Solutions:

  1. Verify database credentials in db.php
  2. Check if student_system database exists
  3. Confirm admin user exists in users table:
    SELECT * FROM users WHERE email = 'admin@gmail.com';
  4. Use exact credentials: admin@gmail.com / sami12345

❌ Database Connection Error

Problem: "Connection failed" message

Solutions:

# Check MySQL is running
Get-Service | Where-Object {$_.DisplayName -like '*MySQL*'}

# If not running, start XAMPP MySQL
# Open XAMPP Control Panel > Start MySQL

# Test connection
mysql -u root -p
USE student_system;
SHOW TABLES;

❌ Page Not Found (404)

Problem: "The requested URL was not found on this server"

Solutions:

  1. Verify files are in: C:\xampp\htdocs\student-management-system\
  2. Check Apache is running in XAMPP Control Panel
  3. Use correct URL: http://localhost/student-management-system/
  4. Check .htaccess if using mod_rewrite

❌ Session Warning

Problem: "session_start(): Session cannot be started after headers"

Solution: This has been fixed. PHP code with session_start() is now at the top of all files before any HTML output.


❌ Column Name Errors

Problem: "Unknown column 'date'" or "Unknown column 'marks_obtained'"

Solution: All fixed. Current column names:

  • attendance.attendance_date (not date)
  • marks.obtained_marks (not marks_obtained)
  • marks.total_marks
  • assessment_types.max_marks

πŸ“ž Support

For Issues:

  1. Check Database: Verify all 13 tables exist in phpMyAdmin
  2. Check Connections: Ensure db.php has correct credentials
  3. Check Logs: C:\xampp\apache\logs\error.log
  4. Test Admin Login: Use default credentials first
  5. Clear Cache: Clear browser cache and try again

System Requirements:

  • PHP: 8.0 or higher
  • MySQL: 5.7 or higher
  • Apache: 2.4 or higher
  • Browser: Modern browser (Chrome, Firefox, Edge)

πŸ“œ License

Created for educational purposes. Feel free to modify and extend for your needs.


πŸ‘¨β€πŸ’» Developer

Developed by Sami Khan


πŸŽ‰ System Status

βœ… Fully Functional - All features tested and working

  • Authentication system βœ“
  • Admin dashboard and features βœ“
  • Teacher dashboard and features βœ“
  • Student dashboard and features βœ“
  • Database schema optimized βœ“
  • UI/UX polished βœ“
  • Security implemented βœ“
  • Cross-department offerings βœ“
  • 5-course enrollment limit βœ“
  • Real-time attendance counters βœ“
  • Department-based filtering βœ“

Last Updated: December 17, 2025

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors