0% found this document useful (0 votes)
16 views46 pages

FULL

The Time Table Generator System is a web-based application developed using PHP and MySQL to automate academic timetable scheduling for educational institutions. It aims to eliminate manual errors and inefficiencies by providing a centralized admin interface for managing classes, subjects, teachers, and time slots, ensuring conflict-free scheduling. The system enhances administrative efficiency and resource utilization while offering a user-friendly design compatible with major web browsers.

Uploaded by

darunraj365
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views46 pages

FULL

The Time Table Generator System is a web-based application developed using PHP and MySQL to automate academic timetable scheduling for educational institutions. It aims to eliminate manual errors and inefficiencies by providing a centralized admin interface for managing classes, subjects, teachers, and time slots, ensuring conflict-free scheduling. The system enhances administrative efficiency and resource utilization while offering a user-friendly design compatible with major web browsers.

Uploaded by

darunraj365
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Abstract:

The Time Table Generator System is a web-based application designed to automate the complex and error-prone

process of academic timetable scheduling. Developed using PHP and MySQL, this system is tailored for educational

institutions such as schools, colleges, and universities. The primary goal of the project is to simplify and streamline the task

of managing class schedules, thereby reducing manual effort and ensuring efficient resource utilization.

Traditionally, timetable generation is done manually, often resulting in conflicts, overlaps, and inefficient allocation of

classrooms and teachers. This project addresses those issues by offering an automated, flexible, and user-friendly interface

that ensures accurate and optimized scheduling. Through a centralized admin module, the system allows administrators to

manage key components such as classes, subjects, teachers, classrooms, and time slots.

The admin can dynamically generate timetables based on subject-teacher-classroom allocations while ensuring there

are no conflicts or duplicate assignments. The dashboard provides a quick overview of all critical data including the total

number of classes, teachers, subjects, and available time slots. Additionally, features like profile management, password

change, and recovery are implemented to enhance system usability and security—with MD5 encryption used for password

protection.

By automating timetable creation, this system not only saves valuable administrative time but also improves the overall

academic planning process, leading to better coordination between faculty and students. With its intuitive design built using

HTML, JavaScript, AJAX, and jQuery, and compatibility across major web browsers, the Time Table Generator System

proves to be a reliable and scalable solution for modern educational institutions.

1
Introduction

In educational institutions, managing and scheduling class timetables is a critical but complex task. Traditionally, this

process is carried out manually by academic coordinators or administrative staff, which is not only time-consuming but also

susceptible to human error. Manual scheduling often leads to clashes in timing, improper resource utilization, and

inconsistencies in class arrangements, which in turn disrupt the academic workflow and affect both teachers and students.

To address these challenges, the Time Table Generator System is developed as a web-based application using PHP

and MySQL. The system is designed to automate the timetable creation process by efficiently allocating available resources

such as classrooms, teachers, and time slots. It aims to eliminate the drawbacks of manual scheduling and replace it with a

smart, accurate, and dynamic system that can be managed through an intuitive web interface.

The system provides a centralized admin panel from which administrators can manage all essential data—classes,

subjects, teachers, classrooms, and time slots—and generate timetables without conflicts or overlaps. With a few simple

inputs, the system automatically arranges classes based on the provided constraints and preferences. It also offers flexibility

in modifying or updating schedules as required.

The application utilizes a combination of HTML, JavaScript, AJAX, and jQuery for the front-end interface, ensuring

responsiveness and interactivity, while PHP and MySQL power the back-end for efficient data processing and storage. The

platform is compatible with major browsers such as Google Chrome, Mozilla Firefox, Internet Explorer, and others, and

runs smoothly on local servers using XAMPP, WAMP, MAMP, or LAMP.

Overall, the Time Table Generator System not only reduces administrative workload but also improves the quality

and consistency of academic scheduling, making it a valuable tool for modern educational institutions.

2
1.1 Existing System

In most educational institutions, the process of timetable creation is carried out manually by administrative staff or

department heads. This traditional approach involves preparing schedules using spreadsheets or even on paper, taking into

account various factors such as teacher availability, subject distribution, classroom capacity, and student groupings.

However, the manual system has several limitations:

• -Consuming: Creating and updating timetables manually can take several hours or even days.

• Error-Prone: Manual scheduling often results in conflicts such as overlapping classes or double-

booking of teachers or rooms.

• Lack of Flexibility: Making adjustments or updates in the timetable requires repeating the entire process,

which is inefficient.

• Poor Resource Utilization: It is difficult to optimally use available resources like classrooms and

teachers without a systematic approach.

• No Centralized Access: Teachers and students have no centralized or digital way to access the final

timetable.

1.2Proposed System:

The proposed Time Table Generator System is a fully automated web-based solution developed using PHP and

MySQL that eliminates the drawbacks of the traditional method. The system provides an intuitive interface for administrators

to input relevant data and automatically generate optimized and conflict-free timetables.

Key features of the proposed system include:

• 8 Timetable Generation: Based on defined inputs like class, subject, teacher, and available time slots,

the system automatically generates a timetable.

• Admin Dashboard: Central control panel to manage all entities such as teachers, subjects, classes,

classrooms, and time slots.

• Conflict-Free Scheduling: The system ensures there are no overlaps in teacher or classroom

assignments.

• Efficient Updates: Admins can easily modify classes, reassign teachers, and update time slots without

regenerating the entire timetable.

• User-Friendly Interface: Designed using HTML, JavaScript, AJAX, and jQuery for better user

interaction and responsiveness.

3
• Secure Login System: Includes profile management, password change, and recovery using MD5

encryption.

• Centralized Access: Timetables can be viewed or printed from a single digital platform accessible

through any modern browser.

1.3 Implementation Strategy

The development and implementation of the Time Table Generator System follow a modular and phased approach:

1. Requirement Analysis:

o Identify all necessary data inputs (classes, subjects, teachers, rooms, slots).

o Understand constraints (no overlaps, lab continuity, teacher subject allocation, etc.).

2. Database Design:

o Create a normalized database in MySQL to store and manage class schedules, teacher

information, time slots, and subject details.

o Tables include: classes, subjects, teachers, rooms, timeslots, allocations, timetables.

3. Back-End Development (PHP):

o Develop server-side logic to handle data operations like CRUD (Create, Read, Update, Delete)

for each module.

o Implement algorithms for automatic timetable generation and conflict detection.

4. Front-End Development (HTML, CSS, JavaScript, AJAX, jQuery):

o Design interactive and responsive user interfaces for admin operations.

o Implement AJAX for smoother form submissions and data updates without reloading pages.

5. Authentication & Security:

o Set up an admin login system with password encryption using MD5.

o Enable profile update and password recovery features for added convenience and security.

6. Testing & Debugging:

o Conduct extensive testing for all functionalities including timetable generation, updates, and data

management.

o Fix any identified bugs or logic errors.

7. Deployment:

4
o Host the application on a local server using XAMPP, WAMP, MAMP, or LAMP.

o Ensure compatibility across major web browsers for smooth access.

8. Documentation & Training:

o Prepare user guides or documentation for the admin to understand how to use each module.

o Provide brief training if required for the end-users.

5
Overview of the Project:

The Time Table Generator System is a web-based application developed using PHP and MySQL to automate

and simplify the process of timetable creation in educational institutions. It is designed to assist administrators in scheduling

classes, assigning subjects to teachers, and managing classrooms and time slots effectively.

By automating the scheduling process, the system reduces human errors, prevents clashes in class and faculty timings,

and ensures optimal utilization of available resources. The system provides a centralized dashboard for managing all essential

components and enables the administrator to generate conflict-free, flexible, and easily modifiable timetables.

This system offers a single powerful admin panel through which the entire scheduling and management process can

be carried out efficiently. It supports adding, editing, and deleting of classes, subjects, teachers, classrooms, time slots, and

more. It also includes features for profile management and password control, making it a robust and secure solution for modern

academic scheduling.

2.1 Modules

The Time Table Generator System is composed of the following core modules:

1. Dashboard

2. Class Management

3. Subject Management

4. Teacher Management

5. Subject Allocation

6. Classroom Management

7. Time Slot Management

8. Time Table Generation

9. Admin Profile and Authentication

6
2.2 Module Description:

1. Dashboard

• Provides an overview of the system.

• Displays total number of classes, subjects, teachers, classrooms, and available time slots.

• Acts as a quick navigation point for the admin to access other modules.

2. Class Management

• Admin can add, update, and delete class records.

• Each class is uniquely identified and used as a base for subject and timetable assignment.

3. Subject Management

• Allows the admin to manage subjects offered for different classes.

• Subjects can be added, edited, or removed based on class structure and curriculum.

4. Teacher Management

• Enables the admin to add, update, and delete teacher profiles.

• Each teacher can be assigned to specific subjects and classes.

5. Subject Allocation

• Facilitates the allocation of subjects to teachers for specific classes.

• Ensures that each subject has a responsible faculty member assigned.

6. Classroom Management

• Admin can manage classroom details including room numbers or names.

• Classrooms are assigned to classes during timetable generation to avoid conflicts.

7. Time Slot Management

• Admin defines and manages available time slots for each day.

• Each time slot includes start time, end time, and is used during schedule creation.

8. Time Table Generation

• The core module that automatically generates the timetable based on subject allocations, available time slots,

and classroom constraints.

7
• Ensures conflict-free schedules and optimal use of resources.

9. Admin Profile and Authentication

• Admin can update their profile information.

• Features include change password and recover password with MD5 encryption for security.

• Secures system access from unauthorized users.

8
System Study:

The development of the Time Table Generator System begins with a thorough system study, which involves analyzing

the current process of timetable generation and identifying the areas that need improvement. Traditionally, timetable

scheduling in educational institutions is performed manually using spreadsheets or even pen and paper, making it inefficient,

error-prone, and difficult to modify.

This manual method lacks flexibility and often results in scheduling conflicts such as overlapping teacher assignments or

underutilized classrooms. It also consumes a significant amount of administrative time and offers no centralized system for

viewing or updating the timetable.

The proposed system addresses these issues by introducing automation into the process. It enables administrators to input

data such as class details, subjects, teachers, rooms, and time slots into a centralized platform. Using this data, the system

generates an optimized and conflict-free timetable, reducing human effort while improving accuracy and flexibility.

3.1 Hardware Requirements

Component Minimum Requirement

Processor Intel Core i3 or higher

RAM 4 GB (8 GB Recommended)

Hard Disk 500 MB of free space

Monitor 1024x768 resolution or higher

Keyboard & Mouse Standard input devices

Network Localhost or basic internet access

3.2 Software Environment

Software Description

Operating System Windows 7/8/10/11, Linux, or macOS

Server Environment XAMPP / WAMP / MAMP / LAMP (for running Apache, PHP, MySQL)

Programming Language PHP (Server-side scripting)

Database MySQL

9
Software Description

Front-End HTML, CSS, JavaScript, AJAX, jQuery

Web Browsers Google Chrome, Mozilla Firefox, Microsoft Edge, Opera

Text Editor / IDE VS Code, Sublime Text, Notepad++ or any preferred code editor

3.3 Software Description

Backend – PHP & MySQL

• PHP is used for the backend scripting to handle all server-side logic such as managing the

database, processing form data, and generating timetables.

• MySQL is the relational database management system used to store and manage all

essential data such as classes, subjects, teachers, rooms, and time slots.

Frontend – HTML, CSS, JavaScript, AJAX, jQuery

• HTML structures the web pages, while CSS styles them to ensure a user-friendly interface.

• JavaScript and jQuery add interactivity to the system.

• AJAX is used for dynamic page updates and form submissions without full page reloads.

Security

• The system includes an admin authentication mechanism.

• MD5 encryption is used for password protection, ensuring basic security of login

credentials.

Server

• The application runs on a local server using platforms like XAMPP or WAMP, which

provide integrated environments for PHP and MySQL.

10
System Implementation

System implementation is the phase where the actual operation of the system begins. In the case of the Time Table

Generator System, implementation involves deploying the developed PHP and MySQL-based application into a

suitable server environment (like XAMPP or WAMP), populating the database, and ensuring all modules work as

expected.

Key Steps in Implementation:

1. Environment Setup:

1. Install XAMPP/WAMP/MAMP/LAMP server.

2. Place the project folder inside the htdocs (XAMPP) or www (WAMP)

directory.

3. Create and configure the MySQL database using phpMyAdmin.

2. Database Configuration:

1. Import the SQL dump to create tables (class, subject, teacher, classroom,

timeslot, etc.).

2. Configure database connection in the PHP configuration file (e.g., db.php).

3. Admin Configuration:

1. Create default admin credentials.

2. Provide functionality to change password and update profile.

4. Testing Functional Modules:

1. Test modules for adding, updating, and deleting classes, subjects, and

teachers.

2. Verify subject allocation and time slot entries.

3. Ensure the timetable generator algorithm prevents conflicts and displays

schedules correctly.

5. Deployment:

o The system can be deployed on a local server for academic use or moved to a

live server for wider institutional access.

11
5.1 Input Design

Input design is concerned with the process of capturing and validating data entered by the user. For this system,

only the admin user enters data via various forms.

Input Fields:

• Add Class Form: Class Name

• Add Subject Form: Subject Name

• Add Teacher Form: Teacher Name, Email

• Allocate Subject Form: Select Class, Subject, and Teacher

• Add Classroom Form: Room Name

• Add Time Slot Form: Start Time, End Time

• Generate Timetable: Select Class → Auto Generate Schedule

Input Design Considerations:

• Validation:

▪ Empty field checks

▪ Format validation (e.g., email address)

▪ Duplication prevention (e.g., no two same time slots)

• User-friendly Interface:

▪ Dropdowns for class/teacher/subject selection

▪ Time picker for start and end times

▪ Notification messages for successful or failed submissions

5.2 Output Design

Output design defines how data is presented to users. In this system, the output is mainly in the form of dynamic

HTML tables showing class timetables.

Output Components:

1. Dashboard Output:

1. Total number of classes, teachers, subjects, classrooms, and time slots.

2. Timetable Output:

1. A structured table showing the subject, teacher, classroom, and time slot for

each day of the week, per class.

12
3. Subject Allocation Output:

1. View of all allocated subjects with teacher and class mappings.

4. Confirmation Messages:

1. “Class added successfully”

2. “Time table generated successfully”

3. Error messages for conflicts or missing data

Output Design Features:

• Responsive Design: Ensures compatibility with all screen sizes.

• Clear Presentation: Timetables are displayed using a tabular format with

headers for days and time slots.

• Print Option (Optional): Allow admin to print or export timetable.

13
System Design

The System Design of the Time Table Generator System defines the structure, components, and the interaction between

them. This web-based application is built to help academic institutions manage and generate optimized class timetables

efficiently.

Design Goals:

• Minimize manual errors in scheduling

• Automate the allocation of subjects, teachers, and classrooms

• Provide a user-friendly interface for admin

• Ensure data consistency and avoid clashes in schedules

System Architecture:

• Frontend: HTML, CSS, JavaScript, AJAX, jQuery

• Backend: PHP

• Database: MySQL

• Environment: XAMPP / WAMP / LAMP / MAMP

14
4.1 DATA FLOW DIAGRAM (DFD):

Level 0 (Context Diagram):

Admin

Time Table Generator System

MySQL Database

Level 1 – Detailed DFD:

Admin

Time Table Generator System

- Manage Classes

- Manage Subjects

- Manage Teachers

- Allocate Subjects

- Manage Classrooms

- Manage Time Slots

- Generate Timetables

MySQL Database

15
4.2 UML Diagrams:

1. Use Case Diagram (Admin):

Admin

Generate Timetable
Manage Classes Allocate Subjects

Manage Rooms Manage Teachers

2. Class Diagram:

Admin
Admin
- admin_id

- name

- email

- password

- login()

- updateProfile()

Class
- class_id
- class_name

Subject
- subject_id
- subject_name

16
Teacher
- teacher_id
- name
- email

SubjectAllocation
- id
- class_id
- subject_id
- teacher_id

Classroom

- room_id
- room_name

TimeSlot

- slot_id
- start_time
- end_time

Timetable
- timetable_id
- class_id
- subject_id
- teacher_id
- room_id
- day
- time_slot_id

17
4.3 TABLE DESIGN:

1. Admin

Field Type Description

admin_id INT (PK) Admin ID

name VARCHAR(100) Admin Name

email VARCHAR(100) Email

password VARCHAR(255) Encrypted password (MD5)

2. Class

Field Type Description

class_id INT (PK) Class ID

class_name VARCHAR(100) Name of the class

3. Subject

Field Type Description

subject_id INT (PK) Subject ID

subject_name VARCHAR(100) Subject Name

4. Teacher

Field Type Description

teacher_id INT (PK) Teacher ID

name VARCHAR(100) Teacher Name

email VARCHAR(100) Email

18
5. subject_allocation

Field Type Description

id INT (PK) Allocation ID

class_id INT FK to class table

subject_id INT FK to subject table

teacher_id INT FK to teacher table

6. Classroom

Field Type Description

room_id INT (PK) Room ID

room_name VARCHAR(50) Name of the classroom

7.Timeslot

Field Type Description

slot_id INT (PK) Time Slot ID

start_time TIME Start Time

end_time TIME End Time

19
8. Timetable

Field Type Description

timetable_id INT (PK) Timetable Entry ID

class_id INT FK to class

subject_id INT FK to subject

teacher_id INT FK to teacher

room_id INT FK to classroom

day VARCHAR(20) Day of the week (Monday–Saturday)

time_slot_id INT FK to time slot

20
5.2 SAMPLE CODING:
INDEX:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<html lang="en">

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Time Table Generator</title>

<style>
a{margin-left:15px;text-decoration:none; font-size:20px}
a:hover{background:#FF0000;color:#FFFFFF;}
.carousel-inner > .item > img,
.carousel-inner > .item > a >
img { margin:auto;}
</style>

<!-- Bootstrap Core CSS -->


<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

<!-- Custom Fonts -->


<link
href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,3
00,600,700,800' rel='stylesheet' type='text/css'>
<link
href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900i
talic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/font-awesome.min.css" type="text/css">

<!-- Plugin CSS -->


<link rel="stylesheet" href="css/animate.min.css" type="text/css">
<script src="js/jquery-2.1.3.min.js"></script>

32
<script src="js/bootstrap.min.js"></script>

<!-- Custom CSS -->


<link rel="stylesheet" href="css/creative.css" type="text/css">
<link href="css/owl.carousel.css" rel="stylesheet">
<link href="css/owl.theme.css" rel="stylesheet">
<link href="css/owl.transitions.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

<!-- [endif]-->

</head>
<body>

<!-- /.navbar -->

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">


<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand"><font color="#FF0000">Time Table Generator PHP MYSQL</font></a>
</div>
<ul class="nav navbar-nav">

<li class="active"><a href="#">Home</a></li>

<li><a class="page-scroll" href="#about">About</a></li>


<li><a class="page-scroll" href="#contact">Contact Us</a></li>
<!-- <li><a class="page-scroll" href="#registration">Registration</a></li> -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Login
<span class="caret"></span></a>
<ul class="dropdown-menu">

<li><a href="../timetable/staff/index.php">Staff Login</a></li>


<li><a href="../timetable/student/index.php">Student Login</a></li>
</ul>
</li>
</ul>
</div>
</nav>

33
<!-- /.navbar-end -->

<!-- /.slider -->

<header>
<div class="header-content">
<div class="header-content-inner">
<h1>Time Table Generator PHP MYSQL</h1>
<hr>

<a href="#about" class="btn btn-primary btn-xl page-scroll">Find Out More</a>


</div>
</div>
</header>

<!--container-->

<section class="about" id="about">


<div class="container">
<div class="row">
<div class="col-md-12">
<div class="col-md-12 text-center">
<h2 class="section-heading">About Time Table Generator PHP MYSQL</h2>
<hr class="primary">
</div>

<div class="row mb90">


<div class="col-md-12 text-justify">

<p>Most colleges have a number of different courses and each course has a number of
subjects. Now there are limited faculties, each faculty teaching more than one subjects. So now the time table
needed to schedule the faculty at provided time slots in such a way that their timings do not overlap and the
time table schedule makes best use of all faculty subject demands. We use a genetic algorithm for this
purpose. In our Timetable Generation algorithm we propose to utilize a timetable object. This object
comprises of Classroom objects and the timetable for every them likewise a fitness score for the timetable.
Fitness score relates to the quantity of crashes the timetable has regarding alternate calendars for different
classes.
Classroom object comprises of week objects. Week objects comprise of Days. also Days comprises of
Timeslots. Timeslot has an address in which a subject, student gathering going to the address and educator
showing the subject is related

34
Also further on discussing the imperatives, We have utilized composite configuration design, which make it
well extendable to include or uproot as numerous obligations.
In every obligation class the condition as determined in our inquiry is now checked between two timetable
objects. On the off chance that condition is fulfilled i.e there is a crash is available then the score is
augmented by one.</p>
</div>

</div>
<div class="row">
<div class="col-md-4 col-lg-4 col-md-offset-4 col-lg-offset-">
<div class="st-member">

</div>
</div></div></div></div>

<!--contact-->
<br/><br/>
<section id="contact">
<div class="row">
<h2 class="section-heading" align="center">Contact Us</h2>
<hr class="primary">
<div class="col-lg-offset-2 col-lg-8 text-center">
<h2 class="section-heading"> Let's Get In Touch</h2>
<hr class="primary">

</div>
<div class="panel panel-warning bg-primary" style="padding:10px 25px;">
<?php
include('config.php');
extract($_POST);
if(isset($save))
{

mysqli_query($con,"insert into contactus values('','$name','$e','$s','$m')");

$err="<font color='blue'>Congrats Your Data Saved!!!</font>";

?>

35
<form method="POST">
<div class="row" style="margin-bottom: 10px;">
<?php echo @$err; ?>
</div>
<div class="row" style="margin-bottom: 10px;">
<input type="text" class="form-control" placeholder="Name" name="name"/>
</div>
<div class="row" style="margin-bottom: 10px;">
<input type="email" class="form-control" placeholder="Email" name="e"/>
</div>
<div class="row" style="margin-bottom: 10px;">
<input type="text" class="form-control" placeholder="Subject" name="s"/>
</div>
<div class="row" style="margin-bottom: 10px;">
<textarea class="form-control" placeholder="Message" style="resize: vertical;max-height: 400px;"
name="m"></textarea>
</div>
<div class="row" style="margin-bottom: 10px;">
<input type="submit" value="save" name="save" class="btn btn-success" />
</div>
</form>
<div class="row" style="margin-bottom: 10px;">
</div>
</div>
</div>

<!--registration-->

<!-- <br/><br/>
<section id="registration">
<div class="row">
<h2 class="section-heading" align="center">Registration Form</h2>
<hr class="primary">
<div class="col-lg-offset-2 col-lg-8 text-center">

<i class="fa fa-phone fa-3x wow bounceIn"></i>


<p>123-456-6789</p>
<div class="panel panel-warning bg-primary" style="padding:10px 25px;">

<?php

36
include('config.php');

extract($_POST);
if(isset($save))
{
$que=mysqli_query($con,"select * from student where eid='$eid' and mob='$mobile'");

$row=mysqli_num_rows($que);
if($row)
{
$err="<font color='red'>This user already exists</font>";
}
else
{
$image=$_FILES['pic']['name'];

mysqli_query($con,"insert into
student values('','$stname','$eid','$p','$mobile','$address','$courseid','$s','$dob','$image','$gen','$st
atus',now())");

mkdir("../student/image/$eid");
move_uploaded_file($_FILES['pic']['tmp_name'],"../student/image/$eid/".$_FILES['pic']['name']);

$err="<font color='blue'>Congrats Your Data Saved!!!</font>";


}

?>
<script>
function showSemester(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}

if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari

37
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("semester").innerHTML=xmlhttp.responseText;
}
}
//alert(str);
xmlhttp.open("GET","semester_ajax.php?id="+str,true);
xmlhttp.send();
}
</script>

<script>
function showcourse(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}

if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange=function()

38
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("department").innerHTML=xmlhttp.responseText;
}
}
//alert(str);
xmlhttp.open("GET","course_ajax.php?id="+str,true);
xmlhttp.send();
}
</script>

<div class="row">
<div class="col-md-12">

<h2>Add Student</h2>
<form method="POST" enctype="multipart/form-data">
<div class="row" style="margin-bottom: 10px;">
<?php echo @$err; ?>
</div>
<div class="row" style="margin-bottom: 10px;">
<select name="courseid" class="form-control" onchange="showSemester(this.value)" id="courseid"/>
<option disabled selected >Select Department</option>
<?php
$dep=mysqli_query($con,"select * from department");
while($dp=mysqli_fetch_array($dep))
{
$dp_id=$dp[0];
echo "<option value='$dp_id'>".$dp[1]."</option>";
}
?>

</select>
</div>

<div class="row" style="margin-bottom: 10px;">


<select name="s" id="semester" onchange="showsemester(this.value)" class="form-control"/>
<option disabled selected >Select Semester</option>

39
<?php
$sub=mysqli_query($con,"select * from semester");
while($s=mysqli_fetch_array($sub))
{
$s_id=$s[0];
echo "<option value='$s_id'>".$s[1]."</option>";
}

?>

</select>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="text" class="form-control" placeholder="Name" name="stname"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="email" class="form-control" placeholder="Email" name="eid"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="password" class="form-control" placeholder="Password" name="p"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="number" class="form-control" placeholder="Mobile" name="mobile"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="text" class="form-control" placeholder="Address" name="address"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="date" class="form-control" placeholder="D.O.B" name="dob"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="file" class="form-control" placeholder="Pic" name="pic"/>

40
</div>

<div class="row" style="margin-bottom: 10px;">


<select name="status" class="form-control" placeholder="Status" name="status"/>
<option value="" selected="selected" disabled="disabled">Select Status</option>
<option>ON</option>
<option>OFF</option>
</select>
</div>

<div class="row" style="margin-bottom: 10px;">


male<input type="radio"value="m" id="gen" name="gen"/>
female<input type="radio"value="f" id="gen" name="gen"/>
</div>

<div class="row" style="margin-bottom: 10px;">


<input type="submit" value="Add Student" name="save" class="btn btn-success" />
<input type="reset" value="Reset" class="btn btn-success"/>
</div>
</form>
</div>
</div> </div>
</div>

</div>
</section>
</div>
</div> -->

<!--end registration-->

<!--slider-->

<!-- jQuery -->


<script src="js/jquery.js"></script>

41
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->

<script src="js/owl.carousel.js"></script>

</body>
</html>

ADD COURSE:
<?php
include('../config.php');
extract($_POST);
if(isset($save))
{
$que=mysqli_query($con,"select * from department where department_name='$c'");
$row=mysqli_num_rows($que);
if($row)
{
$err="<font color='red'>This department already exists</font>";
}
else
{
mysqli_query($con,"insert into department values(null,'$c')");

$err="<font color='blue'>Congrats Your Data Saved!!!</font>";


}

?>
<div class="row">
<div class="col-md-5">
<h2>Add Department</h2>
<form method="POST" enctype="multipart/form-data">
<table class="table">
<tr>

42
<td colspan="2"><?php echo @$err; ?></td>
</tr>

<tr>
<th width="237" scope="row">Department Name </th>
<td width="213"><input type="text" name="c" class="form-control"/></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Add Course" name="save" class="btn btn-success" />

<input type="reset" value="Reset" class="btn btn-success"/>

</td>
</tr>

</table>
</form>
</div>
</div>

ADMIN DASHBOARD:
<?php
session_start();
include('../config.php');
if($_SESSION['admin']=="")
{
$que=mysqli_query($con,"select * from admin where user_name='".$_SESSION['admin']."'");
$res=mysqli_fetch_array($que);
$_SESSION=$res;
}
?>

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

43
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Time table Admin Dashboard</title>

<!-- Bootstrap Core CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- Custom CSS -->


<link href="css/sb-admin.css" rel="stylesheet">

<!-- Custom Fonts -->


<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

</head>

<body>

<div id="wrapper">

<!-- Navigation -->


<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">

<p> <span style="color:#FFF" >Hello Admin</span>


<span style="margin-left:1200px" class="glyphicon-glyphicon-off" aria-hidden="true">
<a href="logout.php"><font color="#FFFFFF">Logout</font></a></span>
</p>
</div>

<!-- Top Menu Items -->

<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav" style="background-color:#000">

44
<li>
<a href="admindashboard.php?info=course"><i class="fa fa-fw fa-
dashboard"></i>Department</a>
</li>
<li>
<a href="admindashboard.php?info=semester"><i class="fa fa-fw fa-bar-chart-
o"></i>Semester</a>
</li>
<li>
<a href="admindashboard.php?info=subject"><i class="fa fa-fw fa-table"></i>Subject</a>
</li>
<li>
<a href="admindashboard.php?info=student"><i class="fa fa-fw fa-edit"></i>Student</a>
</li>
<li>
<a href="admindashboard.php?info=teacher"><i class="fa fa-fw fa-
desktop"></i>Teacher</a>
</li>

<li>
<a href="admindashboard.php?info=add_timetable"><i class="fa fa-fw fa-
wrench"></i>Time Table</a>
</li>

</ul>
</div>
<!-- /.navbar-collapse -->
</nav>

<div id="page-wrapper">

<div class="container-fluid">

<!-- Page Heading -->


<div class="row">
<div class="col-lg-12" style="height:1000px; width:1100px;" align="center" margin-
top="20px">

<?php
@$info=$_REQUEST['info'];

45
if($info!="")
{
if($info=="course")
{
include('course.php');
}
elseif($info=="semester")
{
include('semester.php');
}
elseif($info=="subject")
{
include('subject.php');
}

elseif($info=="student")
{
include('student.php');
}
elseif($info=="teacher")
{
include('teacher.php');
}
elseif($info=="timetable")
{
include('timetable.php');
}

elseif($info=="add_course")
{
include('add_course.php');
}

elseif($info=="add_subject")
{
include('add_subject.php');
}

elseif($info=="add_semester")
{

46
include('add_semester.php');
}

elseif($info=="add_teacher")
{
include('add_teacher.php');
}

elseif($info=="add_student")
{
include('add_student.php');
}

elseif($info=="add_timetable")
{
include('add_timetable.php');
}

elseif($info=="updatecourse")
{
include('updatecourse.php');
}

elseif($info=="updatesemester")
{
include('updatesemester.php');
}

elseif($info=="updatesubject")
{
include('updatesubject.php');
}

elseif($info=="updatestudent")
{
include('updatestudent.php');
}

elseif($info=="updateteacher")

47
{
include('updateteacher.php');
}

elseif($info=="updatetimetable")
{
include('update_timetable.php');
}

}
else
{
?>

<font color="#FF3333" size="+3" face="Lucida Console, Monaco, monospace">Admin


Panel</font><br/>
<img src="img/online-practice-exams.jpg" class="img-responsive" alt="Cinque Terre"
width="500" height="500" style=" margin-top: 70px; margin-left: 23px;">
<?php }?>

</div>
</div>
<!-- /.row -->

</div>
<!-- /.container-fluid -->

</div>
<!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<!-- jQuery -->


<script src="js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->


<script src="js/bootstrap.min.js"></script>

48
</body>

</html>

UPDATE TIMETABLE:
<?php
include('../config.php');
$timeschedule_id=$_REQUEST['timeschedule_id'];
$q=mysqli_query($con,"select * from timeschedule where timeschedule_id='$timeschedule_id'");
$res=mysqli_fetch_array($q);

extract($_POST);
if(isset($update))
{
mysqli_query($con,"update timeschedule set
department_name='$course',semester_name='$s',subject_name='$subname',time='$time',date='$date',teac
her_id='$teacher' where timeschedule_id='$timeschedule_id' ");

echo "Records updated";

?>

<script>
function showSemester(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}

if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

49
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("semester").innerHTML=xmlhttp.responseText;
}
}
//alert(str);
xmlhttp.open("GET","updatetimetable_ajax.php?id="+str,true);
xmlhttp.send();
}
</script>

<script>
function showSubject(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}

if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("subject").innerHTML=xmlhttp.responseText;
}
}

50
//alert(str);
xmlhttp.open("GET","subject_ajax.php?id="+str,true);
xmlhttp.send();
}
</script>

<div class="row">
<div class="col-sm-8">
<h2>Update Time Table</h2>
<form method="POST" enctype="multipart/form-data">
<table border="0" class="table">
<tr>
<td colspan="2"><?php echo @$err; ?></td>
</tr>
<tr>
<th width="237" scope="row">Department Name </th>
<td width="213">

<select name="course" id="courseid" onChange="showSemester(this.value)" class="form-control">


<?php
$cou=mysqli_query($con,"select * from department");
while($c=mysqli_fetch_array($cou))
{
$c_id=$c[0];
?>
<option value='<?php echo $c_id; ?>' <?php if($c_id==$res['department_name']){echo "selected";} ?>>
<?php echo $c[1]; ?>
</option>
<?php
}
?>

</select>
</td>

</tr>
<tr>
<th width="237" scope="row">Semester Name </th>
<td width="213">

51
<select name="s" id="semester" onChange="showSubject(this.value)" class="form-control">
<?php
$sem=mysqli_query($con,"select * from semester where department_id='".$res['department_name']."'");
while($s=mysqli_fetch_array($sem))
{
$s_id=$s[0];
?>
<option value='<?php echo $s_id; ?>' <?php if($s_id==$res['semester_name']){echo "selected";} ?>>
<?php echo $s[1]; ?>
</option>
<?php
}
?>

</select>
</td>

</tr>

<tr>
<th width="237" scope="row">Subject Name </th>
<td width="213">
<select name="subname" id="subject" class="form-control">
<?php
$sem=mysqli_query($con,"select * from subject where sem_id='".$res['semester_name']."'");
while($s=mysqli_fetch_array($sem))
{
$s_id=$s[0];
?>
<option value='<?php echo $s_id; ?>' <?php if($s_id==$res['subject_name']){echo "selected";} ?>>
<?php echo $s[1]; ?>
</option>
<?php
}
?>

</select>

52
</tr>

<tr>
<th width="237" scope="row">Teacher </th>
<td width="213">
<select name="teacher" id="teacherid" onchange="showTeacher(this.value)" class="form-control">
<?php
$t=mysqli_query($con,"select * from teacher");
while($s=mysqli_fetch_array($t))
{
$t_id=$s[0];
echo "<option value='$t_id'>".$s[1]."</option>";
}

?>

</td>
</tr>
<tr>
<th width="237" scope="row">Enter Time </th>
<td width="213"><input type="time" name="time" class="form-control" value="<?php echo
$res['time']; ?>"/></td>
</tr>
<tr>
<tr>
<th width="237" scope="row">Date </th>
<td width="213"><input type="date" name="date" class="form-control" value="<?php echo
$res['date']; ?>"/></td>
</tr>

<th colspan="2" scope="row" align="center">


<input type="submit" value="Update Records" name="update" class="btn btn-success"/>
</th>
</tr>
</table>
</form>

</div>
</div>

53
</body>

</html>

54
6. Future Enhancement
The current Time Table Generator System provides a solid base for managing and automating academic timetables.
However, several future enhancements can be implemented to further improve functionality and usability:
1. Multi-User Login System
o Include separate login panels for faculty and students.
o Allow teachers to view and suggest preferred time slots.
o Allow students to view their individual batch-wise timetable.
2. Faculty Leave Management
o Include a module for managing faculty leaves and auto-adjusting timetables accordingly.
3. Conflict Detection System
o Automatically detect and highlight schedule clashes during allocation.
4. Export Options
o Enable timetable export as PDF or Excel format for offline use.
5. Notification System
o Real-time notifications to students or faculty when timetable changes occur.
6. Responsive Mobile App Integration
o Create a mobile-friendly version or Android/iOS app for on-the-go access.
7. AI-based Scheduling Algorithm
o Use Artificial Intelligence or optimization algorithms (like Genetic Algorithm) to generate the most optimal
schedule.
8. Analytics and Reports
o Track teacher workload, room utilization, and generate performance charts.

55
7. Conclusion
The Time Table Generator System using PHP and MySQL simplifies the complex and time-consuming process of
manual timetable scheduling in educational institutions. It provides an efficient, user-friendly interface for administrators to
manage classes, subjects, teachers, classrooms, and time slots, and to automatically generate conflict-free timetables.

By automating these tasks, the system significantly reduces human errors, saves administrative time, and ensures
effective resource allocation. It can be used by schools, colleges, and universities to streamline their academic operations.

With the potential for future enhancements, this system can be scaled and customized to suit the specific needs of any
institution, making it a valuable tool in the field of academic administration.

56
8. References
1. W3Schools PHP Tutorial – https://www.w3schools.com/php/
2. MySQL Documentation – https://dev.mysql.com/doc/
3. PHP Manual – https://www.php.net/manual/en/
4. Stack Overflow – https://stackoverflow.com/
5. GeeksforGeeks PHP Programming – https://www.geeksforgeeks.org/php/
6. Toptal Timetable Scheduling Algorithms – https://www.toptal.com/algorithms/timetable-scheduling
7. GitHub Sample Projects – https://github.com
8. AJAX & jQuery Tutorial – https://www.tutorialspoint.com/ajax/index.htm
9. Project experiences and discussions with peers and faculty.

57

You might also like