Вы находитесь на странице: 1из 82

Time Table Generator

by

Ary a S ing h (1 84 7 21 5 )
Hi man sh u Mish ra (1847 22 7 )
J ay aram G S (18 4 72 30 )

Under the guidance of


Dr. Arul Kumar N

DB M S pro ject repo rt s ub m itt ed in parti al ful fi ll ment


of t he requi remen t s fo r th e awa rd o f de gree o f
M as ter of C o mpu t er App l icatio n s o f
C HR IS T (De eme d to b e Un i vers it y )

Octob er - 20 19
CERTIFICATE
T hi s is to cer ti fy th a t th e r ep or t t it led T im e Ta bl e
Gen er ator is a bo na f id e record of wor k d o ne b y Ar ya
S ingh (1847215), Him a ns hu M i shr a (1 84 72 2 7) and
Jaya ram G S (184 7 23 0 ) o f C HRIS T (De emed to b e
Univ er si ty), Ban ga lo re, in p a rt ial fu lfi llm en t of the
r equir ement s of III S emest er M C A du r in g t he y ea r
2019 .

Head of the Department Project Guide

V a l u e d -b y :
Name :
1. Register Number :
Examination Centre : CHRIST
(Deemed to be
University)
2. Date of Exam :
Time Table Generator iii

ACKNOWLEDGEMENTS
We take this opportunity to thank all the people who have been supportive throughout
this project.
First, we would like to thank Prof. Joy Paulose, Head of the Department, Computer
Science, CHRIST (Deemed to be University), for his assistance in completion of our
project.
Second, we would like to thank our project guide, Dr. Arul Kumar N, Assistant
Professor, Department of Computer Science, who has been a constant support in the
process of completing this project.
We would also like to thank Dr. Tulasi B, Co-Ordinator, Department of Computer
Science, for her constant support in the process of completing this project.
Lastly, we would like to thank all our faculties, friends and family for their support and
guidance for the project.

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator iv

ABSTRACT
In every institution, the time table is prepared either in a logbook or a computerized
system. Using the logbook is the traditional way for maintaining the time tables. There
are some computerized systems that are used in place of the logbook, but some
drawbacks still exist in those systems such as, they are time consuming, insecure and they
provide inconsistent data.
The project Time Table Generator is developed to overcome the above- mentioned
constraints. This system keeps track of all the student’s and faculty’s details such as
department, courses etc. The system is being made for online purpose so that each student
and the faculty can use it to view the time table anywhere and at any point of time. Each
person will be given a username and password to login into the system thus increasing
the security of the system. Any modifications made in the time table by the admin will
automatically be reflected in the corresponding time table that can be viewed in the
student’s or the faculty’s account. This way the users can check their time table regularly.
Time Table Generator is aimed at reducing paperwork and manipulation of data and also
ensures that the data is safe and centralized.

Department of Computer Science, CHRIST (Deemed to be University)


TABLE OF CONTENTS
SL NO. CONTENT PAGE NO.

1. CERTIFICATE i

2. ACKNOWLEDGEMENT iii

3. ABSTRACT iv

4. TABLE OF CONTENTS v

5. LIST OF FIGURES vii

6. LIST OF TABLES viii

7. CHAPTER 1: INTRODUCTION 1
1.1. BACKGROUND STUDY 2
1.1.1. LITERATURE SURVEY 2
1.1.2. TECHNOLOGY USED 3
1.1.3. DATABASE USED
4
8. CHAPTER 2: SYSTEM REQUIREMENTS 5
2.1. FUNCTIONAL REQUIREMENTS 5
2.2. MODULE DESCRIPTION 6
2.3. NON-FUNCTIONAL REQUIREMENTS 7
2.4. HARDWARE REQUIREMENTS 7
2.5. SOFTWARE REQUIREMENTS 7
9. CHAPTER 3: DESIGN SPECIFICATION 8
3.1. DIAGRAMS 8
3.1.1. DATA FLOW DIAGRAM (DFD) 8
3.1.2. ER DIAGRAM 9
10. CHAPTER 4: IMPLEMENTATION DETAILS 10
4.1. INTERFACE DESIGN 10
4.2. TABLE STRUCTURES 21
4.3. CODE IMPLEMENTATION 25
11. CHAPTER 5: TESTING 64
5.1. TEST CASES 64
12. CONCLUSION 73
13. BIBLIOGRAPHY 74
Time Table Generator vii

LIST OF FIGURES
FIGURE NO. FIGURE NAME PAGE NO.
4.1 LOGIN 11
4.2 FORGOT PASSWORD 11
4.3 RESET PASSWORD 12
4.4 DASHBOARD (HOME) 12
4.5 ADD FACULTY 13
4.6 REMOVE FACULTY 13
4.7 UPDATE FACULTY 14
4.8 ASSIGN SUBJECT 14
4.9 UNASSIGN SUBJECT 15
4.10 ASSIGN HOD 15
4.11 UNASSIGN HOD 16
4.12 ADD STUDENT 16
4.13 REMOVE STUDENT 17
4.14 ADD HOLIDAY 17
4.15 REMOVE HOLIDAY 18
4.16 VIEW HOLIDAY 18
4.17 ADD SCHEDULE 19
4.18 VIEW SCHEDULE 19
4.19 SEARCH FACULTY 20
4.20 VIEW FACULTY TIME TABLE 20
4.21 VIEW CLASS TIME TABLE 21

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator viii

LIST OF TABLES
TABLE NO. TABLE NAME PAGE NO.
4.22 LOGIN 21
4.23 ADMIN DETAILS 21
4.24 ASSIGN 21
4.25 CLASSES 22
4.26 CLASS HOURS 22
4.27 COURSE 22
4.28 COURSE DETAILS 22
4.29 DEPARTMENT 23
4.30 FACULTY 23
4.31 HOURS CONDUCTED 23
4.32 NEW PASSWORD 24
4.33 SECTIONS 24
4.34 SEMESTER 24
4.35 STUDENT DETAILS 24
4.36 SUBJECTS 25
4.37 SUBJECT SCHEDULE 25
4.38 WEEK DAYS 25

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 1

CHAPTER 1
INTRODUCTION
The existing system of the time-table generator includes generating a time-table by using
either a log book or a computerized system. Using the logbook is a traditional way for
maintaining a time table. There are some computerized systems that are being used in
place of the logbook, but some drawbacks still exist in those systems such as, it is a time-
consuming method of generating a time-table, data is highly insecure or inconsistent in
some scenarios and the chance of loss of data can be high.

The Proposed system keeps track of the student’s and faculty’s details such as
department, courses etc., The system is being made for online purpose so that each
student and the faculty can use it to view the time table anywhere and at any point of
time. Each person will be given a username and password to login into the system thus
increasing the security of the system. Any modification made in the time table by the
admin will automatically be reflected in the corresponding time-table that can be viewed
in the student’s or the faculty’s account.

The system Time-Table Generator, can be used to manage all the class’s schedule and
will be helpful for any faculty, as a notification will be sent to their account regarding
their respective class hour. The system can be used to manage time-table when any
faculty is absent, arriving late or taking a leave. The strain and efforts on faculty reduces
as their class details and maximum workload is managed by the system. The students
and the faculties can use the system to apply for a leave by providing leave required date
and the reason. By this, selecting a faculty as a substitute becomes easy. The substitute
faculty can approve or reject the request. Admin and Head of the Department (HOD),
can view the request sent by faculty and view the substitute’s response. The system is a
comprehensive time-table management solution for the colleges, which helps to
overcome the challenges faced in the existing and system.

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 2

1.1 BACKGROUND STUDY

1.1.1 LITERATURE SURVEY

There exist various time-table generation problems such as Employee


Timetabling, University Timetabling, Sports Timetabling and Examination
Timetabling. A large number of diverse methods have been already proposed for
solving timetabling problems.

Time table generation is tedious job for educationalist with respect to time and
man power. Providing an automatic time table generator will help to generate time
table automatically. Proposed system of our project will help to generate it
automatically also helps to save time. It avoids the complexity of setting and
managing Timetable manually. The system will take various inputs like number
of subjects, teachers, workload of a teacher, semester etc., By relying on these
inputs, it will generate possible time tables for working days of the week for
teaching faculty. This will integrate by making optimal use of all resources in a
way that will best suit the constraints [1].

The manual system of preparing time table in colleges with large number of
students is very time consuming and usually ends up with various classes clashing
either at same room or with same teachers having more than one class at a time.
To overcome all these problems, propose to make an automated system. The
system will take various inputs like details of students, subjects and class rooms
and teachers available, depending upon these inputs it will generate a possible
time table, making optimal utilization of all resources in a way that will best suit
any of constraints or college rules. List of subjects may include electives as well
as core subjects [2].

The problem of timetable scheduling is described as a highly constrained NP-hard


problem. It is known as the timetabling problem by most researchers. Planning
timetable is one of the most complex and error prone task. A lot of complex
constraints need to be addressed for development of an efficient algorithm to

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 3

solve this problem. There are still serious problems like generation of high cost
time table. Therefore, there is a great requirement for an application distributing
the course evenly and without collisions. Our aim here is to develop a simple,
easily understandable, efficient and portable application, which could
automatically generate good quality time tables within seconds. In this paper, we
have described the different techniques that have been developed for timetable
generation [3].

Many colleges use manual way of preparing timetables with large number of
students is very time consuming. This usually ends up with various courses
clashing this may be either at same room or with same teachers having more than
one course at a time. These are just due to common human errors which are very
difficult to prevent in the processes. To avoid these problems people usually
taking the previous years’ timetable and modifying it but still it is a difficult job to
do incorporate changes. To overcome all these problems, we propose this system.
This system will take various inputs like details of students, subjects and
classrooms and teachers available, depending upon these input it will generate
possible timetable, making the utilization of all of these resources in a way that
will best suit any of constrains of college rules [4].

1.1.2 Technology Used

Hyper Text Mark-Up Language (HTML) is the standard mark up language for
creating web pages and web applications. With Cascading Style Sheets (CSS)
and JavaScript, it forms a triad of cornerstone technologies for the World Wide
Web browsers receive HTML documents from a web server or from local storage
and render the documents into multimedia web pages. HTML describes the
structure of a web page semantically and originally included cues for the
appearance of the document.

HTML elements are the building blocks of HTML pages. With HTML
constructs, images and other objects such as interactive forms may be embedded
into the rendered page. HTML provides a means to create structures

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 4

documents by denoting structural semantics for text such as headings, paragraphs,


lists, links, quotes and other items. HTML elements are delineated by tags, written
using angle brackets. Browsers do not display the HTML tags, but use them to
interpret the content of the page.

HTML can embed programs written in scripting languages such


as JavaScript which affects the behavior and content of web pages. Inclusion of
CSS defines the look and layout of content.

PHP (Hypertext-Pre-Processor) is a server-side scripting language designed


for web development but also used as a general-purpose programming language.
PHP code may be embedded into HTML code, or it can be used in combination
with various Web template systems, web content management systems, and web
frameworks. PHP code is usually processed by a PHP interpreter implemented as
a module in the web server or as a common gateway interface (CGI) executable.
The web server combines the results of the interpreted and executed PHP code,
which may be any type of data, including images, with the generated web page.
PHP code may also be executed with a command-line interface (CLI) and can be
used to implement standalone graphical applications.

1.1.3 Database used

SQL is an open-source Relational Database Management System (RDBMS).


“SQL” is the abbreviation for Structured Query Language. The MySQL
development project has made its source code available under the terms of
the GNU General Public License as well as under a variety
of proprietary agreements. MySQL is a central component of the XAMPP open-
source web application software stack. XAMPP is an acronym for Cross Platform
of, Apache, MySQL PHP and Perl. Applications that use the MySQL database
include: TYPO3, MODx, Joomla, and WordPress.

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 5

CHAPTER 2

SYSTEM REQUIREMENTS
2.1 Functional requirements
The functional requirements specify relationship between the inputs and outputs. All the
operations to be performed on the input data to obtain output are to be specified. This
includes specifying the validity checks on the input and output data, parameters affected
by the operations and the other operations, which must be used to transform the inputs
into outputs. Functional requirements specify the behaviour of the system for valid input
and outputs.
Give below are the functional requirements of the system:

Function Description

FR01: Time-Table Time-table is generated for each class of


the institution

FR02: Report A consolidated report of faculty’s


workload can be generated.

FR03: Student Student can view the time-table by


logging in, into the system.

FR04: Subjects Faculty members are assigned with


different subjects.

FR05: Faculty Faculty can view the time-table and


request for a leave and accept or reject a
class hour.
FR06: Login Admin has access to all the pages and is
concerned with maintenance of database.

FR07: HOD The HOD can view the time-table, accept


or reject the requests made by the faculty.

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 6

2.2 Module description


a. Class Time Table
In this module, time table for each class belonging to different departments can be
prepared. Here we provide all the time-table details for each and every course of
every department.

b. Report
A consolidated report of the sessions held by the faculties can be generated at any
interval of time.

c. Student
In this module student can login with the Username and Password which is uniquely
identified for every individual. After logging in into the system, the student can view
his/her respective class time-table.

d. Subject Allocation
In this module, the required faculties are assigned to their respective subjects of
different classes belonging to same or different department.

e. Faculty
In this module faculty can login with Username and Password which are given to
every faculty and it is unique for every individual faculty of the department. The
faculty members are assigned with different subjects and they can view their
respective individual time-table.

f. Login
Admin has access to all the pages and any changes or modification done by him/her
will affect the system. The Admin can add or remove HODs, faculties and students
as and when necessary.

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 7

g. Head of the Department (HOD)


The HOD can approve or reject requests provided by the faculties and students. The
HOD can also view the reports and time-tables.

2.3 Non-Functional Requirements


a. User Friendly Application: The time table generator can be used by colleges to mark
attendance and can be easily used by a person with basic computer knowledge.
b. Easily Maintained: All the information about the student is maintained at a single
place along with the cumulative attendance along.
c. System Reduces Manual Work: This system reduces the manual work as the data is
stored in the database and the time table is generated by the system.
d. Secure: Data stored is highly secure and cannot be destroyed or lost. Only authorized
users can log into the system, thus making the system safe and effective.

2.4 Hardware Requirements


 Processor : Intel Core 2 Duo 2.0 GHz or higher
 RAM : 1 GB or higher
 Hard disk : 20GB or higher
 Keyboard : Normal or Multimedia
 Mouse : Compatible mouse
 Monitor : LED

2.5 Software Requirements


 Front-End : HTML, JavaScipt, CSS
 Back-End : MySQL, PHP
 Platform : XAMPP server (phpMyAdmin)
 OS : Microsoft Windows 7 or higher

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 8

CHAPTER 3

DESIGN SPECIFICATION
3.1 DIAGRAMS
3.1.1 Data Flow Diagram (DFD)

Fig 3.1: Level 0 DFD

Fig 3.2: Level 1 DFD

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 9

3.1.2 E-R Diagram

Fig 3.3: E-R Diagram

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 10

CHAPTER 4

IMPLEMENTATION DETAILS
4.1 Interface design
a. Login

Fig 4.1: Login page

b. Forgot password

Fig 4.2: Forgot password page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 11

c. Reset password

Fig 4.3: Reset password page

d. Dashboard (Home)

Fig 4.4: Dashboard (Home) page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 12

e. Add faculty

Fig 4.5: Add faculty page

f. Remove faculty

Fig 4.6: Remove faculty page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 13

g. Update faculty

Fig 4.7: Update faculty page

h. Assign subject

Fig 4.8: Assign subject page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 14

i. Unassign subject

Fig 4.9: Unassign subject page

j. Assign HOD

Fig 4.10: Assign HOD page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 15

k. Unassign HOD

Fig 4.11: Unassign HOD page

l. Add student

Fig 4.12: Add student page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 16

m. Remove student

Fig 4.13: Remove student page

n. Add holiday

Fig 4.14: Add holiday page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 17

o. Remove holiday

Fig 4.15: Remove holiday page

p. View holiday

Fig 4.16: View holiday page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 18

q. Add schedule

Fig 4.17: Add schedule page

r. View schedule

Fig 4.18: View schedule page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 19

s. Search faculty

Fig 4.19: Search faculty page

t. View faculty time table

Fig 4.20: View faculty time table page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 20

u. View class time table

Fig 4.21: View class time table page

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 21

4.2 Table structures


a. Login

Table 4.22: Login table

b. Admin details

Table 4.23: Admin details table


c. Assign

Table 4.24: Assign table

d. Classes

Table 4.25: Classes table

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 22

e. Class hours

Table 4.26: Class hours table

f. Course

Table 4.27: Course table

g. Course details

Table 4.28: Course details table

h. Department

Table 4.29: Department table

i. Faculty

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 23

Table 4.30: Faculty table


j. Faculty details

Table 4.31: Faculty details table

k. Hours conducted

Table 4.32: Hours conducted table

l. New password

Table 4.33: New password table

m. Sections

Table 4.34: Sections table

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 24

n. Semester

Table 4.35: Semester table

o. Student details

Table 4.36: Student details table

p. Subjects

Table 4.37: Subjects table

q. Subject schedule

Table 4.38: Subject schedule table

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 25

r. Week days

Table 4.39: Week table

4.3 Code implementation


a. Login code

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

<head>
<title>Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="images/icons/favicon.ico" />
<link rel="stylesheet" type="text/css"
href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-
awesome.min.css">
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<link rel="stylesheet" type="text/css" href="vendor/css-
hamburgers/hamburgers.min.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>

<body>

<div class="limiter">
<div class="container-login100">
<!-- <div class="wrap-login100"> -->
<div class="login100-pic js-tilt" data-tilt>
<img src="images/tt1.png" alt="IMG">
</div>

<form class="login100-form validate-form" method='post'

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 26

action="../verify_login.php">
<span class="login100-form-title">
Time Table Generator
</span>

<div class="wrap-input100 validate-input" data-validate="Valid email is


required: ex@abc.xyz">
<input class="input100" type="text" name="username"
placeholder="Username">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
</span>
</div>

<div class="wrap-input100 validate-input" data-validate="Password is


required">
<input class="input100" type="password" name="password"
placeholder="Password">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock" aria-hidden="true"></i>
</span>
</div>

<div class="container-login100-form-btn">
<button class="login100-form-btn" name='login'>
Login
</button>
</div>

<div class="text-center p-t-12">


<span class="txt1">
Forgot
</span>
<a class="txt2" href="forgotPass.php">
Password?
</a>
</div>
</form>
</div>
</div>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 27

<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="vendor/select2/select2.min.js"></script>
<script src="vendor/tilt/tilt.jquery.min.js"></script>
<script>
$('.js-tilt').tilt({
scale: 1.1
})
</script>
<script src="js/main.js"></script>

</body>
</html>

b. Add faculty code

<?php
if (!isset($_SESSION)) {
session_start();
}
include 'boot.php';
include 'conn.php';
include 'admin_top.php';

$lr1 = mysqli_query($conn, "SELECT * FROM faculty ORDER BY fact_id DESC


LIMIT 1");
$lr2 = mysqli_fetch_assoc($lr1);

//USING REGEX TO AUTO INCREMENT USERNAME


$my_text = $lr2['fact_id'];
$my_array = preg_split("/_/", $my_text);
//print_r($my_array);
$new_id = $my_array[1] + 01;

$flag = 0;

if (isset($_POST['submit'])) {
$fname = $_POST['fname'];
$mname = $_POST['mname'];
$lname = $_POST['lname'];

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 28

$pno = $_POST['pno'];
$email = $_POST['email'];
$exp = $_POST['exp'];
$uname = $_POST['uname'];
$pass = md5($_POST['pass']);
$conf_pass = md5($_POST['conf_pass']);
$dept = $_POST['dept'];

$as1 = mysqli_query($conn, "SELECT * from admin_details where email =


'$email'");
$as2 = mysqli_query($conn, "SELECT * from faculty_details where email =
'$email'");
if (mysqli_num_rows($as1) > 0 || mysqli_num_rows($as2) > 0) {
echo "<script type='text/javascript'>alert(\"Email already in use. Please try
again!\");</script>";
header("refresh:0;url=add_faculty.php");
exit();
}

if ($pass != $conf_pass) {
echo "<script type='text/javascript'>alert(\"Passwords do not match. Please try
again!\");</script>";
header("refresh:0;url=add_faculty.php");
exit();
}

$r1 = mysqli_query($conn, "SELECT fact_id FROM faculty where fact_id


='$uname' ");
$r2 = mysqli_fetch_array($r1);

if ($uname == $r2['fact_id']) {
echo "<script type='text/javascript'>alert(\"Username already in use. Please enter
different ID!\");</script>";
header("refresh:0;url=add_faculty.php");
exit();
}

if ($dept == "-1") {
echo "<script type='text/javascript'>alert(\"Department is not
selected!\");</script>";
header("refresh:0;url=add_faculty.php");
exit();

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 29

$dept2 = mysqli_query($conn, "SELECT dept_id from department where


dept_name = '$dept'");
if (!$dept2) {
echo "no";
exit();
}
$deptid = mysqli_fetch_assoc($dept2);

//FOR INSERT INTO FACULTY TABLE


$sql = mysqli_query($conn, "INSERT INTO faculty_details (fact_id, f_name,
m_name, l_name, phone_no, email, experience, rank)
VALUES ('$uname', '$fname','$mname','$lname','$pno','$email','$exp',2)");

if ($sql) {
//FOR FACULTY DEPARTMENT
$sql2 = mysqli_query($conn, "INSERT INTO faculty (fact_id, dept_id)
VALUES ('$uname', '$deptid[dept_id]')");

if ($sql2) {
//FOR INSERT INTO LOGIN TABLE
$sql3 = mysqli_query($conn, "INSERT INTO login (username, password,
level) VALUES ('$uname','$pass','2')");
if ($sql3) {
// echo "work";
$flag = 1;
}
}
}
}

?>

<html lang="en" xmlns="http://www.w3.org/1999/html">

<head>
<link rel="icon" type="image/png" href="images/icons/favicon.png"/>
<title> Faculty Details </title>
<style>
body {
background-image: url("pics/black.jpg");

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 30

background-color: #1e1e1e;
background-repeat: repeat-x;
background-attachment: fixed;
color: white;
background-size: 100%;
font-family: verdana, sans-serif;
/*background-color: #2b4162;*/
/*background-image: linear-gradient(315deg, #2b4162 0%, #12100e 74%);*/
}

.txt9 {
color: white;
font-size: 18px;
}

.bo-rad-10 {
border-radius: 10px;
}

.txt10 {
font-family: Montserrat, sans-serif;
font-weight: 400;
font-size: 14px;
color: #666666;
}

.sizefull {
width: 100%;
height: 100%;
}

</style>

<script>
function validateAlpha1() {
var textInput = document.getElementById("fname").value;
textInput = textInput.replace(/[^A-Za-z]/g, "");
document.getElementById("fname").value = textInput;
}

function validateAlpha2() {
var textInput = document.getElementById("mname").value;

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 31

textInput = textInput.replace(/[^A-Za-z]/g, "");


document.getElementById("mname").value = textInput;
}

function validateAlpha3() {
var textInput = document.getElementById("lname").value;
textInput = textInput.replace(/[^A-Za-z]/g, "");
document.getElementById("lname").value = textInput;
}

function isNumberKey() {
var textInput = document.getElementById("pno").value;
textInput = textInput.replace(/[^0-9]/g, "");
document.getElementById("pno").value = textInput;

var exp = document.getElementById("exp").value;


if (exp > 50) {
alert("Experience cannot exceed 50!");
document.getElementById("exp").value = "";
}
}

function ValidateEmail() {
var email = document.getElementById("email").value;
// var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-
]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
var expr = /^([\w-.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-
]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/;
if (!expr.test(email)) {
alert("Invalid email address.");
document.getElementById("email").value = "";
}
}
</script>

</head>
<body>
<div class="animsition" style="top: 180px; position: relative">

<div align="center">
<b>
<h1 style="font-family:Matura MT Script Capitals,sans-serif; font-

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 32

size:45px;">
Add Faculty!
</h1>
</b>
<br/><br/>
<?php
if ($flag == 1) {
?>
<div>
<h1 style="font-size:18px" class="btn btn-info"> Faculty <strong
style="text-transform: capitalize;"><?php echo $fname ?></strong>
is added successfully! :)
</h1>
</div>
<?php
header("refresh:3;url=add_faculty.php");
}
?>
<br/>

<form id name="add_fact" method=post action=add_faculty.php class="wrap-


form-reservation size22 m-l-r-auto">

<div class="col-md-6">
<span class="txt9">
First Name:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input style='text-transform:uppercase' class="bo-rad-10 sizefull txt10 p-
l-20" type="text"
id="fname" name="fname" oninput="validateAlpha1();" required>
</div>
<span class="txt9">
Middle Name:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input style='text-transform:uppercase' class="bo-rad-10 sizefull txt10 p-
l-20" type="text"
id="mname" name="mname" oninput="validateAlpha2();"/>
</div>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 33

<span class="txt9">
Last Name:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input style='text-transform:uppercase' class="bo-rad-10 sizefull txt10 p-
l-20" type="text"
id="lname" name="lname" oninput="validateAlpha3();" required>
</div>

<span class="txt9">
Phone Number:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" maxlength="10"
type="text" name="pno"
oninput="isNumberKey()" id="pno" required>
</div>

<span class="txt9">
Email ID:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input style='text-transform:lowercase' class="bo-rad-10 sizefull txt10 p-
l-20" type="text"
name="email" id="email" onblur="ValidateEmail();" required>
</div>
</div>

<div class="col-md-6">
<span class="txt9">
Department:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<select class="bo-rad-10 sizefull txt10 p-l-20" name="dept" id="dept"
required
style='text-transform: Uppercase;'/>
<option value="-1"> ---- select ----</option>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 34

<?php
$d1 = mysqli_query($conn, "SELECT DISTINCT dept_name from
department");
while ($d2 = mysqli_fetch_array($d1)) {
echo "<option value='" . $d2['dept_name'] . "'>" . $d2['dept_name'] .
"</option>";
}
?>
</select>
</div>
<span class="txt9">
Username:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" maxlength="10"
type="text" name="uname"
id="uname" value="<?php echo $my_array[0] . "_" . $new_id; ?>"
required
readonly="readonly">
</div>
<span class="txt9">
Password:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" type="password"
name="pass" id="pass"
required>
</div>
<span class="txt9">
Confirm Password:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" type="password"
name="conf_pass"
id="conf_pass" required>
</div>
<span class="txt9">
Experience:
</span>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 35

<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative


txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" type="text" name="exp"
id="exp"
oninput="isNumberKey()" maxlength="2" required/>
</div>
<br>
</div>
<input type="submit" name=submit class="btn btn-success"
id="btnValidate">
<input type="reset" name=reset value=Reset class="btn btn-danger">

</form>
</div>
<div class="end-footer bg2" style="top: 100px; position: relative">
<div class="container">
<div class="flex-sb-m flex-w p-t-22 p-b-22">
<div class="p-t-5 p-b-5">
<a href="#" class="fs-15 c-white"><i class="fa fa-tripadvisor" aria-
hidden="true"></i></a>
<a href="#" class="fs-15 c-white"><i class="fa fa-facebook m-l-18" aria-
hidden="true"></i></a>
<a href="#" class="fs-15 c-white"><i class="fa fa-twitter m-l-18" aria-
hidden="true"></i></a>
</div>

<div class="txt17 p-r-20 p-t-5 p-b-5">


Copyright &copy; 2019 All rights reserved
</div>
</div>
</div>
</div>
</div>
</body>

</html>

c. Remove faculty

<?php

include 'boot.php';

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 36

include 'conn.php';
include 'admin_top.php';

if (isset($_POST['submit'])) {
$username = $_POST["username"];

if ($username == "-1") {
echo "<script type='text/javascript'>alert(\"Faculty ID is not
selected!\");</script>";
header("refresh:0;url=remove_faculty.php");
exit();
}

$q1 = mysqli_query($conn, "select * from sub_schedule where fact_id =


'$username'");
if (mysqli_num_rows($q1) > 0) {
echo "<script type='text/javascript'>alert(\"Failed to remove faculty as subjects
are still assigned!\");</script>";
header("refresh:0;url=remove_faculty.php");
exit();
}

$t1 = mysqli_query($conn, "DELETE FROM login WHERE


username='$username'");
$t2 = mysqli_query($conn, "DELETE FROM faculty_details WHERE
fact_id='$username'");
$t3 = mysqli_query($conn, "DELETE FROM faculty WHERE
fact_id='$username'");

if ($t1 && $t2 && $t3) {


echo "<script type='text/javascript'>alert(\"Faculty removed
successfully!\");</script>";
header("refresh:0;url=remove_faculty.php");
exit();
}
}

?>

<html lang="en" xmlns="http://www.w3.org/1999/html">

<head>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 37

<link rel="icon" type="image/png" href="images/icons/favicon.png"/>


<title>Remove Faculty Details </title>
<style>
body {
background-image: url("pics/black.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
color: #fff;
background-size: 100%;
}

.txt9 {
color: white;
font-size: 18px;
}

.bo-rad-10 {
border-radius: 10px;
}

.txt10 {
font-family: Montserrat, sans-serif;
font-weight: 400;
font-size: 14px;
color: #666666;
}

.sizefull {
width: 100%;
height: 100%;
}
</style>

</head>
<body>
<div class="animsition">
<div align="center" style="position: relative; top:200px;">
<b>
<h1 style="font-family:Matura MT Script Capitals,sans-serif; font-
size:45px;">
Remove Faculty!

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 38

</h1>
</b><br/> <br/>
<form id="form1" name="form1" method="post" action="">
<span class="txt9">
Faculty ID:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<select class="bo-rad-10 sizefull txt10 p-l-20" name="username" required
style='text - transform: Uppercase;'/>
<option value="-1"> ---- select ----</option>
<?php
$d1 = mysqli_query($conn, "SELECT fact_id from faculty");
while ($d2 = mysqli_fetch_array($d1)) {
echo "<option value='" . $d2['fact_id'] . "'>" . $d2['fact_id'] . "</option>";
}
?>
</select>
</div>
<input type="submit" name="submit" id="submit" value="Submit" class="btn
btn-success"/>
</form>
<br/>

</div>
</div>
<div class="end-footer bg2" style="position: relative; top:608px;">
<div class="container">
<div class="flex-sb-m flex-w p-t-22 p-b-22">
<div class="p-t-5 p-b-5">
<a href="#" class="fs-15 c-white"><i class="fa fa-tripadvisor" aria-
hidden="true"></i></a>
<a href="#" class="fs-15 c-white"><i class="fa fa-facebook m-l-18" aria-
hidden="true"></i></a>
<a href="#" class="fs-15 c-white"><i class="fa fa-twitter m-l-18" aria-
hidden="true"></i></a>
</div>

<div class="txt17 p-r-20 p-t-5 p-b-5">


Copyright &copy; 2018 All rights reserved
</div>
</div>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 39

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

</html>

d. Update faculty

<?php
ob_start();
include 'boot.php';
include 'conn.php';
include 'admin_top.php';
if (isset($_POST['update'])) {

$f_id = $_SESSION["CURR_FACT_ID"];
$f_name = $_POST['fname'];
$m_name = $_POST['mname'];
$l_name = $_POST['lname'];
$pno = $_POST['pno'];
$email = $_POST['email'];
$experience = $_POST['exp'];
$dept = $_POST['dept'];

$q_dept1 = mysqli_query($conn, "SELECT dept_id from department where


dept_name = '$dept'");
$q_dept2 = mysqli_fetch_assoc($q_dept1);

$r1 = mysqli_query($conn, "SELECT dept_id FROM department where


dept_name='$dept'");
$r2 = mysqli_fetch_array($r1);

$sql1 = mysqli_query($conn, "UPDATE faculty_details SET f_name = '$f_name',


m_name = '$m_name', l_name = '$l_name', phone_no = '$pno', email = '$email',
experience = $experience WHERE fact_id = '$f_id'");
// if ($sql1) {
// echo "w1";
// }
$sql2 = mysqli_query($conn, "UPDATE faculty SET dept_id = '$r2[dept_id]'
where fact_id = '$f_id' ");
if ($sql1 && $sql2) {

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 40

echo "<script type='text/javascript'>alert(\"Faculty details updated


successfully!\");</script>";
header("refresh:0;url=update_faculty.php");
exit();
}
}
?>
<html lang="en">

<head>
<link rel="icon" type="image/png" href="images/icons/favicon.png"/>
<title>
Faculty Update
</title>

<style>
body {
background-image: url("pics/black.jpg");
background-color: #1e1e1e;
background-repeat: repeat-x;
background-attachment: fixed;
color: white;
background-size: 100%;
font-family: verdana, sans-serif;
}

.txt9 {
color: white;
font-size: 18px;
}

.bo-rad-10 {
border-radius: 10px;
}

.txt10 {
font-family: Montserrat, sans-serif;
font-weight: 400;
font-size: 14px;
color: #666666;
}

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 41

.sizefull {
width: 100%;
height: 100%;
}

</style>

<script>
function validateAlpha1() {
var textInput = document.getElementById("fname").value;
textInput = textInput.replace(/[^A-Za-z]/g, "");
document.getElementById("fname").value = textInput;
}

function validateAlpha2() {
var textInput = document.getElementById("mname").value;
textInput = textInput.replace(/[^A-Za-z]/g, "");
document.getElementById("mname").value = textInput;
}

function validateAlpha3() {
var textInput = document.getElementById("lname").value;
textInput = textInput.replace(/[^A-Za-z]/g, "");
document.getElementById("lname").value = textInput;
}

function isNumberKey() {
var textInput = document.getElementById("pno").value;
textInput = textInput.replace(/[^0-9]/g, "");
document.getElementById("pno").value = textInput;

var exp = document.getElementById("exp").value;


if (exp > 50) {
alert("Experience cannot exceed 50!");
document.getElementById("exp").value = "";
}
}

function ValidateEmail() {
var email = document.getElementById("email").value;
// var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-
]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 42

var expr = /^([\w-.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-


]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/;
if (!expr.test(email)) {
alert("Invalid email address.");
document.getElementById("email").value = "";
}
}
</script>

</head>

<body class="animsition">
<div style="top: 180px; position: relative">

<div align="center">
<b>
<h1 style="font-family:Matura MT Script Capitals,serif; font-size:45px;">
Update Faculty!
</h1>
</b><br/> <br/>

<form id name="update" method=post action="update_faculty.php"


class="wrap-form-reservation size22 m-l-r-auto">
<span class="txt9">
Faculty ID:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-relative
txt10 m-10">
<select class="bo-rad-10 sizefull txt10 p-l-20" name="fact_id"
id="fact_id"
style='text-transform: Uppercase;'/>
<option value="-1"> ---- select ----</option>
<?php
$d1 = mysqli_query($conn, "SELECT DISTINCT fact_id from faculty");
while ($d2 = mysqli_fetch_array($d1)) {
echo "<option value='" . $d2['fact_id'] . "'>" . $d2['fact_id'] .
"</option>";
}
?>
</select>
</div>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 43

<input type="submit" class="btn btn-primary" name="search"


value="Search">
</form>

<?php
if (isset($_POST["search"])) {
if ($_POST['fact_id'] == "-1") {
echo "<script type='text/javascript'>alert(\"Faculty ID is not
selected!\");</script>";
header("refresh:0;url=update_faculty.php");
exit();
}

$_SESSION['CURR_FACT_ID'] = $_POST['fact_id'];
$qu1 = mysqli_query($conn, "SELECT * from faculty_details where fact_id
= '$_POST[fact_id]'");
$qu2 = mysqli_fetch_assoc($qu1);
?>
<form name="alloc" method=post action="update_faculty.php"
class="wrap-form-reservation size22 m-l-r-auto">
<div class="col-md-6">
<span class="txt9">
First Name:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<input style='text-transform:uppercase' class="bo-rad-10 sizefull txt10
p-l-20"
type="text" value="<?php echo $qu2['f_name']; ?>"
id="fname" name="fname" oninput="validateAlpha1();"
required>
</div>
<span class="txt9">
Middle Name:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<input style='text-transform:uppercase' class="bo-rad-10 sizefull txt10
p-l-20"
type="text" value="<?php echo $qu2['m_name']; ?>"
id="mname" name="mname" oninput="validateAlpha2();"/>
</div>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 44

<span class="txt9">
Last Name:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<input style='text-transform:uppercase' class="bo-rad-10 sizefull txt10
p-l-20"
type="text" value="<?php echo $qu2['l_name']; ?>"
id="lname" name="lname" oninput="validateAlpha3();" required>
</div>
<span class="txt9">
Phone Number:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" maxlength="10"
type="text" name="pno"
oninput="isNumberKey()" id="pno" required
value="<?php echo $qu2['phone_no']; ?>">
</div>
</div>

<div class="col-md-6">
<span class="txt9">
Email ID:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<input style='text-transform:lowercase' class="bo-rad-10 sizefull txt10
p-l-20"
type="text" value="<?php echo $qu2['email']; ?>"
name="email" id="email" onblur="ValidateEmail();" required>
</div>
<span class="txt9">
Department:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<select class="bo-rad-10 sizefull txt10 p-l-20" name="dept" id="dept"
required
style='text-transform: Uppercase;'/>
<?php

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 45

$qu3 = mysqli_query($conn, "SELECT * from faculty where fact_id =


'$_POST[fact_id]'");
$qu4 = mysqli_fetch_assoc($qu3);
$qu5 = mysqli_query($conn, "SELECT * from department where
dept_id = '$qu4[dept_id]'");
$qu6 = mysqli_fetch_assoc($qu5);
?>
<option value="<?php echo $qu6['dept_name']; ?>"> <?php echo
$qu6['dept_name']; ?></option>
<?php
$d1 = mysqli_query($conn, "SELECT DISTINCT dept_name from
department where dept_name not in('$qu6[dept_name]')");
while ($d2 = mysqli_fetch_array($d1)) {
echo "<option value='" . $d2['dept_name'] . "'>" . $d2['dept_name'] .
"</option>";
}
?>
</select>
</div>

<span class="txt9">
Experience:
</span>
<div class="wrap-input-signup size17 bo2 bo-rad-10 bgwhite pos-
relative txt10 m-10">
<input class="bo-rad-10 sizefull txt10 p-l-20" type="text" name="exp"
id="exp"
value="<?php echo $qu2['experience']; ?>"
oninput="isNumberKey()" maxlength="2" required/>
</div>
<br>
</div>

<input type="submit" value="Update Record" name="update" class="btn


btn-success">
</form>

</div>
</div>

<?php
}

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 46

?>

<div class="end-footer bg2" style="top: 400px; position: relative">


<div class="container">
<div class="flex-sb-m flex-w p-t-22 p-b-22">
<div class="p-t-5 p-b-5">
<a href="#" class="fs-15 c-white"><i class="fa fa-tripadvisor" aria-
hidden="true"></i></a>
<a href="#" class="fs-15 c-white"><i class="fa fa-facebook m-l-18" aria-
hidden="true"></i></a>
<a href="#" class="fs-15 c-white"><i class="fa fa-twitter m-l-18" aria-
hidden="true"></i></a>
</div>

<div class="txt17 p-r-20 p-t-5 p-b-5">


Copyright &copy; 2019 All rights reserved
</div>
</div>
</div>
</div>

</body>
</html>

e. View time table

<?php
if (!isset($_SESSION)) {
session_start();
}
include 'boot.php';
include 'conn.php';

if ($_SESSION["level"] == 0) {
include 'admin_top.php';
}
if ($_SESSION["level"] == 2) {
include 'fact_top.php';
}

$fid = $_SESSION["user_id"]; //FACULTY ID

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 47

/* code for fetching faculty name */


$ft1 = mysqli_query($conn, "select * from faculty_details where fact_id = '$fid'");
$ft2 = mysqli_fetch_assoc($ft1);
/* till here */
?>
<html lang="en">

<head>
<title>Faculty Time-Table</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

<style>
body {
color: white;
background-image: url(pics/black.jpg);
background-size: 100%;
background-attachment: fixed;
background-repeat: no-repeat;
overflow: hidden;
}

table {
border-radius: 6%;
}
</style>

</head>

<body class="animsition">
<div class="item-slick1 item1-slick1">
<?php
if ($_SESSION["level"] == 0) { ?>
<div align=center style="top: 180px; position: relative">
<?php
}else
if ($_SESSION["level"] == 2) { ?>
<div align=center style="top: 110px; position: relative">
<?php
} ?>
<b>
<h1 style="font-family:Matura MT Script Capitals, sans-serif; font-

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 48

size:45px;">Time-Table </h1>
</b><br/>
<div style="font-family:acme,sans-serif; font-size:24px;">
</div>
<div class="container">
<div style=text-transform:capitalize;>
<!-- <table class="table table-dark" style="font-
family:candara">-->
<table class="table table-light table-hover" style="font-family:candara, sans-
serif">
<thead><th></th>
<th>Faculty ID: <?php echo $fid ?></th>
<th></th>
<th></th>
<th></th>
<th> Faculty Name: <?php echo $ft2['f_name']." ".$ft2['m_name']."
".$ft2['l_name'] ?> </th>
<th></th>
</thead>
<thead align='center'>
<tr>
<th scope="col"> Date & Time</th>
<th> 09 : 00 AM- 10:00 AM</th>
<th> 10 : 00 AM- 11:00 AM</th>
<th> 11 : 00 AM- 12:00 PM</th>
<th> 12 : 00 PM- 01:00 PM</th>
<th> 02 : 00 PM- 03:00 PM</th>
<th> 03 : 00 PM- 04:00 PM</th>
</tr>
</thead>
<tbody align='center'>
<!-- monday code-->
<tr>
<td>Monday</td>
<td> <?php
$mon1 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='M'");
while ($mon_q1 = mysqli_fetch_array($mon1)) {
$mon_w1 = mysqli_query($conn, "select * from subjects where
sub_id = '$mon_q1[sub_id]'");
while ($mon_p1 = mysqli_fetch_array($mon_w1)) {

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 49

if (($mon_q1['day_id'] == "M") && ($mon_q1['hour_id'] == 1))


{
echo($mon_p1['sub_name']);
}
}
}
?>
</td>
<td> <?php
$mon2 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='2'
and day_id='M'");
while ($mon_q2 = mysqli_fetch_array($mon2)) {
$mon_w2 = mysqli_query($conn, "select * from subjects where
sub_id = '$mon_q2[sub_id]'");
while ($mon_p2 = mysqli_fetch_array($mon_w2)) {
if (($mon_q2['day_id'] == "M") && ($mon_q2['hour_id'] == 2))
{
echo($mon_p2['sub_name']);
}
}
}
?>
</td>
<td> <?php
$mon3 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='3'
and day_id ='M'");
while ($mon_q3 = mysqli_fetch_assoc($mon3)) {
$mon_w3 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$mon_q3[sub_id]'");
while ($mon_p3 = mysqli_fetch_assoc($mon_w3)) {
if (($mon_q3['day_id'] == "M") && ($mon_q3['hour_id'] == 3))
{
echo($mon_p3['sub_name']);
}
}
}
?>
</td>
<td> <?php
$mon4 = mysqli_query($conn, "select DISTINCT

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 50

sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='4'


and day_id='M'");
while ($mon_q4 = mysqli_fetch_array($mon4)) {
$mon_w4 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$mon_q4[sub_id]'");
while ($mon_p4 = mysqli_fetch_array($mon_w4)) {
if (($mon_q4['day_id'] == "M") && ($mon_q4['hour_id'] == 4))
{
echo($mon_p4['sub_name']);
}
}
}
?>
</td>
<td> <?php
$mon5 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='5'
and day_id='M'");
while ($mon_q5 = mysqli_fetch_array($mon5)) {
$mon_w5 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$mon_q5[sub_id]'");
while ($mon_p5 = mysqli_fetch_array($mon_w5)) {
if (($mon_q5['day_id'] == "M") && ($mon_q5['hour_id'] == 5))
{
echo($mon_p5['sub_name']);
}
}
}
?>
</td>
<td> <?php
$mon6 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='6'
and day_id='M'");
while ($mon_q6 = mysqli_fetch_array($mon6)) {
$mon_w6 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$mon_q6[sub_id]'");
while ($mon_p6 = mysqli_fetch_array($mon_w6)) {
if (($mon_q6['day_id'] == "M") && ($mon_q6['hour_id'] == 6))
{
echo($mon_p6['sub_name']);
}

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 51

}
}
?>
</td>
</tr>
<!-- TUESDAY CODE-->
<tr>
<td>Tuesday</td>
<td> <?php
$tue1 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='T'");
while ($tue_q1 = mysqli_fetch_array($tue1)) {
$tue_w1 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$tue_q1[sub_id]'");
while ($tue_p1 = mysqli_fetch_array($tue_w1)) {
if (($tue_q1['day_id'] == "T") && ($tue_q1['hour_id'] == 1)) {
echo($tue_p1['sub_name']);
}
}
}
?>
</td>
<td> <?php
$tue2 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='2'
and day_id ='T'");
while ($tue_q2 = mysqli_fetch_array($tue2)) {
$tue_w2 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$tue_q2[sub_id]'");
while ($tue_p2 = mysqli_fetch_array($tue_w2)) {
if (($tue_q2['day_id'] == "T") && ($tue_q2['hour_id'] == 2)) {
echo($tue_p2['sub_name']);
}
}
}
?>
</td>
<td> <?php
$tue3 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='3'
and day_id='T'");

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 52

while ($tue_q3 = mysqli_fetch_array($tue3)) {


$tue_w3 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$tue_q3[sub_id]'");
while ($tue_p3 = mysqli_fetch_array($tue_w3)) {
if (($tue_q3['day_id'] == "T") && ($tue_q3['hour_id'] == 3)) {
echo($tue_p3['sub_name']);
}
}
}
?>
</td>
<td> <?php
$tue4 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='4'
and day_id='T'");
while ($tue_q4 = mysqli_fetch_array($tue4)) {
$tue_w4 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$tue_q4[sub_id]'");
while ($tue_p4 = mysqli_fetch_array($tue_w4)) {
if (($tue_q4['day_id'] == "T") && ($tue_q4['hour_id'] == 4)) {
echo($tue_p4['sub_name']);
}
}
}
?>
</td>
<td> <?php
$tue5 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='5'
and day_id='T'");
while ($tue_q5 = mysqli_fetch_array($tue5)) {
$tue_w5 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$tue_q5[sub_id]'");
while ($tue_p5 = mysqli_fetch_array($tue_w5)) {
if (($tue_q5['day_id'] == "T") && ($tue_q5['hour_id'] == 5)) {
echo($tue_p5['sub_name']);
}
}
}
?>
</td>
<td> <?php

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 53

$tue6 = mysqli_query($conn, "select DISTINCT


sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='6'
and day_id='T'");
while ($tue_q6 = mysqli_fetch_array($tue6)) {
$tue_w6 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$tue_q6[sub_id]'");
while ($tue_p6 = mysqli_fetch_array($tue_w6)) {
if (($tue_q6['day_id'] == "T") && ($tue_q6['hour_id'] == 6)) {
echo($tue_p6['sub_name']);
}
}
}
?>
</td>
</tr>
<tr>
<td>Wednesday</td>
<td> <?php
$wed1 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='W'");
while ($wed_q1 = mysqli_fetch_array($wed1)) {
$wed_w1 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$wed_q1[sub_id]'");
while ($wed_p1 = mysqli_fetch_array($wed_w1)) {
if (($wed_q1['day_id'] == "W") && ($wed_q1['hour_id'] == 1))
{
echo($wed_p1['sub_name']);
}
}
}
?>
</td>
<td> <?php
$wed2 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='2'
and day_id='W'");
while ($wed_q2 = mysqli_fetch_array($wed2)) {
$wed_w2 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$wed_q2[sub_id]'");
while ($wed_p2 = mysqli_fetch_array($wed_w2)) {
if (($wed_q2['day_id'] == "W") && ($wed_q2['hour_id'] == 2))

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 54

{
echo($wed_p2['sub_name']);
}
}
}
?>
</td>
<td> <?php
$wed3 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='3'
and day_id='W'");
while ($wed_q3 = mysqli_fetch_array($wed3)) {
$wed_w3 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$wed_q3[sub_id]'");
while ($wed_p3 = mysqli_fetch_array($wed_w3)) {
if (($wed_q3['day_id'] == "W") && ($wed_q3['hour_id'] == 3))
{
echo($wed_p3['sub_name']);
}
}
}
?>
</td>
<td> <?php
$wed4 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='4'
and day_id='W'");
while ($wed_q4 = mysqli_fetch_array($wed4)) {
$wed_w4 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$wed_q4[sub_id]'");
while ($wed_p4 = mysqli_fetch_array($wed_w4)) {
if (($wed_q4['day_id'] == "W") && ($wed_q4['hour_id'] == 4))
{
echo($wed_p4['sub_name']);
}
}
}
?>
</td>
<td> <?php
$wed5 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='5'

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 55

and day_id='W'");
while ($wed_q5 = mysqli_fetch_array($wed5)) {
$wed_w5 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$wed_q5[sub_id]'");
while ($wed_p5 = mysqli_fetch_array($wed_w5)) {
if (($wed_q5['day_id'] == "W") && ($wed_q5['hour_id'] == 5))
{
echo($wed_p5['sub_name']);
}
}
}
?>
</td>
<td> <?php
$wed6 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='6'
and day_id='W'");
while ($wed_q6 = mysqli_fetch_array($wed6)) {
$wed_w6 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$wed_q6[sub_id]'");
while ($wed_p6 = mysqli_fetch_array($wed_w6)) {
if (($wed_q6['day_id'] == "W") && ($wed_q6['hour_id'] == 6))
{
echo($wed_p6['sub_name']);
}
}
}
?>
</td>
</tr>

<tr>
<td>Thursday</td>
<td> <?php
$thur1 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='M'");
while ($thur_q1 = mysqli_fetch_array($thur1)) {
$thur_w1 = mysqli_query($conn, "select * from subjects where
sub_id = '$thur_q1[sub_id]'");
while ($thur_p1 = mysqli_fetch_array($thur_w1)) {
if (($thur_q1['day_id'] == "Th") && ($thur_q1['hour_id'] == 1))

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 56

{
echo($thur_p1['sub_name']);
}
}
}
?>
</td>
<td> <?php
$thur2 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='M'");
while ($thur_q2 = mysqli_fetch_array($thur2)) {
$thur_w2 = mysqli_query($conn, "select * from subjects where
sub_id = '$thur_q1[sub_id]'");
while ($thur_p2 = mysqli_fetch_array($thur_w2)) {
if (($thur_q2['day_id'] == "Th") && ($thur_q2['hour_id'] == 2))
{
echo($thur_p2['sub_name']);
}
}
}
?>
</td>
<td> <?php
$thur3 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='3'
and day_id='Th'");
while ($thur_q3 = mysqli_fetch_assoc($thur3)) {
$thur_w3 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$thur_q3[sub_id]'");
while ($thur_p3 = mysqli_fetch_assoc($thur_w3)) {
if (($thur_q3['day_id'] == "Th") && ($thur_q3['hour_id'] == 3))
{
echo($thur_p3['sub_name']);
}
}
}
?>
</td>
<td> <?php
$thur4 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='4'

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 57

and day_id='Th'");
while ($thur_q4 = mysqli_fetch_assoc($thur4)) {
$thur_w4 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$thur_q4[sub_id]'");
while ($thur_p4 = mysqli_fetch_assoc($thur_w4)) {
if (($thur_q4['day_id'] == "Th") && ($thur_q4['hour_id'] == 4))
{
echo($thur_p4['sub_name']);
}
}
}
?>
</td>
<td> <?php
$thur5 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='5'
and day_id='Th'");
while ($thur_q5 = mysqli_fetch_assoc($thur5)) {
$thur_w6 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$thur_q6[sub_id]'");
while ($thur_p5 = mysqli_fetch_assoc($thur_w5)) {
if (($thur_q5['day_id'] == "Th") && ($thur_q5['hour_id'] == 5))
{
echo($thur_p5['sub_name']);
}
}
}
?>
</td>
<td> <?php
$thur6 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='6'
and day_id='Th'");
while ($thur_q6 = mysqli_fetch_assoc($thur6)) {
$thur_w5 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$thur_q5[sub_id]'");
while ($thur_p6 = mysqli_fetch_assoc($thur_w6)) {
if (($thur_q6['day_id'] == "Th") && ($thur_q6['hour_id'] == 6))
{
echo($thur_p6['sub_name']);
}
}

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 58

}
?>
</td>
</tr>
<tr>
<td>Friday</td>
<td> <?php
$fri1 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='F'");
while ($fri_q1 = mysqli_fetch_assoc($fri1)) {
$fri_w1 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$fri_q1[sub_id]'");
while ($fri_p1 = mysqli_fetch_assoc($fri_w1)) {
if (($fri_q1['day_id'] == "F") && ($fri_q1['hour_id'] == 1)) {
echo($fri_p1['sub_name']);
}
}
}
?>
</td>

<td> <?php
$fri2 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='2'
and day_id='F'");
while ($fri_q2 = mysqli_fetch_assoc($fri2)) {
$fri_w2 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$fri_q2[sub_id]'");
while ($fri_p2 = mysqli_fetch_assoc($fri_w2)) {
if (($fri_q2['day_id'] == "F") && ($fri_q2['hour_id'] == 2)) {
echo($fri_p2['sub_name']);
}
}
}
?>
</td>
<td> <?php
$fri3 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='3'
and day_id='F'");
while ($fri_q3 = mysqli_fetch_assoc($fri3)) {

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 59

$fri_w3 = mysqli_query($conn, "select sub_name from subjects


where sub_id = '$fri_q3[sub_id]'");
while ($fri_p3 = mysqli_fetch_assoc($fri_w3)) {
if (($fri_q3['day_id'] == "F") && ($fri_q3['hour_id'] == 3)) {
echo($fri_p3['sub_name']);
}
}
}
?>
</td>
<td> <?php
$fri4 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='4'
and day_id='F'");
while ($fri_q4 = mysqli_fetch_assoc($fri4)) {
$fri_w4 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$fri_q4[sub_id]'");
while ($fri_p4 = mysqli_fetch_assoc($fri_w4)) {
if (($fri_q4['day_id'] == "F") && ($fri_q4['hour_id'] == 4)) {
echo($fri_p4['sub_name']);
}
}
}
?>
</td>
<td> <?php
$fri5 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='5'
and day_id='F'");
while ($fri_q5 = mysqli_fetch_assoc($fri5)) {
$fri_w5 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$fri_q5[sub_id]'");
while ($fri_p5 = mysqli_fetch_assoc($fri_w5)) {
if (($fri_q5['day_id'] == "F") && ($fri_q5['hour_id'] == 5)) {
echo($fri_p5['sub_name']);
}
}
}
?>
</td>
<td> <?php
$fri6 = mysqli_query($conn, "select DISTINCT

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 60

sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='6'


and day_id='F'");
while ($fri_q6 = mysqli_fetch_assoc($fri6)) {
$fri_w6 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$fri_q6[sub_id]'");
while ($fri_p6 = mysqli_fetch_assoc($fri_w6)) {
if (($fri_q6['day_id'] == "F") && ($fri_q6['hour_id'] == 6)) {
echo($fri_p6['sub_name']);
}
}
}
?>
</td>
</tr>
<tr>
<td>Saturday</td>
<td> <?php
$sat1 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='1'
and day_id='S'");
while ($sat_q1 = mysqli_fetch_assoc($sat1)) {
$sat_w1 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$sat_q1[sub_id]'");
while ($sat_p1 = mysqli_fetch_assoc($sat_w1)) {
if (($sat_q1['day_id'] == "S") && ($sat_q1['hour_id'] == 1)) {
echo($sat_p1['sub_name']);
}
}
}
?>
</td>
<td> <?php
$sat2 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='2'
and day_id='S'");
while ($sat_q2 = mysqli_fetch_assoc($sat2)) {
$sat_w2 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$sat_q2[sub_id]'");
while ($sat_p2 = mysqli_fetch_assoc($sat_w2)) {
if (($sat_q2['day_id'] == "S") && ($sat_q2['hour_id'] == 2)) {
echo($sat_p2['sub_name']);
}

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 61

}
}
?>
</td>
<td> <?php
$sat3 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='3'
and day_id='S'");
while ($sat_q3 = mysqli_fetch_assoc($sat3)) {
$sat_w3 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$sat_q3[sub_id]'");
while ($sat_p3 = mysqli_fetch_assoc($sat_w3)) {
if (($sat_q3['day_id'] == "S") && ($sat_q3['hour_id'] == 3)) {
echo($sat_p3['sub_name']);
}
}
}
?>
</td>
<td> <?php
$sat4 = mysqli_query($conn, "select DISTINCT
sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='4'
and day_id='S'");
while ($sat_q4 = mysqli_fetch_assoc($sat4)) {
$sat_w4 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$sat_q4[sub_id]'");
while ($sat_p4 = mysqli_fetch_assoc($sat_w4)) {
if (($sat_q4['day_id'] == "S") && ($sat_q4['hour_id'] == 4)) {
echo($sat_p4['sub_name']);
}
}

}
?>
</td>
<td> <?php

$sat5 = mysqli_query($conn, "select DISTINCT


sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='5'
and day_id='S'");
while ($sat_q5 = mysqli_fetch_assoc($sat5)) {
$sat_w5 = mysqli_query($conn, "select sub_name from subjects

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 62

where sub_id = '$sat_q5[sub_id]'");


while ($sat_p5 = mysqli_fetch_assoc($sat_w5)) {
if (($sat_q5['day_id'] == "S") && ($sat_q5['hour_id'] == 5)) {
echo($sat_p5['sub_name']);
}
}
}
?>
</td>
<td> <?php

$sat6 = mysqli_query($conn, "select DISTINCT


sub_id,day_id,hour_id,fact_id from sub_schedule where fact_id = '$fid' and hour_id='6'
and day_id='S'");
while ($sat_q6 = mysqli_fetch_assoc($sat6)) {
$sat_w6 = mysqli_query($conn, "select sub_name from subjects
where sub_id = '$sat_q6[sub_id]'");
while ($sat_p6 = mysqli_fetch_assoc($sat_w6)) {
if (($sat_q6['day_id'] == "S") && ($sat_q6['hour_id'] == 6)) {
echo($sat_p6['sub_name']);
}
}
}
?>
</td>
</tr>
</table>
<a href="#"><input style=font-size:20px;font-
family:verdana,serif;color:white;
class='btn btn-outline-info'
type="submit" value="Print" onclick="window.print()">
</div>
</div>
</div>
</div>
</body>
</html>

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 63

CHAPTER 5
TESTING
5.1 Test cases
a. Login page
SL TEST EXPECTED OUTPUT OBSERVED RESULT (Pass /
NO. SCENARIO OUTPUT Fail)

1. Display the The login page should be All the elements Pass
form and its loaded and all the elements are displayed
respective of the page should be successfully
controls displayed

2. Click on submit A warning message to be The message is Pass


without filling displayed to the user displayed
the text boxes successfully

3. Filling invalid If the credential filled are The message is Pass


credentials invalid, message should be displayed
displayed to the user successfully

4. Filling valid If the credential filled are The home page Pass
credentials valid, dashboard (Home is displayed
page) should be displayed to successfully
the user

5. Click on forgot If the button is clicked, the The forgot Pass


password control should go the password page is
button respective forgot password displayed to the
page user successfully

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 64

b. Add faculty
SL TEST EXPECTED OUTPUT OBSERVED RESULT (Pass /
NO. SCENARIO OUTPUT Fail)

1. Display the The add faculty page should All the elements Pass
form and its be loaded and all the are displayed
respective elements of the page should successfully
controls be displayed

2. Click on submit A warning message to be The message is Pass


without filling displayed to the user displayed
the text boxes successfully

3. Filling invalid If the email entered is The message is Pass


email invalid, message should be displayed
displayed to the user successfully

4. Filling invalid If the number entered is The message is Pass


phone number invalid, message should be displayed
displayed to the user successfully

5. Filling different If the passwords entered do The message is Pass


passwords not match, invalid message displayed
should be displayed to the successfully
user

6. Adding a new If all the details provided The message is Pass


faculty are true, a successful displayed
message is displayed successfully

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 65

c. Assign subject
SL TEST EXPECTED OUTPUT OBSERVED RESULT (Pass /
NO. SCENARIO OUTPUT Fail)

1. Display the The assign subject page All the elements Pass
form and its should be loaded and all the are displayed
respective elements of the page should successfully
controls be displayed

2. Click on submit A warning message to be The message is Pass


without displayed to the user displayed
selecting the successfully
select boxes

3. Assigning a If all the details provided The message is Pass


subject to the are true, a successful displayed
faculty message is displayed successfully

d. Assign HOD
SL TEST EXPECTED OUTPUT OBSERVED RESULT (Pass /
NO. SCENARIO OUTPUT Fail)

1. Display the The assign HOD page All the elements Pass
form and its should be loaded and all the are displayed
respective elements of the page should successfully
controls be displayed

2. Click on submit A warning message to be The message is Pass


without displayed to the user displayed
selecting the successfully
select boxes

3. Select a faculty If the faculty is selected and The message is Pass


from the select there exists no other HOD displayed

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 66

box in the department, a successfully


successful message is
displayed

4. Select a faculty If the faculty is selected and The message is Pass


from the select there already exists a HOD displayed
box in the department, an invalid successfully
message is displayed

e. Add schedule
SL TEST EXPECTED OUTPUT OBSERVED RESULT (Pass /
NO. SCENARIO OUTPUT Fail)

1. Display the The add schedule page All the elements Pass
form and its should be loaded and all the are displayed
respective elements of the page should successfully
controls be displayed

2. Click on submit A warning message to be The message is Pass


without displayed to the user displayed
selecting the successfully
select boxes

3. Fill in all the If the semester, subject The message is Pass


details and name, day and hour is displayed
submit selected, a successful successfully
message is displayed

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 67

f. Unassign HOD
SL. TEST SCENARIO EXPECTED OBSERVED RESULT
NO OUTPUT OUTPUT (PASS/FAIL)

1 Display the form and The unassign HOD All the elements Pass
its respective page is loaded and are displayed
controls number of faculty successfully
members is with faculty id
displayed
2 Select a faculty id If the faculty id is The message is Pass
and click on submit selected and after displayed
button selecting the faculty successfully
id then it unassign
the HOD
3 Select a faculty from If no faculty is The message is Pass
select box assign as a HOD displayed
then no faculty id is successfully
shown on selection
box

g. Remove Faculty Details


SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (PASS/FAIL)

1 Display the form The remove faculty All the elements are Pass
and its respective page loaded and all displayed
controls the elements of successfully
page is displayed
2 Click on submit A warning message The message is Pass
button with filling is displayed displayed
the text boxes successfully

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 68

3 Filling invalid If the entered The message is Pass


faculty id faculty id is invalid displayed
message is successfully
displayed to the
user
4 Enter the faculty id If the faculty id The message is Pass
in select box valid entered by the displayed
user then the successfully
records should be
deleted and
displayed a
message

h. Faculty Details Search Page


SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (PASS/FAIL)
1 Display the form The search page All the elements Pass
and its respective loaded and all the are displayed
controls elements of page is successfully
displayed
2 Click on search A warning message The message is Pass
button without is displayed displayed
filling the text successfully
boxes
3 Enter the faculty id If the faculty id is The message is Pass
and click on search valid then displayed displayed
button the faculty details of successfully
the particular faculty
id

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 69

i. Add Holiday Page


SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (PASS/FAIL)
1 Display the form The add holiday All the elements Pass
and its respective page loaded and all are displayed
controls the elements of successfully
page is displayed
2 Click on submit A warning message The message is Pass
button without is displayed displayed
entering the date successfully
and description in
the search boxes
3 Enter the date and After entering the The message is Pass
description in the data and description displayed
search boxes its should be added successfully
in the database in
Holidays table

j. Remove Holidays Page


SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (PASS/FAIL)
1 Display the form The remove holiday All the elements Pass
and its respective page loaded and all are displayed
controls the elements of successfully
page is displayed
2 Click on submit A warning message The message is Pass
button without is displayed displayed
entering the date successfully
3 Enter the date and After entering the The message is Pass
click on submit date the particular displayed
button holidays should successfully

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 70

remove from the


database

k. View Holiday Details


SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (PASS/FAIL)
1 Display the form The view holiday The message is Pass
and its respective page loaded and all displayed
controls the elements of successfully
page is displayed
2 Click on submit A warning message The message is Pass
button without is displayed displayed
entered the date successfully
3 Enter the date and After select the date The message is Pass
click on submit from the boxes the displayed is
button holidays details successfully
should be displayed

l. Forgot Password Page


SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (PASS/FAIL)
1 Display the form The forgot The message is Pass
and its respective password page displayed
controls loaded and all the successfully
elements of page is
displayed
2 Click on login A warning message The message is Pass
button without is displayed displayed is
entered the email successfully
and password

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 71

3 Enter the invalid A warning message The message is Pass


email click on is displayed displayed
login successfully
4 Click on forgot After clicking the The message is Pass
password link forgot password displayed
link there a box successfully
should be open then
you entered your
email and click on
submit button then
your password is
automatically send
on your desired
mail id

m. Update student
SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (Pass / Fail)
1. Display the The update All the elements are Pass
form and its student page displayed successfully
respective should be loaded
controls and all the
elements of the
page should
be displayed
2. Click on update A warning The message is Pass
record button message to be displayed successfully
without selecting displayed to the
the user
select boxes

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 72

3. Filling wrong Reg A warning The message is Pass


Id in the text box message to be displayed successfully
displayed to the
user

n. Update faculty
SL. TEST EXPECTED OBSERVED RESULT
NO SCENARIO OUTPUT OUTPUT (Pass / Fail)

1. Display the The update All the elements are Pass


form and its faculty page displayed successfully
respective should be loaded
controls and all the
elements of the
page should
be displayed
2. Click on search A warning The message is Pass
without selecting message to be displayed successfully
the displayed to the
Faculty id in select user
boxes
3. Filling invalid A warning The message is Pass
phone no message to be displayed successfully
displayed to the
user
4. Filling invalid A warning The message is Pass
email id message to be displayed successfully
displayed to the
user

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 73

CONCLUSION
The Time Table Generator is therefore an efficient system for the process of generating
schedules for the classes in educational institutions. It is accurate, time saving and fast in
processing.
It uses a centralized database and hence avoids data redundancy.
It is secure as unauthorized users cannot access the system and is accurate as the entire
process is computerized.
The future enhancement of the software includes, sending notifications to the faculties
and the students via mail. A temporary schedule can be prepared if the faculty is on leave.
The application can also be used to prepare an examination time table as and when
required.
Hence the system time table generator can be used in real world applications.

Department of Computer Science, CHRIST (Deemed to be University)


Time Table Generator 74

BIBLIOGRAPHY

[1]. Time table scheduler, Parkavi A, M.S Ramaiah Institute of Technology


[2]. Automatic Time Table Generator, Saritha M, Pranav Kiran Vaze, Pradeep, Mahesh N
R, UG Scholar, Department of CSE, SDMIT, Ujire, Karnataka, India.
[3]. Tanuja Padale1, Harshada Mane2, Manisha Bhagat3 &amp; Shobha Nangare4
Department of Computer Engineering P.E.S Modern College of Engineering,
Pune (India).
[4]. Automated college timetable generator Adithya R Pai, Ashwitha S, Raksha Shetty,
Prof. Geethalaxmi

Department of Computer Science, CHRIST (Deemed to be University)