0% found this document useful (0 votes)
57 views90 pages

Christ Chatbot

Uploaded by

er54ytrgfdcs
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)
57 views90 pages

Christ Chatbot

Uploaded by

er54ytrgfdcs
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/ 90

CHRIST CHATBOT

PROJECT REPORT

Submitted By
ATYX ANTONY
Reg. No. CCASSCS008
for the award of the Degree of
Bachelor of Science (B.Sc.)
in Computer Science
(University of Calicut)

under the guidance of


Ms. NISHA RAVEENDRAN
Assistant Professor

BSc. COMPUTER SCIENCE


DEPARTMENT OF COMPUTER SCIENCE
CHRIST COLLEGE(Autonomous)
IRINJALAKUDA, KERALA
INDIA

March 2021
DEPARTMENT OF COMPUTER SCIENCE

CHRIST COLLEGE (AUTONOMOUS)

IRINJALAKUDA

CERTIFICATE

This is to certify that the project report entitled ”Christ Chatbot” is a


bonfied record of the project work done by Atyx Antony in partial fulfill-
ment of the requirement for the sixth semester of Bachelor of Computer
Science in Department of Computer Science of CHRIST COLLEGE
(AUTONOMOUS) IRINJALAKUDA

Ms. Nisha Raveendran Ms. Viji Viswanathan


Assistant Professor,CS Head of the Department
Internal Guide Computer Science

EXTERNAL EXAMINER INTERNAL EXAMINER


ACKNOWLEDGEMENT

First and foremost we like to thank Lord almighty for his providence
and for being the guiding light throughout the project. We wish to express
my sincere gratitude to our beloved Department head for giving me all the
facilities for our project. We take this opportunity to express my gratitude
to the class teacher Ms. SINI THOMAS and head of the department Ms.
VIJI VISWANATHAN who has been supported us throughout the course of
this project. We are thankful for her aspiring guidance and valuable advice
during the project work. We express my sincere thanks to my project guide
Ms. NISHA RAVEENDRAN for supporting and guiding throughout the
project.We would take this opportunity to specially thank all other faculty
members for their constant and continuous motivation. Finally we would like
to thank my family and friends for giving valuable advice and moral support
throughout our project.
Declaration
We here by declare that this project work ”CHRIST CHATBOT” sub-
mitted by Christ College (Autonomous)Irinjalakuda,affliated to Calicut Uni-
versity in partial fullfillment of the requirement for the award of the Bache-
lor of Computer Science, is a record of original work done by us,under the
guidance of Ms.NISHA RAVEENDRAN, Department of Computer Science.

Place:Irinjalakuda
Date:

1
ABSTRACT

CHRIST CHATBOT is a system enables the users to interact more


friendly with the College. The Admin can view upload and update their
permitted data.The project enables the users to ask their doubts and Queries
to the chatbot and able to get the result instantly.if the answer is found to
be invalid, admin collects the email address of the user and notify the admin
about the incorrect answer.
Contents
1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 System Analysis 2
2.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Existing System . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.2 Proposed System . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Problem definition . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.3 FEASIBILITY STUDY . . . . . . . . . . . . . . . . . . . . . . . 3
2.3.1 Technical Feasibility . . . . . . . . . . . . . . . . . . . . . 3
2.3.2 Economical Feasibility . . . . . . . . . . . . . . . . . . . . 3
2.3.3 Operational Feasibility . . . . . . . . . . . . . . . . . . . . 3
2.4 Module Description . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4.1 Admin Section . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4.2 User Section . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Software Requirement Specification 5


3.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Overall Description . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3.1 Product Perspective . . . . . . . . . . . . . . . . . . . . . 5
3.3.2 Product Functionality . . . . . . . . . . . . . . . . . . . . 5
3.3.3 Users and Characteristics . . . . . . . . . . . . . . . . . . 5
3.4 Specific Requirements . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . 6
3.4.2 Software Requirements . . . . . . . . . . . . . . . . . . . . 6
3.5 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . 6
3.6 Non Functional Requirements . . . . . . . . . . . . . . . . . . . . 7
3.7 Interface Requirements . . . . . . . . . . . . . . . . . . . . . . . . 8
3.7.1 Hardware interfaces . . . . . . . . . . . . . . . . . . . . . 8
3.7.2 Software interfaces . . . . . . . . . . . . . . . . . . . . . . 8
3.7.3 Communication interfaces . . . . . . . . . . . . . . . . . . 8
3.8 Security Requirements . . . . . . . . . . . . . . . . . . . . . . . . 8
3.9 Platform Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.10 Technologies Used . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Design Document 10
4.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4 Data Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5 Development of the System 12


6 System Testing 13
6.1 Test Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.1.2 Software risk issues . . . . . . . . . . . . . . . . . . . . . . 14
6.1.3 Features to be tested . . . . . . . . . . . . . . . . . . . . . 14
6.2 Test consolidation . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2.1 Test item . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2.2 Input specifications . . . . . . . . . . . . . . . . . . . . . . 15

7 System Implementation and Maintenance 16


7.1 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.2 Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.2.1 Corrective Maintenance . . . . . . . . . . . . . . . . . . . 17
7.2.2 Adaptive Maintenance . . . . . . . . . . . . . . . . . . . . 17
7.2.3 Enhanced Maintenance . . . . . . . . . . . . . . . . . . . 17
7.2.4 Preventive Maintenance . . . . . . . . . . . . . . . . . . . 17

8 Conclusion and Future Scope 18


8.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.2 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Appendix 19

A Data Flow Diagram 19


A.1 External source or receiver . . . . . . . . . . . . . . . . . . . . . . 19
A.2 Transform process . . . . . . . . . . . . . . . . . . . . . . . . . . 20
A.3 Data Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
A.4 Data flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

B Data Flow Diagrams 21


B.1 Level 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
B.2 Level 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
B.3 Level 1.1 - User . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

C ER DIAGRAM 24

D ADMIN INTERFACES 25
D.1 LOGIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
D.2 ADMIN PAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
D.3 VIEW QUERIES . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
D.4 ADD QUERIES . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
D.5 DELETE QUERIES . . . . . . . . . . . . . . . . . . . . . . . . . 29
D.6 UNKNOWN QUESTIONS . . . . . . . . . . . . . . . . . . . . . 30
D.7 LOG TABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
E USER INTERFACES 32
E.1 DUMMY WEBSITE . . . . . . . . . . . . . . . . . . . . . . . . . 32
E.2 CHATBOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
E.3 EMAIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

F CODE 35
Christ College(Autonomous) christ chatbot

Chapter 1
1 Introduction
Chatbot is nothing but a software that will perform automatic tasks.The main
aim of this chatbot was immediate response reaction and consistent connectiv-
ity.Chatbot is a computer application which may speak to human beings natu-
rally, the way we interact with one another.It can replace a person for several
tasks of answering queries. Chatbots make use of machine learning to succeed
in AI helping them to know the user query and supply an appropriate response.
The main features of the upgraded chatbot are – Automated customer support
for similar queries,Save human resources for qualitative tasks,Accelerate opera-
tions.

1.1 Overview
The objective of the christ chatbot is to design an simple and adaptable chatbot
for the website which helps users access the website, register and retrieve useful
information regarding the same.It provides a rapid clearing of each and every
queries related to christ college and in which users can know about every aspect
about the christ college .The project includes many functions such as clearing
queries, and to perform different functions.

Department of Computer Science 1


Christ College(Autonomous) christ chatbot

Chapter 2
2 System Analysis
2.1 Purpose
After analyzing the requirements of the task to be performed , the next step is to
analyse the problem and understand its content. The first activity in the phase
is studying the existing system and other is to understand the requirements and
domain of the new system. Both the activities are equally important , but the
first activity serves as a basis of giving the functional specifications and then
successful design of the proposed system. Understanding the properties and
requirements of the new system is more difficult and requires creative think-
ing understand of existing of running system. The improper understanding of
present system can lead diversion from solution.

2.1.1 Existing System


Existing system is a college website with no chatbot.Traditionally , the chat bot
system is not known to people who are not more into the technology.Users need
to manually visit the College website to get their queries answered.This process
may lead to communication gap between user and the website.This process
consumes lot of time.

2.1.2 Proposed System


Proposed system is a website with college enquiry chatbot.Chatbot is built
using artificial algorithms that analyses user’s queries and understand user’s
message.This system is a web application which provides answer to the query of
the user.User just have to query through the bot which is used for chatting.User
can chat using any format there is no specific format the user has to follow.The
answers are appropriate corresponding user queries.The user can query about
the college website related activities through online with the help of this web
application.If the answer found to invalid,user just need to submit their email
which will notify the admin about the incorrect answer and then the admin will
reply the answer.

2.2 Problem definition


In this existing system users need to manually visit the college office to get their
queries answered. This process may lead to communication gap between user
and the college staff.This process consumes lot of time. Here we are proposing
a chatbot system along with the website to make it more user friendly.

Department of Computer Science 2


Christ College(Autonomous) christ chatbot

2.3 FEASIBILITY STUDY


Feasibility study consists of activities which determine existing scope of devel-
oping an information system to the organization. This study should be done
throughout of life cycle. In a project at one point of time it may seem that
the project is feasible. But after proceeding one or two phases it may become
infeasible. So it is necessary to evaluate the feasibility of a project at the earliest
possible time. Feasibility study starts from the preliminary investigation phase.
At the stage the analyst estimates the urgency of the project and estimates
the development cost. The next check point is problem analysis. At this stage
the analyst studies current system. He does it to understand the problem in
the better way. It helps him to make better estimates of development cost and
also to find out the benefits to be obtained from the new system. In feasibility
analysis we have to study the following.

2.3.1 Technical Feasibility


Technical feasibility concerned with the availability of hardware and software
required for the de- velopment of the system to see compatibility and maturity
of the technology proposed to be used and to see the availability of the required
technical man power to develop the system.

2.3.2 Economical Feasibility


Operational feasibility is all about problems that may arise during operations.
There are two as- pects related with this issue.
What is the possibility that the solution developed may not be put to use
or may not work?
What is the inclination of the management and end users towards the solu-
tion?
Through , there is very least possibility of management being averse to the
solution there is sig- nificant probability that the end users may not be interested
in using the solution due to lack of training , insight etc.

2.3.3 Operational Feasibility


It is the measure of cost effectiveness of the project . The economic feasibility
is nothing but budgeting whether the possible benefit of solving the problem is
worthwhile or not. At the feasibility study level , it is impossible to estimate the
cost because customer’s requirements and alternative solutions have not been
identified at this stage.

Department of Computer Science 3


Christ College(Autonomous) christ chatbot

2.4 Module Description


It contains two main modules and two submodules.
ˆ Admin

ˆ User

2.4.1 Admin Section


Admin will have the following Functionalities
ˆ Admin is the one who adds the questions and corresponding answers in
the Chatbot.

ˆ Admin can access the system at any time

ˆ Admin can Delete and Update the Queries

ˆ Add and Update features of chatbot

2.4.2 User Section


User will have the following Functionalities

ˆ User is the one who ask queries related to the Christ College.

ˆ User can view the result of each event in their Screen.

Department of Computer Science 4


Christ College(Autonomous) christ chatbot

Chapter 3
3 Software Requirement Specification
3.1 Purpose
The purpose of this document is to give a detailed description of the require-
ments for the CHRIST CHATBOT. It illustrate the purpose and complete de-
scription for the development of the system. It explain system constraints,
interface and interactions with other external applications. This document is
primarily intended to be proposed to a college for conducting Techfest and a
reference for the upcoming students of the college.

3.2 Scope
This is a chatbot system developed to help the visiters of the College website
to get the services more easily.This chatbot has php at the front end and mysql
at the back end,will record product related activities in a secured manner.The
concept of this chatbot system is that the Office Staffs to make their job easy.

3.3 Overall Description


This section will give an overview of our project ”CHRIST CHATBOT” . This
system enables the users to interact more friendly with the College. The Ad-
min can view upload and update their permitted data.The project enables the
users to ask their doubts and Queries to the chatbot and able to get the result
instantly.if the answer is found to be invalid, admin collects the email address
of the user and notify the admin about the incorrect answer.

3.3.1 Product Perspective


CHRIST CHATBOT is mainly used for automating College Website. The chat-
bot can used for the whole control of the college website purpose. It can clear
all queries about the college

3.3.2 Product Functionality


Through this system admin can add questions and answers. user can get the
answers instantly from the bot.

3.3.3 Users and Characteristics


There are two types of users that interact with the chatbot students and ad-
min.Admin can add questions and answers , admin can delete and update ques-
tions and answers. User or Students can ask their queries related to the college
and get the result instantly.

Department of Computer Science 5


Christ College(Autonomous) christ chatbot

3.4 Specific Requirements


3.4.1 Hardware Requirements
ˆ System: IBM-Compatible PC

ˆ Processor: Pentium IV or above

ˆ Speed: Above 1GHz

ˆ RAM capacity: 512 MB

ˆ Hard Dsk drive: 40 GB

ˆ Keyboard: Standard

ˆ Mouse: Standard

ˆ Monitor: SVGA Color

3.4.2 Software Requirements


ˆ Operating System:Windows or ubuntu

ˆ Languages used: PHP

ˆ Database : MySql

ˆ Technologies used: HTML,Javascript,CSS,Ajax,NLP

3.5 Functional Requirements


It contains three main modules.
ˆ 1.Admin

ˆ 2.User or Student

Admin
The Admin can add and view the questions into chatbot.Admin can update and
delete questions inserted into chatbot.The admin can also analyse the data and
store the FAQs.

User
User can ask any queries about the college and the chatbot is capable of clearing
all doubts of users. User can also view the results of each event in their chat
window.

Department of Computer Science 6


Christ College(Autonomous) christ chatbot

3.6 Non Functional Requirements


Non-functional requirements define the overall qualities or attributes of the re-
sulting system. Non-functional system place restrictions on the product be-
ing developed, the developed process, and specify external constraints that the
product must meet. Examples of non-functional requirements include safety,
security, usability, reliability and performance requirements. Project manage-
ment issues (costs, time and schedule) are often considered as non-functional
requirements. The principal non - functional constraints which are relevant to
critical systems :
ˆ performance

ˆ security

ˆ safety

ˆ usability

Performance
Performance requirements concern the speed of operation of a system. Types
of performance requirements :
ˆ Response requirements (how quickly the system reacts to a user input).

ˆ Throughput requirements (how much the system can accomplish within a


specified amount of time).
ˆ Availability requirements. The speed of operation of this system is ade-
quate for the requirements.
Reliability

ˆ Reliability is the ability of a system to perform its required function under


stated conditions for a specified period of time.
ˆ constraints on the runtime behavior of the system. This system is reliable
because its functionalities can be done on the required conditions.

Safety
Safety requirements are not required which exclude unsafe situation from
the possible solution of the system.

Department of Computer Science 7


Christ College(Autonomous) christ chatbot

Usability
Usability is the ease with which a user can learn to operate, prepare inputs
for, and interpret outputs of system or components. Usability requirements
include :
ˆ information error messages.

ˆ well-formed user interfaces.

3.7 Interface Requirements


3.7.1 Hardware interfaces
The system must run over the internet, all the hardware shall require to connect
internet will be hardware interface for the system. As for example modem,
WAN-LAN.

3.7.2 Software interfaces


Software interface required for the working of the project is the appropriate
operating system.

3.7.3 Communication interfaces


The user of the site communicate using the network connectivity and the data
set is accessed

3.8 Security Requirements


ˆ User accesses only their account.

ˆ Validation of input is handled.

ˆ This application containing the computer systems is physically secured


against arms or surreptitious entry by intruders.
ˆ Users must be authorized carefully to reduce changes of any such user
giving access to an intruder in exchange for a bribe or other favour.

3.9 Platform Used


Windows 10 is a major version of the Microsoft Windows operating system
that was released on July 29, 2015.It is built on the Windows NT kernel and
follows windows 8.Part of the reason Microsoft decided to name the 2015 release
”Windows 10”(and skipped ”windows 9”)is because the operating system is
designed to be a new direction for Microsoft. One of the primary aims of
windows 10 is to Unify the windows experience across multiple devices, such
desktop computers, tablets, and smartphones. As part of this effort, Microsoft
developed Windows10 Mobile alongside Windows 10 to replaces Windows Phone

Department of Computer Science 8


Christ College(Autonomous) christ chatbot

- Microsoft’s previous mobile OS. Windows 10 also integrates other Microsoft


services, such as Xbox Live and the Cortana voice recognition assistant.

3.10 Technologies Used


PHP
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited for web
development and can be embedded into HTML. What distinguishes PHP from
something like client-side Javascript is that the code is executed on the server,
generating HTML which is then sent to the client. The client would receive the
results of that script, but would not know what the underlying code was. You
can even configure your web server to process all your HTML files with PHP,
and then there’s really no way that users can tell what you have up your sleeve.
The best things in using PHP are that it is extremely simple for a newcomer,
but offers many advanced features for a professional programmer.

MySQL
MySQL, pronounced either ”My S-Q-L” or ”My Squel, ” is an open source
relational database management system. It is based on the structure query
language (SQL), which is used for adding, removing and modifying information
in the database. Standard SQL commands, such as ADD, DROP, INSERT,and
UPDATE can be used with MySQL.
What distinguishes PHP from something like client - side Javascript is that
the code is executed on the server, generating HTML which is then sent to the
client. The client would receive the results of running that script, but would not
know what the underlying code was. You can even configure your web server
to process all your HTML files with PHP, and then there’s really no way that
users can tell what you have up your sleeve. The best things in using PHP are
that it is extremely simple for a newcomer, but offers many advanced features
for a professional programmer.

Department of Computer Science 9


Christ College(Autonomous) christ chatbot

Chapter 4
4 Design Document
4.1 Purpose
This system enables the users to interact more friendly with the College. The
Admin can view upload and update their permitted data.The project enables
the users to ask their doubts and Queries to the chatbot and able to get the
result instantly.if the answer is found to be invalid, admin collects the email
address of the user and notify the admin about the incorrect answer. Purpose
of this document is to give the detailed description of the architecture and sys-
tem design for the software.The system design document shows the software will
be structured to satisfy the requirement identified in the software requirement
specification.It is a translation of requirements into a description of the software
structure,software component,interfaces and data necessary for the implemen-
tation phase.In a complete software design document,each requirements must
be traceable to one or more design entities.

4.2 Scope
CHRIST CHATBOT is a web application which helps in automating the work
of the office staff. It also helps the students to clear their queries very effectively.

4.3 Overview
The purpose of this document is to help the reader to visualize the solution to
the project presented.This document verifies how the design meet the require-
ment stimulated in the SRS document through design viewpoints.The design
viewpoints will cover all design elements presented before. This document will
provide a direct approach to the development of this project hence reducing
feature creep and ponitedly determine the quality of the design.

4.4 Data Design


Database are the storehouses of data used in the software systems.The data is
stored in tables inside the database.Several tables are created for the manipu-
lation of the data for the system.Two essential settings for a database are

ˆ Primary Key- The field that is unique for all the record occurrence.

ˆ Foreign Key- The field used to set relation between tables.

Normalization
ˆ Normalization is the process of organizing the data in the database.

Department of Computer Science 10


Christ College(Autonomous) christ chatbot

ˆ Normalization is used to minimize the redundancy from a relation or set


of relations. It is also used to eliminate the undesirable characteristics like
Insertion, Update and Deletion Anomalies.
ˆ Normalization divides the larger table into the smaller table and links
them using relationship.

ˆ The normal form is used to reduce redundancy from the database table.

Tables
Chatbot feeds
Name DataType Constraints Description
id int(11) Primarykey ID of query
queries varchar(100) Notnull Query requested by the user
replies varchar(250) Notnul Answer to the user

Unknown
Name DataType Constraints Description
email int(11) primarykey email from the user
query int(9) Notnull query entered by userl
status int(9) Notnull status of the query

LOG TABLE
Name DataType Constraints Description
user query int(9) Primarykey query entered by user
count varchar(200) Notnull count the user query

Department of Computer Science 11


Christ College(Autonomous) christ chatbot

Chapter 5
5 Development of the System
A chatbot is a software program for stimulating intelligent conversations with
human using artificial intelligence. It allows a form of interaction between a
human and a machine through messages. The dynamic intelligence of chatbots
will allow them to converse with users as in the way we converse and commu-
nicate in real life situations. Chatbots are being built to handle user requests,
provide relevant information and to look for to seek information. To implement
these modules different input screens,controls,events are used.Controls used in
the forms are textbox, option button,buttons etc. Admin is the one who adds
the questions and corresponding answers in the chatbot. User is the one who
ask queries related to the college.

Department of Computer Science 12


Christ College(Autonomous) christ chatbot

Chapter 6
6 System Testing
Testing is the penultimate step of software development. An elaborate testing
of data is prepared and the system is using the test data. While doing testing,
errors are noted and correction is made. The users are trained to operate the
developed system. Both hardware and software securities are made to run the
developed system successfully. System testing is aimed at ensuring the system
works accurately before the live operation commences. Testing is vital to the
system. System testing makes a logical assumption that if all parts of the system
are correct, the goal will be successfully achieved. The proposal Tracking system
is subjected to a variety of tests, unit testing, integration testing and system
testing. A series of testing are performed for the proposed system before the
system is ready for user acceptance testing. Nothing is complete without testing
as is vital success of the system. Normally, testing of any Large Systems will be
in two parts, The functional verification and validation against the Requirement
Specification and performance evaluation against the indicated requirements.
Testing activity is involved right from the beginning of the project. At the very
first stage of testing, the goals and objectives are set. This simplifies the limits
or borders of testing process. Before testing, the tester should plan what kind
of data he is giving for test. Give data inputs as functional, boundary, stress,
performance, usability values etc. The characteristics of a good test are tests
are likely to catch bugs no redundancy.

6.1 Test Plan


6.1.1 Scope
This test plan will cover the following testing activities as identified in the testing
strategy.

ˆ White Box Testing

White box testing is a testing technique, that examines the program structure
and derives test data from the program logic/code. In white box testing, the
UI is bypassed. Inputs and outputs of ratings are tested directly at the code
level and the results are compared against specifications. It Reveals errors in
”hidden” code.
ˆ Black Box Testing

Black - box testing is a method of software testing that examines the function-
ality of an application based on the specifications. Black box testing typically
involves running through every possible input to verify that it results in the
right outputs using the software as an end - user would.

Department of Computer Science 13


Christ College(Autonomous) christ chatbot

ˆ Unit Testing
The module includes four main components to undergo unit testing. It checks
the syntax error, logic error and validity of the program correctness. This test
will be performed by the developers.
ˆ Integration Testing
After all components pass the unit testing, they get to be tested whether they
work correctly when they are running concurrently and communicating to each
other. Integration tests exercise an entire subsystem and ensure that a set of
components play nicely together.
ˆ Internal Data Testing
We will test the validity of the data before it enters the database to avoid any
problems that may face us in the database. We will test the encryption of the
personal information of all the users along with the user names and passwords
to ensure maximum security of the users privacy.

6.1.2 Software risk issues


In this section, the plan is to test the risk involved in critical issues such as:
Difficult to run on visual studio due to large loading time. Some inherent
software risks such as complexity exist; also these issues need to be identified.
Proper network connection Working of Mysql database

6.1.3 Features to be tested


ˆ Test whether correct user name and password allows you to login.
ˆ Test whether invalid user name and password prevents you from login.
ˆ Test whether there is any connection problem in the Server.
ˆ Test whether the student and admin details are entered correctly.
ˆ Test whether invalid data entry allows saving data successfully.
ˆ Test whether all pages are loaded correctly.
ˆ Test whether watermark is embedded and extracted properly.
ˆ Test whether the provided security works correctly.

6.2 Test consolidation


6.2.1 Test item
The items or features to be tested in the test cases are included in the document.
Each and every user input is tested. The present condition of the system is
tested. It is checked to make sure that environment is ready for the application
to work.

Department of Computer Science 14


Christ College(Autonomous) christ chatbot

6.2.2 Input specifications


These are the inputs required to execute the test case. All required inputs in-
cluding data elements and values are given below.

Department of Computer Science 15


Christ College(Autonomous) christ chatbot

Chapter 7
7 System Implementation and Maintenance
7.1 Implementation
System implementation is a conversion of a new system into an operating one
which involves creating compatible files ,training clients , and installing hard-
ware. User training is crucial for minimizing resistance to change and giving
chance to prove its worth. Training aids user friendly manuals and healthy
screens provide the user with a good start. Software maintenance follows con-
version to the extent that changes are necessary to maintain satisfactory opera-
tions relative to changes in the users environment. Maintenance often includes
minor enhancements or corrections to the problem that surface late in the sys-
tem operations. In the implementation phase, the team builds the components
either from scratch or by composition. Given the architecture document from
the design phase and the requirement document from the analysis phase, the
team should build the exactly what has been requested, through there is still
room for innovation and flexibility. For example, a component may be narrowly
designed for this particular system , or the component may be made more gen-
eral to satisfy reuse guideline. The architecture document should give guidance.
Sometimes, this guidance is found in the requirement document. The implemen-
tation phase deals with issues of quality ,performance , baselines, libraries, and
debugging. The end deliverable is the product itself. During the implementa-
tion phase, the system is build according to the specifications from the previous
phases. This includes writing code, performing code reviews, performing test,
selecting components for configuration and integration. The implementation
includes the following things.

ˆ Careful planning

ˆ Investigation of system and constraints

ˆ Design the methods to achieve changeover.

ˆ Training the staff in the changed phase.

ˆ Evaluation of change over method.

ˆ The method of implementation and time scale to be adopted are found


out initially.

7.2 Maintenance
This phase occurs as a result of deploying the whole system at the end users
organization. They will perform the beta testing at the end users and inform to
the developers about any needed modification to the application. The customer

Department of Computer Science 16


Christ College(Autonomous) christ chatbot

records all the problems that are encountered during the beta testing and reports
these to the developer at regular intervals.

7.2.1 Corrective Maintenance


Even with the best quality assurance activities, it is likely that the customer will
uncover defects in the software. Corrective maintenance changes the software
to correct the defects. Corrective Maintenance activity may consist of repair,
restoration or replacement of equipment. This activity will be result of a regular
inspection, which identifies the failure in time for corrective maintenance to be
planned and scheduled, then performed during a routine maintenance shutdown.

7.2.2 Adaptive Maintenance


Over time, the original environment(CPU, operating system, business rules,
external product characteristics) for which the software was developed is likely
to change. Adaptive maintenance results in modification to the software to
accommodate changes to its external environment.

7.2.3 Enhanced Maintenance


As software is used, the customer/user will recognize additional functions that
will provide the benefit. Perfect maintenance extends the software beyond its
original functional requirements.

7.2.4 Preventive Maintenance


Computer software deteriorates due to change, and because of this preventive
maintenance often called software re-engineering, must be conducted to en-
able the software to serve the needs of its end users. Preventive maintenance
makes changes to computer programs so that they can be more easily corrected,
adapted and enhanced.

Department of Computer Science 17


Christ College(Autonomous) christ chatbot

Chapter 8
8 Conclusion and Future Scope
8.1 Conclusion
There are two types of users that interact with the system Admin and Stu-
dent.Each of these two types has different uses of the system .Admin can manage
all the features of chatbot dynamically by login on admin panel. If the answer
is found to be invalid, admin collects the email address of the user and notify
the admin about the incorrect answer.The user can ask any queries about the
college and the chatbot is capable of clearing all doubts of users. User can also
view the results of each event in their chat window.

8.2 Future Scope


ˆ In the future enhancement of our project, we can include speech based
questions and responses.
ˆ The user just needs to provide voice-based input and the developed bot
will provide the text-based output.just by means of speech-to-text, we can
improve the functionality of our project.

Department of Computer Science 18


Christ College(Autonomous) christ chatbot

Appendix
A Data Flow Diagram
Data flow is the one of the best way of documenting the entire functionality
of the system.For the system ,which will have data flows in and have some
processing inside and then some data flow out from the system can be docu-
mented or represented effectively by means of data flow out from the system
can be documented or represented effectively by means of data flow diagrams.
The data flow diagram are a diagrammatic representation of the system,which
has input,process and output.Once any system is represented using a data flow
diagram we can identify the following things easily:
ˆ Various entities interacting with the system are identified

ˆ Flow of data from one entity to another is identified

ˆ The various processes involved in between the interaction of two or more


entities in the system are clearly pointed out
ˆ The various data stores which hold the data in between the process,are
clearly identified

Some Data Flow Diagram charting forms:

A.1 External source or receiver

A source or sink is a person or part of organization ,which enters or receives


information from the system,but is considered to be outlining the contest of
data flow model.

Department of Computer Science 19


Christ College(Autonomous) christ chatbot

A.2 Transform process

A process represents transformation where incoming data flowsare changed


into outgoing data flow

A.3 Data Store

A data store is repository of data that is to be stored for use by one or


more process may be as simple as buffer or queue or sophisticated as relational
database. They should have clear names.If a process merely uses the contest
of store and does not alter it,the arrowhead goes only form the store to the
process. If a process alters the details in the store then double-headed arrow is
used.

A.4 Data flow

A data flow is a route, which enable packets of data to travel from one point
to another.Data may flow,with arrowhead pointing in the direction of the flow

Department of Computer Science 20


Christ College(Autonomous) christ chatbot

B Data Flow Diagrams


B.1 Level 0

Department of Computer Science 21


Christ College(Autonomous) christ chatbot

B.2 Level 1

Department of Computer Science 22


Christ College(Autonomous) christ chatbot

B.3 Level 1.1 - User

Department of Computer Science 23


Christ College(Autonomous) christ chatbot

C ER DIAGRAM

Department of Computer Science 24


Christ College(Autonomous) christ chatbot

D ADMIN INTERFACES
D.1 LOGIN

Department of Computer Science 25


Christ College(Autonomous) christ chatbot

D.2 ADMIN PAGE

Department of Computer Science 26


Christ College(Autonomous) christ chatbot

D.3 VIEW QUERIES

Department of Computer Science 27


Christ College(Autonomous) christ chatbot

D.4 ADD QUERIES

Department of Computer Science 28


Christ College(Autonomous) christ chatbot

D.5 DELETE QUERIES

Department of Computer Science 29


Christ College(Autonomous) christ chatbot

D.6 UNKNOWN QUESTIONS

Department of Computer Science 30


Christ College(Autonomous) christ chatbot

D.7 LOG TABLE

Department of Computer Science 31


Christ College(Autonomous) christ chatbot

E USER INTERFACES
E.1 DUMMY WEBSITE

Department of Computer Science 32


Christ College(Autonomous) christ chatbot

E.2 CHATBOT

Department of Computer Science 33


Christ College(Autonomous) christ chatbot

E.3 EMAIL

Department of Computer Science 34


Christ College(Autonomous) christ chatbot

F CODE
admin index.php
[breaklines=true]
<!DOCTYPE html>
<html lang="zxx" class="no-js">

<head>
<!-- Mobile Specific Meta -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Favicon-->
<link rel="shortcut icon" href="img/fav.png">
<!-- Author Meta -->
<meta name="author" content="CodePixar">
<!-- Meta Description -->
<meta name="description" content="">
<!-- Meta Keyword -->
<meta name="keywords" content="">
<!-- meta character set -->
<meta charset="UTF-8">
<!-- Site Title -->
<title>ChatBot Admin</title>
<!--
CSS
============================================= -->
<link rel="stylesheet" href="css/linearicons.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/themify-icons.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/nice-select.css">
<link rel="stylesheet" href="css/nouislider.min.css">
<link rel="stylesheet" href="css/ion.rangeSlider.css" />
<link rel="stylesheet" href="css/ion.rangeSlider.skinFlat.css" />
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/main.css">

<style>
.christ{
background:url(’assets/images/christ.jpg’);
background-repeat: no-repeat;
background-size:100
}
</style>
</head>

Department of Computer Science 35


Christ College(Autonomous) christ chatbot

<body>

<!-- Start Header Area -->


<header class="header_area sticky-header">
<div class="main_menu">
<nav class="navbar navbar-expand-lg navbar-light main_box">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<a class="navbar-brand logo_h" href="index.html">
<!--<img src="img/logo.png" alt="">--></a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse offset" id="navbarSupportedContent">
<ul class="nav navbar-nav menu_nav ml-auto">
<li class="nav-item active"><a class="nav-link" href="admin_index.php">
Home</a></li>
<!-- <li class="nav-item submenu dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true"
aria-expanded="false">Shop</a>
<ul class="dropdown-menu">
<li class="nav-item"><a class="nav-link" href="category.html">
Shop Category</a></li>
<li class="nav-item"><a class="nav-link" href="single-product.html">
Product Details</a></li>
<li class="nav-item"><a class="nav-link" href="checkout.html">
Product Checkout</a></li>
<li class="nav-item"><a class="nav-link" href="cart.html">Shopping Cart
</a></li>
<li class="nav-item"><a class="nav-link" href="confirmation.html">
Confirmation</a></li>
</ul>
</li>
<li class="nav-item submenu dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true"
aria-expanded="false">Blog</a>
<ul class="dropdown-menu">

Department of Computer Science 36


Christ College(Autonomous) christ chatbot

<li class="nav-item"><a class="nav-link" href="blog.html">Blog</a></li>


<li class="nav-item"><a class="nav-link" href="single-blog.html">Blog Details</a></li>
</ul>
</li>
<li class="nav-item submenu dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true"
aria-expanded="false">Pages</a>
<ul class="dropdown-menu">
<li class="nav-item"><a class="nav-link" href="login.html">
Login</a></li>
<li class="nav-item"><a class="nav-link" href="tracking.html">
Tracking</a></li>
<li class="nav-item"><a class="nav-link" href="elements.html">
Elements</a></li>
</ul>
</li>-->
<li class="nav-item"><a class="nav-link" href="listqueries.php">View Queries</a></li>
<li class="nav-item"><a class="nav-link" href="listadd1.php">Add Queries</a></li>
<li class="nav-item"><a class="nav-link" href="listdelete.php">Delete Queries</a></li>
<li class="nav-item"><a class="nav-link" href="admin_login.php">Logout</a></li>
<li class="nav-item"><a class="nav-link" href="listunknown.php">
Un Attended Queries</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item"><a href="#" class="cart"><span class="ti-bag">
</span></a></li>
<li class="nav-item">
</li>
</ul>
</div>
</div>
</nav>
</div>
</header>
<!-- End Header Area -->

<!-- start banner Area -->


<section class="banner-area christ">
<div class="container">
<div class="row fullscreen align-items-center justify-content-start">
<div class="col-lg-12">
<!-- <div class="active-banner-slider"> -->
<!-- single-slide -->
<div class="row single-slide align-items-center d-flex">
<div class="col-lg-5 col-md-6">

Department of Computer Science 37


Christ College(Autonomous) christ chatbot

<div class="banner-content">
</div>
</div>
<div class="col-lg-7">
<div class="banner-img">
<!-- <img class="img-fluid" src="assets\images\christ.jpg" alt="christ"> -->
</div>
</div>
</div>
<!-- single-slide -->
<div class="row single-slide">
<div class="col-lg-5">
<div class="banner-content">

</div>
</div>
<div class="col-lg-7">
<div class="banner-img">
<!-- <img class="img-fluid" src="assets\images\christ.jpg" alt=""> -->
</div>
</div>
</div>
<!-- </div> -->
</div>
</div>
</div>
</section>
<!-- End banner Area -->

<!-- start features Area -->

<!-- single product slide -->


<!-- End brand Area -->

<!-- start footer Area -->


<footer class="footer-area section_gap">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="single-footer-widget">
<h6></h6>
<p>
</p>
</div>
</div>

Department of Computer Science 38


Christ College(Autonomous) christ chatbot

<div class="col-lg-4 col-md-6 col-sm-6">


<div class="single-footer-widget">
<h6>Newsletter</h6>
<p>Stay update with our latest</p>
<div class="" id="mc_embed_signup">

<form target="_blank" novalidate="true" action="https://


spondonit.us12.list-manage.com/subscribe/post?u=1462626880ade1ac87bd9c93a&amp;id=92a4423d01"
method="get" class="form-inline">

<div class="d-flex flex-row">

<input class="form-control" name="EMAIL" placeholder="Enter Email"


onfocus="this.placeholder = ’’" onblur="this.placeholder = ’Enter Email ’"
required="" type="email">

<button class="click-btn btn btn-default">


<i class="fa fa-long-arrow-right"
aria-hidden="true"></i></button>
<div style="position: absolute; left: -5000px;">
<input name="b_36c4fd991d266f23781ded980_aefe40901a"
tabindex="-1" value="" type="text">
</div>

<!-- <div class="col-lg-4 col-md-4">


<button class="bb-btn btn"><span class="lnr lnr-arrow-right">
</span></button>
</div> -->
</div>
<div class="info"></div>
</form>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="single-footer-widget mail-chimp">
<h6 class="mb-20">Instragram Feed</h6>
<ul class="instafeed d-flex flex-wrap">
<li><img src="img/i1.jpg" alt=""></li>
<li><img src="img/i2.jpg" alt=""></li>
<li><img src="img/i3.jpg" alt=""></li>
<li><img src="img/i4.jpg" alt=""></li>
<li><img src="img/i5.jpg" alt=""></li>
<li><img src="img/i6.jpg" alt=""></li>
<li><img src="img/i7.jpg" alt=""></li>

Department of Computer Science 39


Christ College(Autonomous) christ chatbot

<li><img src="img/i8.jpg" alt=""></li>


</ul>
</div>
</div>
<div class="col-lg-2 col-md-6 col-sm-6">
<div class="single-footer-widget">
<h6>Follow Us</h6>
<p>Let us be social</p>
<div class="footer-social d-flex align-items-center">
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-dribbble"></i></a>
<a href="#"><i class="fa fa-behance"></i></a>
</div>
</div>
</div>
</div>
<div class="footer-bottom d-flex justify-content-center
align-items-center flex-wrap">
<p class="footer-text m-0"><!-- Link back to Colorlib
can’t be removed.
Template is licensed under CC BY 3.0. -->
Copyright &copy;<script>document.write
(new Date().getFullYear());</script> All rights reserved | This template is
made with <i class="fa fa-heart-o" aria-hidden="true">
</i> by <a href="https://colorlib.com" target="_blank">
Colorlib</a>
<!-- Link back to Colorlib can’t be removed.
Template is licensed under CC BY 3.0. -->
</p>
</div>
</div>
</footer>
<!-- End footer Area -->

<script src="js/vendor/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/
umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/
4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4"
crossorigin="anonymous"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/jquery.ajaxchimp.min.js"></script>
<script src="js/jquery.nice-select.min.js"></script>
<script src="js/jquery.sticky.js"></script>
<script src="js/nouislider.min.js"></script>
<script src="js/countdown.js"></script>

Department of Computer Science 40


Christ College(Autonomous) christ chatbot

<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<!--gmaps Js-->
<script src="https://maps.googleapis.com/maps/api/js?key=
AIzaSyCjCGmQ0Uq4exrzdcL6rvxywDDOvfAu6eE"></script>
<script src="js/gmaps.min.js"></script>
<script src="js/main.js"></script>
</body>

</html>

admin login.php

<!--
Author: WebThemez
Author URL: http://webthemez.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content=
"free-educational-responsive-web-template-webEdu">
<meta name="author" content="webThemez.com">
<title>Subject Aptitude Test</title>
<link rel="favicon" href="assets/images/favicon.png">
<link rel="stylesheet" media="screen" href="http://fonts.googleapis.com/css?
family=Open+Sans:300,400,700">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<!-- Custom styles for our template -->
<link rel="stylesheet" href="assets/css/bootstrap-theme.css" media="screen">
<link rel="stylesheet" href="assets/css/style.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5
elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>

Department of Computer Science 41


Christ College(Autonomous) christ chatbot

<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<!-- Button for smallest screens -->
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span><span class="icon-bar">
</span><span class="icon-bar"></span></button>
<a class="navbar-brand" href="index.html">
<!--<img src="assets/images/logo.png"
alt="Techro HTML5 template"></a>-->
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav pull-right mainNav">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="admin_login.php">Login</a></li>
<!-- <li><a href="price.html">Price</a></li>
<li><a href="videos.html">Videos</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Pages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="sidebar-right.html">Right Sidebar</a></li>
<li><a href="#">Dummy Link1</a></li>
<li><a href="#">Dummy Link2</a></li>
<li><a href="#">Dummy Link3</a></li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>-->

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

<header id="head" class="secondary">


<div class="container">
<h1>Login</h1>
<p></p>
</div>
</header>

Department of Computer Science 42


Christ College(Autonomous) christ chatbot

<!-- container -->


<div class="container">
<div class="row">
<div class="col-md-12">
<h3 class="section-title"></h3>
<!-- <p>
Lorem Ipsum is inting and typesetting in simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the is dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
specimen book.
</p>
-->
<form class="form-light mt-20" role="form" action="admin_loginpageprocess.php"
method="post">
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control" name="myusername"
placeholder="User name" >
</div>
<!--<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control" placeholder="Email address">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" placeholder="Password">
</div>
</div>
</div>-->
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" name="mypassword"
placeholder="Password">
</div>
<!-- <div class="form-group">
<label>Message</label>
<textarea class="form-control" id="message" placeholder="Write you
message here..." style="height:100px;"></textarea>
</div>-->
<input type="submit" class="btn btn-two" value="LOGIN"

Department of Computer Science 43


Christ College(Autonomous) christ chatbot

name="submit"><p><br/></p>
<a href="register.php"><input type="button" class="btn btn-two"
value="REGISTER"
name="submit"></a><p><br/></p>

</form>
</div>
<!--<div class="col-md-4">
<div class="row">
<div class="col-md-6">
<h3 class="section-title">Office Address</h3>
<div class="contact-info">
<h5>Address</h5>
<p>5th Street, Carl View - United States</p>
<h5>Email</h5>
<p>[email protected]</p>
<h5>Phone</h5>
<p>+09 123 1234 123</p>
</div>
</div>
</div>
</div>-->
</div>
</div>
<!-- /container -->

<footer id="footer">
<!-- <div class="container">
<div class="row">
<div class="footerbottom">
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>
Course Categories
</h4>
<div class="menu-course">
<ul class="menu">
<li><a href="#">
List of Technology
</a>
</li>
<li><a href="#">
List of Business
</a>
</li>
<li><a href="#">

Department of Computer Science 44


Christ College(Autonomous) christ chatbot

List of Photography
</a>
</li>
<li><a href="#">
List of Language
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>
Products Categories
</h4>
<div class="menu-course">
<ul class="menu">
<li> <a href="#">
Individual Plans </a>
</li>
<li><a href="#">
Business Plans
</a>
</li>
<li><a href="#">
Free Trial
</a>
</li>
<li><a href="#">
Academic
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>
Browse by Categories
</h4>
<div class="menu-course">
<ul class="menu">
<li><a href="#">
All Courses

Department of Computer Science 45


Christ College(Autonomous) christ chatbot

</a>
</li>
<li> <a href="#">
All Instructors
</a>
</li>
<li><a href="#">
All Members
</a>
</li>
<li>
<a href="#">
All Groups
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4></h4>
<p></p>
<div class="contact-info">
<i class="fa fa-map-marker"></i> <br>
<i class="fa fa-phone"></i>+00 123 156 711 <br>
<i class="fa fa-envelope-o"></i>
</div>
</div><!-- end widget -->
</div>
</div>
</div>
<div class="social text-center">
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-dribbble"></i></a>
<a href="#"><i class="fa fa-flickr"></i></a>
<a href="#"><i class="fa fa-github"></i></a>
</div>

<div class="clear"></div>
<!--CLEAR FLOATS-->
</div>
<div class="footer2">
<div class="container">
<div class="row">

Department of Computer Science 46


Christ College(Autonomous) christ chatbot

<div class="col-md-6 panel">


<div class="panel-body">
<p class="simplenav">
<a href="index.html">Home</a> |
<!--<a href="admin_login.php">Admin</a> |
<a href="hod_login.php">HOD</a>-->
</p>
</div>
</div>

<div class="col-md-6 panel">


<div class="panel-body">
<p class="text-right">
Copyright &copy; 2019. <a href="http://st.josephscollege.edu.in/"
rel="develop">Department of Computer Science</a>
</p>
</div>
</div>

</div>
<!-- /row of panels -->
</div>
</div>
</footer>

<!-- JavaScript libs are placed at the end of the document so the
pages load faster -->
<script src="assets/js/modernizr-latest.js"></script>
<script type=’text/javascript’ src=’assets/js/jquery.min.js’>
</script>
<script type=’text/javascript’ src=’assets/js/fancybox/
jquery.fancybox.pack.js’></script>
<script type=’text/javascript’ src=’assets/js/jquery.mobile.
customized.min.js’></script>
<script type=’text/javascript’ src=’assets/js/
jquery.easing.1.3.js’></script>
<script type=’text/javascript’ src=’assets/js/
camera.min.js’></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/custom.js"></script>
<script>
jQuery(function(){
jQuery(’#camera_wrap_4’).camera({
transPeriod: 500,
time: 3000,

Department of Computer Science 47


Christ College(Autonomous) christ chatbot

height: ’600’,
loader: ’false’,
pagination: true,
thumbnails: false,
hover: false,
playPause: false,
navigation: false,
opacityOnGrid: false,
imagePath: ’assets/images/’
});

});
</script>
</body>
</html>

adminlogin.css

**{
margin: 0;
padding: 0;
}
body
{
background-image:url("52.jpg");
height:100vh;
background-position: center;
background-size: cover;
}

.fullSection{
position: absolute;
top: 32%;
left: 37%;
}
.legend{
text-align: center;
}
.fieldSet{
border: 2px ridge black;
}
.formTable{
padding: 25px;
}
.footer{

Department of Computer Science 48


Christ College(Autonomous) christ chatbot

top: 100%;
left: 50%;
position: absolute;
}

adminlogin.html

<!DOCTYPE html>
<!--
To change this license header, choose License Headers
in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen"
href="addachievment.css" >
</head>

<title>Trip Planner</title>

<body>
<header>
<div class="header">
<h1>ADMIN LOGIN</h1>
</div>

</header>
<div class="fullSection">
<form action="index.html" method="get">
<fieldset class="fieldSet"><span class="legend"><legend>
</legend></span>
<div class="formTable">
<table cellspacing="5">
<tr>
<td>USER ID </td>
<td><input type ="text" name="id" value="admin" required></input>
</td>
</tr>
<tr>
<td>PASSWORD</td>
<td><input type ="password" name="password" value="admin"
required></input>
</td>
</tr>

Department of Computer Science 49


Christ College(Autonomous) christ chatbot

<TR>
<TD><BUTTON TYPE="LOGIN" NAME="LOGIN">LOGIN
</BUTTON></TD>
<TD><BUTTON TYPE="RESET" NAME="CANCEL">CANCEL
</BUTTON></TD></TR>
</table>
</div>
</fieldset>
</form>
</div>
</body>
</html>

admin loginpage.php

<!--
Author: WebThemez
Author URL: http://webthemez.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<meta name="description" content="free-educational-
responsive-web-template-webEdu">
<meta name="author" content="webThemez.com">
<title>Subject Aptitude Test</title>
<link rel="favicon" href="assets/images/favicon.png">
<link rel="stylesheet" media="screen" href="http://
fonts.googleapis.com/css?family=Open+Sans:300,400,700">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<!-- Custom styles for our template -->
<link rel="stylesheet" href="assets/css/bootstrap-theme.css"
media="screen">
<link rel="stylesheet" href="assets/css/style.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements
and media queries -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>

Department of Computer Science 50


Christ College(Autonomous) christ chatbot

<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>

<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<!-- Button for smallest screens -->
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="icon-bar"></span><span class="icon-bar"></span>
<span class="icon-bar"></span></button>
<a class="navbar-brand" href="index.html">
<!--<img src="assets/images/logo.png" alt="Techro HTML5 template"></a>-->
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav pull-right mainNav">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="admin_loginpage.php">Login</a></li>
<!-- <li><a href="price.html">Price</a></li>
<li><a href="videos.html">Videos</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Pages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="sidebar-right.html">Right Sidebar</a></li>
<li><a href="#">Dummy Link1</a></li>
<li><a href="#">Dummy Link2</a></li>
<li><a href="#">Dummy Link3</a></li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>-->

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

<header id="head" class="secondary">


<div class="container">
<h1>Login</h1>

Department of Computer Science 51


Christ College(Autonomous) christ chatbot

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

<!-- container -->


<div class="container">
<div class="row">
<div class="col-md-12">
<h3 class="section-title"></h3>
<!-- <p>
Lorem Ipsum is inting and typesetting in simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the is dummy text ever since the
1500s, when an unknown printer took a galley
of type and scrambled it to make a type specimen book.
</p>
-->
<form class="form-light mt-20" role="form" action=
"admin_loginpageprocess.php" method="post">
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control" name="myusername"
placeholder="User name" >
</div>
<!--<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control" placeholder="Email address">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" placeholder="Password">
</div>
</div>
</div>-->
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" name="mypassword"
placeholder="Password as ur Register number">
</div>
<!-- <div class="form-group">
<label>Message</label>
<textarea class="form-control" id="message" placeholder=

Department of Computer Science 52


Christ College(Autonomous) christ chatbot

"Write you message here..." style="height:100px;"></textarea>


</div>-->
<input type="submit" class="btn btn-two" value="LOGIN"
name="submit"><p><br/></p>
<p><br/></p>

</form>
</div>

<!--<div class="col-md-4">
<div class="row">
<div class="col-md-6">
<h3 class="section-title"></h3>
<div class="contact-info">
<h5>Address</h5>
<p></p>
<h5></h5>
<p></p>
<h5></h5>
<p></p>
</div>
</div>
</div>
</div>-->
</div>
</div>
<!-- /container -->

<footer id="footer">
<!-- <div class="container">
<div class="row">
<div class="footerbottom">
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>
Course Categories
</h4>
<div class="menu-course">
<ul class="menu">
<li><a href="#">
List of Technology
</a>
</li>
<li><a href="#">
List of Business

Department of Computer Science 53


Christ College(Autonomous) christ chatbot

</a>
</li>
<li><a href="#">
List of Photography
</a>
</li>
<li><a href="#">
List of Language
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>
Products Categories
</h4>
<div class="menu-course">
<ul class="menu">
<li> <a href="#">
Individual Plans </a>
</li>
<li><a href="#">
Business Plans
</a>
</li>
<li><a href="#">
Free Trial
</a>
</li>
<li><a href="#">
Academic
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>
Browse by Categories
</h4>
<div class="menu-course">

Department of Computer Science 54


Christ College(Autonomous) christ chatbot

<ul class="menu">
<li><a href="#">
All Courses
</a>
</li>
<li> <a href="#">
All Instructors
</a>
</li>
<li><a href="#">
All Members
</a>
</li>
<li>
<a href="#">
All Groups
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="footerwidget">
<h4>Contact</h4>
<p>Board of Technical Education</p>
<div class="contact-info">
<i class="fa fa-map-marker"></i> Thiruvananthapuram<br>
<i class="fa fa-phone"></i>+00 123 156 711 <br>
<i class="fa fa-envelope-o"></i> [email protected]
</div>
</div><!-- end widget -->
</div>
</div>
</div>
<div class="social text-center">
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-dribbble"></i></a>
<a href="#"><i class="fa fa-flickr"></i></a>
<a href="#"><i class="fa fa-github"></i></a>
</div>

<div class="clear"></div>
<!--CLEAR FLOATS-->
</div>

Department of Computer Science 55


Christ College(Autonomous) christ chatbot

<div class="footer2">
<div class="container">
<div class="row">

<div class="col-md-6 panel">


<div class="panel-body">
<p class="simplenav">
<a href="index.html">Home</a> |
<!--<a href="admin_login.php">Admin</a> |
<a href="hod_login.php">HOD</a>-->
</p>
</div>
</div>

<div class="col-md-6 panel">


<div class="panel-body">
<p class="text-right">
Copyright &copy; 2019. <a href="http://st.josephscollege.edu.in/"
rel="develop">
Department of Computer Science</a>
</p>
</div>
</div>

</div>
<!-- /row of panels -->
</div>
</div>
</footer>

<!-- JavaScript libs are placed at the end of the document so


the pages load faster -->
<script src="assets/js/modernizr-latest.js"></script>
<script type=’text/javascript’ src=’assets/js/jquery.min.js’></script>
<script type=’text/javascript’ src=’assets/js/fancybox/
jquery.fancybox.pack.js’></script>
<script type=’text/javascript’ src=’assets/js/
jquery.mobile.customized.min.js’></script>
<script type=’text/javascript’ src=’assets/js/
jquery.easing.1.3.js’></script>
<script type=’text/javascript’ src=’assets/js/
camera.min.js’></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/custom.js"></script>
<script>
jQuery(function(){

Department of Computer Science 56


Christ College(Autonomous) christ chatbot

jQuery(’#camera_wrap_4’).camera({
transPeriod: 500,
time: 3000,
height: ’600’,
loader: ’false’,
pagination: true,
thumbnails: false,
hover: false,
playPause: false,
navigation: false,
opacityOnGrid: false,
imagePath: ’assets/images/’
});

});
</script>
</body>
</html>

admin loginprocess.php

<html>
<body>
<?php
session_start();
$objConnect = mysqli_connect("localhost","root","") or
die("connection error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or
die("error in selection".mysqli_error());

$myusername=$_POST["myusername"];
$mypassword=$_POST["mypassword"];

//or die("error in selection".mysql_error());

if($myusername=="admin" && $mypassword=="admin") {


?>

<script language="javascript">alert(’Login Success’);window.


location.replace(’admin_index.php’);</script>

<?php
echo "password accepted";
$_SESSION[’login’]=true;

Department of Computer Science 57


Christ College(Autonomous) christ chatbot

}else {
?>
<script>
alert("Invalid admin username and password");
window.location.replace(’admin_loginpage.php’);
</script>
<?php
}
?>

</body>
</html>

listqueries.php

<html>
<head>
<meta charset="utf-8">
<title>View Records</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
<p><a href="admin_index.php">Home</a>
| <a href="admin_logout.php">Logout</a></p>
<h2>View Records</h2>
<table width="100%" border=1 style="border-collapse:collapse;">
<thead>
<tr>
<th><strong>Queries</strong></th>
<th><strong>Replies</strong></th>

</tr>
</thead>
<tbody>
<?php
$objConnect = mysqli_connect("localhost","root","") or
die("connection error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or
die("error in selection".mysqli_error());

$count=1;

Department of Computer Science 58


Christ College(Autonomous) christ chatbot

session_start();
//$objConnect = mysqli_connect("localhost","root","","satdb") or
die("connection error".mysqli_error());
//$objDB = mysql_select_db("satdb") or
die("error in selection".mysql_error());

$n="approved";
$sql="select * from chatbot";
$result=mysqli_query($objConnect,$sql) or
die(’error in selection’.mysqli_error($objConnect));
while($line=mysqli_fetch_array($result))
{
?>
<tr>
<td align="center"><?php echo $line[’queries’] ?></td>
<td align="center"><?php echo $line[’replies’] ?></td>

</tr>

<?php $count++; } ?>


</tbody>
</table>

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

listadd1.php

<!DOCTYPE html>
<html lang="zxx" class="no-js">

<head>
<!-- Mobile Specific Meta -->
<meta name="viewport" content="width=device-width,
initial-scale=1, shrink-to-fit=no">
<!-- Favicon-->
<link rel="shortcut icon" href="img/fav.png">
<!-- Author Meta -->
<meta name="author" content="CodePixar">
<!-- Meta Description -->

Department of Computer Science 59


Christ College(Autonomous) christ chatbot

<meta name="description" content="">


<!-- Meta Keyword -->
<meta name="keywords" content="">
<!-- meta character set -->
<meta charset="UTF-8">
<!-- Site Title -->
<title>Add Queries</title>

<!--
CSS
============================================= -->
<link rel="stylesheet" href="css/linearicons.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/themify-icons.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/nice-select.css">
<link rel="stylesheet" href="css/nouislider.min.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/main.css">
</head>

<body>

<!--================Contact Area =================-->


<section class="contact_area section_gap_bottom">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="text-center">ADD QUERIES</h1>
<form class="row contact_form" action="listadd_action.php"
method="post" id="contactForm" novalidate="novalidate">
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" id="query" name="query"
placeholder="Enter your query" onfocus="this.placeholder = ’’"
onblur="this.placeholder = ’Enter your query’">
</div>
<div class="form-group">
<input type="text" class="form-control" id="reply" name="reply"
placeholder="Enter your reply" onfocus="this.placeholder = ’’"
onblur="this.placeholder = ’Enter email reply’">
</div>
</div>
<div class="col-md-12 text-center">

Department of Computer Science 60


Christ College(Autonomous) christ chatbot

<button type="submit" value="submit" class="primary-btn">


Insert Query</button>
</div>
</form>
</div>
</div>
</div>
</section>

<script src="js/vendor/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/
1.11.0/umd/popper.min.js"
integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+
GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4"
crossorigin="anonymous"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/jquery.ajaxchimp.min.js"></script>
<script src="js/jquery.nice-select.min.js"></script>
<script src="js/jquery.sticky.js"></script>
<script src="js/nouislider.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<!--gmaps Js-->
<script src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyCjCGmQ0Uq4exrzdcL6rvxywDDOvfAu6eE"></script>
<script src="js/gmaps.min.js"></script>
<script src="js/main.js"></script>
</body>

</html>

listdelete.php

<html>
<head>
<meta charset="utf-8">
<title>View Records</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
<p><a href="admin_index.php">Home</a>

Department of Computer Science 61


Christ College(Autonomous) christ chatbot

| <a href="admin_logout.php">Logout</a></p>
<h2>View Records</h2>
<table width="100%" border="1" style="border-collapse:collapse;">
<thead>
<tr>
<th><strong>Queries</strong></th>
<th><strong>Replies</strong></th>

</tr>
</thead>
<tbody>
<?php
$objConnect = mysqli_connect("localhost","root","") or
die("connection error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or
die("error in selection".mysqli_error());

$count=1;

session_start();
//$objConnect = mysqli_connect("localhost","root","","satdb") or
die("connection error".mysqli_error());
//$objDB = mysql_select_db("satdb") or die("error in selection".mysql_error());

$n="approved";
$sql="select * from chatbot";
$result=mysqli_query($objConnect,$sql) or
die(’error in selection’.mysqli_error($objConnect));
while($line=mysqli_fetch_array($result))
{
?>
<tr>
<td align="center"><?php echo $line[’queries’] ?></td>
<td align="center"><?php echo $line[’replies’] ?></td>

<td align="center">
<a href="listdelete_action.php?id=<?php echo $line["id"]; ?>">Delete</a>
</td>

</tr>

<?php $count++; } ?>


</tbody>
</table>

Department of Computer Science 62


Christ College(Autonomous) christ chatbot

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

listunknown.php

<html>
<head>
<meta charset="utf-8">
<title>View Records</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
<p><a href="admin_index.php">Home</a>
| <a href="admin_logout.php">Logout</a></p>
<h2>View Records</h2>
<table width="100%" border=1 style="border-collapse:collapse;">
<thead>
<tr>
<th><strong>Queries</strong></th>
<th><strong>User Email</strong></th>
<th><strong>Add Response</strong></th>

</tr>
</thead>

<?php
$objConnect = mysqli_connect("localhost","root","") or
die("connection error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or
die("error in selection".mysqli_error());

$count=1;

session_start();
//$objConnect = mysqli_connect("localhost","root","","satdb") or
die("connection error".mysqli_error());
//$objDB = mysql_select_db("satdb") or die("error in selection".mysql_error());

$n="w";
$sql="select * from unknown where status=’$n’";
$result=mysqli_query($objConnect,$sql) or
die(’error in selection’.mysqli_error($objConnect));

Department of Computer Science 63


Christ College(Autonomous) christ chatbot

while($line=mysqli_fetch_array($result))
{
$a=$line[’data’];
$b=$line[’email’];
?>
<tr>
<td align="center"><?php echo $line[’data’] ?></td>
<td align="center"><?php echo $line[’email’] ?></td>

<td align="center"><a href="addunknown.php?id=<?php echo $a;?>


&&email=<?php echo $b;?>">
Add Response</a></td>

</tr>

<?php $count++;

}
?>

</table>

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

listdelete action.php

<?php
$objConnect = mysqli_connect("localhost","root","") or
die("connection error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or
die("error in selection".mysqli_error());

$id=$_GET[’id’];

#Query here...
$sql="delete from chatbot where id=’$id’";
$result=mysqli_query($objConnect,$sql) or
die(’error in selection’.mysqli_error($objConnect));

Department of Computer Science 64


Christ College(Autonomous) christ chatbot

if($result)
{
?>
<script language="javascript">
alert(’query deleted successfully’);
window.location.replace(’admin_index.php’);
</script>
<?php
} else {
?>
<script language="javascript">
alert(’query deletion failed’);
window.location.replace(’admin_index.php’);
</script>
<?php
}

?>

listadd unknownaction.php

<?php
require_once(’class.pop3.php’);
require_once(’class.phpmailer.php’);
require_once(’class.smtp.php’);
$objConnect = mysqli_connect("localhost","root","") or
die("connection error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or
die("error in selection".mysqli_error());

$query=$_GET[’query’];
$reply=$_GET[’reply’];
$email=$_GET[’email’];
#Query here...
$sql="insert into chatbot (queries,replies)values(’$query’,’$reply’)";
$result=mysqli_query($objConnect,$sql) or
die(’error in selection’.mysqli_error($objConnect));

$sql1="delete from unknown where data=’$query’";


$result1=mysqli_query($objConnect,$sql1) or die(’error in
selection’.mysqli_error($objConnect));
$m1="The response for your query : ".$query." Is :".$reply;
$subject="Chat Bot Response Admin Alert";

Department of Computer Science 65


Christ College(Autonomous) christ chatbot

$mail = new PHPMailer(); // create a new object


$mail->IsSMTP(); // enable SMTP
//echo "sent";
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = ’ssl’; // secure transfer enabled REQUIRED for GMail
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->SMTPDebug = 1;
$mail->Username = "[email protected]";
$mail->Password = "test@1097";
$mail->SetFrom("[email protected]");
$mail->Subject = $subject;
$mail->Body = $m1;
$mail->AddAddress($email);
//$mail->addCC("$cc");
//$mail->addBCC("$bcc");
//$mail->addStringAttachment("$fpath","$sfile");

if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "<h3>Message has been sent</h3>";
}

if($result)
{
?>
<script language="javascript">
alert(’query inserted’);
window.location.replace(’admin_index.php’);
</script>
<?php
} else {
?>
<script language="javascript">
alert(’query not inserted’);
window.location.replace(’admin_index.php’);
</script>
<?php
}

Department of Computer Science 66


Christ College(Autonomous) christ chatbot

?>
listcount.php
<html>
<head>
<meta charset="utf-8">
<title>View Records</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
<p><a href="admin_index.php">Home</a>
| <a href="admin_logout.php">Logout</a></p>
<h2>View Records</h2>

<?php
$objConnect = mysqli_connect("localhost","root","") or die("connection
error".mysqli_error());
$objDB = mysqli_select_db($objConnect,"mydatabase") or die("error
in selection".mysqli_error());

$count=1;

session_start();
//error_reporting(0);
//$objConnect = mysqli_connect("localhost","root","","satdb") or die("connection
error".mysqli_error());
//$objDB = mysql_select_db("satdb") or die("error in selection".mysql_error());

$n="w";
$sql="select * from history";
$result=mysqli_query($objConnect,$sql) or die(’error in selection’.
mysqli_error($objConnect));
while($line=mysqli_fetch_array($result))
{
$a=$line[’a’];
//echo "a is".$a;
$sql1="select * from history where a=’$a’";
$count=0;
$result1=mysqli_query($objConnect,$sql1) or die(’error in selection’.
mysqli_error($objConnect));
while($line1=mysqli_fetch_array($result1))

Department of Computer Science 67


Christ College(Autonomous) christ chatbot

{
// echo "hello".$sql1;

$count++;

$sqla="update history set c=’$count’ where a=’$a’";


$resulta=mysqli_query($objConnect,$sqla) or die(’error in selection’.
mysqli_error($objConnect));

?>

<?php

}
?>
<table width="100%" border=1 style="border-collapse:collapse;">
<thead>
<tr>
<th><strong>Query</strong></th>
<th><strong>Count</strong></th>

</tr>
</thead>
<?php
$sql2="select distinct(a),c from history order by c desc";
$result2=mysqli_query($objConnect,$sql2) or die(’error in selection’.
mysqli_error($objConnect));
while($line2=mysqli_fetch_array($result2,MYSQLI_ASSOC))
{
//echo "insiede";
?>

<tr>
<td align="center"><?php echo $line2[’a’] ?></td>
<td align="center"><?php echo $line2[’c’] ?></td>

Department of Computer Science 68


Christ College(Autonomous) christ chatbot

</tr>

<?php
}
?>
</table>
</div>
</body>
</html>
y
dummy index.php

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/
bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGg
FAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="./chathome.css">
<title>Chatbot home</title>
</head>
<body>

<nav class="navbar navbar-expand-lg navbar-light bg-dark">


<a class="navbar-brand" href="#" style="color: rgb(187, 115, 255);">Chatbot</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="
#navbarNavAltMarkup"
aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">

Department of Computer Science 69


Christ College(Autonomous) christ chatbot

<div class="navbar-nav">
<a class="nav-item nav-link active" href="#" style="color: white;">Home
<span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="#" style="color: white;">Course</a>
<a class="nav-item nav-link" href="#" style="color: white;"></a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink"
data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false" style="color: white;">
Department
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item links" href="#">Computer Science</a>
<a class="dropdown-item" href="#">Chemistry</a>
<a class="dropdown-item" href="#">Geology</a>
</div>
</li>
</ul> </div>
</div>
</nav>
<div class="col-12 col-md-12 col-sm-12">
<div class="row">
<div class="col-md-12">
<img src="./assets/images/christ.jpg" alt=""style="width:100%;">
</div>

<h1 class="text-center front-text home-align" style="position:absolute;">HOME</h1>

<div id="socl-icons2" class="mr-auto" style="position:absolute;">

<div class="wrapper">
<ul class="no-pad">
<li class="facebook">
<img src="http://christcollegeijk.edu.in/images/right-icon2.png" class="img-responsive">
<div class="slider">
</div>
</li>
<li class="facebook">
<img src="http://christcollegeijk.edu.in/images/right-icon1.png" class="img-responsive">
<div class="slider">
</div>
</li>
<li class="facebook">
<a href="bot.php">
<i>
<img src="assets/images/chatbot_logo.png" width=60px height=50px>

Department of Computer Science 70


Christ College(Autonomous) christ chatbot

</i>
<div class="slider">
</div>
</a>
</li>
</ul>
</div>
</div>
</div>

<!-- Optional JavaScript -->


<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity=
"sha384-KJ3o2DKtIkvYIK3UENzm
M7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/
ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
</body>
</html>

bot.php

<!-- Created By CodingNepal -->


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
</head>
<body style="background-image:url(’assets/images/bgc1.jpg’)">
<div class="wrapper">
<div class="title">Christ Chatbot</div>
<div class="form">
<div class="bot-inbox inbox">
<div class="icon">
<i class="fa fa-user" aria-hidden="true"></i>

Department of Computer Science 71


Christ College(Autonomous) christ chatbot

</div>
<div class="msg-header">
<p>Hello there, how can I help you?</p>
</div>
</div>
</div>
<div class="typing-field">
<div class="input-data">
<input id="data" type="text" placeholder="Type something here..." required>
<button id="send-btn">Send</button>
</div>
</div>
</div>

<script>
$(document).ready(function(){
$("#send-btn").on("click", function(){
$value = $("#data").val();
$msg = ’<div class="user-inbox inbox"><div class="msg-header"><p>
’+ $value +’</p></div></div>’;
$(".form").append($msg);
$("#data").val(’’);
// start ajax code
$.ajax({
url: ’new.php’,
type: ’POST’,
data: ’text=’+$value,
success: function(result){
$replay = ’<div class="bot-inbox inbox"><div class="icon"><i class="fas fa-user">
</i></div><div class="msg-header"><p>’+ result +’</p></div></div>’;
$(".form").append($replay);
// when chat goes down the scroll bar automatically comes to the bottom
$(".form").scrollTop($(".form")[0].scrollHeight);
let msg = $replay;
let speech = new SpeechSynthesisUtterance();
speech.lang = "en-US";
speech.text = msg;
speech.volume = 1;
speech.rate = 1;
speech.pitch = 1;
window.speechSynthesis.speak(speech);
}
});
});
});
/* JS comes here */

Department of Computer Science 72


Christ College(Autonomous) christ chatbot

function textToAudio() {
var aa= document.getElementById("data").value;
}

</script>

</body>
</html>

bot.py
def BuildLast(pattern) :
last = [-1]*128
for i in range (0,len(pattern)):
last[ord(pattern[i])] = i

return last

def BoyerMooreMatching (text,pattern) :


last = BuildLast(pattern)
n = len(text)
m = len(pattern)
i = m - 1
if (i > n-1) :
return -1

j = m - 1
hit = 0
temphit = 0
check = 0
while True :
if(pattern[j] == text[i]):
if (j==0) :
hit = temphit + 1
check = check + 1
return hit/check
else :
check = check + 1
temphit = temphit + 1
i = i -1
j = j - 1
else :
if(temphit >= hit ):
hit = temphit
temphit = 0
lo = last[ord(text[i])]

Department of Computer Science 73


Christ College(Autonomous) christ chatbot

i = i + m - min(j,1+lo)
j = m-1
if (i > n-1) :
break
return -1
def KMPSearch(pat, txt):
M = len(pat)
N = len(txt)
# create lps[] that will hold the longest prefix suffix
# values for pattern
lps = [0]*M
j = 0 # index for pat[]
# Preprocess the pattern (calculate lps[] array)
computeLPSArray(pat, M, lps)
i = 0 # index for txt[]
while i < N:
if pat[j] == txt[i]:
i += 1
j += 1
if j == M:
print ("Found pattern at index " + str(i-j))
j = lps[j-1]
# mismatch after j matches
elif i < N and pat[j] != txt[i]:
# Do not match lps[0..lps[j-1]] characters,
# they will match anyway
if j != 0:
j = lps[j-1]
else:
i += 1
def computeLPSArray(pat, M, lps):
len = 0 # length of the previous longest prefix suffix
lps[0] # lps[0] is always 0
i = 1
# the loop calculates lps[i] for i = 1 to M-1
while i < M:
if pat[i]== pat[len]:
len += 1
lps[i] = len
i += 1
else:
# This is tricky. Consider the example.
# AAACAAAA and i = 7. The idea is similar
# to search step.
if len != 0:
len = lps[len-1]

Department of Computer Science 74


Christ College(Autonomous) christ chatbot

# Also, note that we do not increment i here


else:
lps[i] = 0
i += 1
"""
txt = query.from(bot.php)
pat = pattern.from(bot.php)
KMPSearch(pat, txt)

chathome.css
.links a:hover{

background: rgb(133, 57, 255);

}.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.front-text{

font-size: 80px;
font-weight: 700;
font-family: monospace;
color: white;

}html{

margin: 0%;
}body{
margin: 0%;
}#socl-icons2 ul li.facebook {
background: #5e63ca;
}#socl-icons2 .wrapper img {
margin: 0px auto;
padding: 13px;
}#socl-icons2 .wrapper img {
margin: 0px auto;
padding: 13px;
}#socl-icons2 .slider {

Department of Computer Science 75


Christ College(Autonomous) christ chatbot

position: absolute;
top: 0;
right: 50px;
width: 0px;
height: 50px;
line-height: 50px;
background: #eebb5c;
text-align: center;
border-radius: 20px 0 0 20px;
transition: all 0.2s ease;
}p {
margin: 0 0 10px;
}ol, ul {
margin-top: 0;
margin-bottom: 10px;
}div {
display: block;
}#socl-icons2 .slider {
position: absolute;
top: 0;
right: 50px;
width: 0px;
height: 50px;
line-height: 50px;
background: #eebb5c;
text-align: center;
border-radius: 20px 0 0 20px;
transition: all 0.2s ease;
}#socl-icons2 ul li {
width: 50px;
height: 50px;
background: #e59500;
margin: 10px 0;
border-radius: 0px;
position: relative;
cursor: pointer;
box-shadow: 0 0 10px rgb(0 0 0 / 30%);
color: #fff;
}.img-responsive {
display: block;
max-width: 100%;
height: auto;
}.no-pad {
padding: 0;
}.front-icons{

Department of Computer Science 76


Christ College(Autonomous) christ chatbot

position: absolute;
}@media(min-width:500px){

.home-align{
margin-left: 45%;

}
}@media(max-width:500px){

.home-align{
margin-left: 45%;

}
}

message.php
<!-- Created By CodingNepal -->
<?php
// connecting to database
$conn = mysqli_connect("localhost", "root", "", "mydatabase") or die("Database Error");

// getting user message through ajax


$getMesg = mysqli_real_escape_string($conn, $_POST[’text’]);

//checking user query to database query


$check_data = "SELECT replies FROM chatbot WHERE queries LIKE ’%$getMesg%’";
$run_query = mysqli_query($conn, $check_data) or die("Error");

// if user query matched to database query we’ll show the reply otherwise it go to else stat
if(mysqli_num_rows($run_query) > 0){
//fetching replay from the database according to the user query
$fetch_data = mysqli_fetch_assoc($run_query);
//storing replay to a varible which we’ll send to ajax
$replay = $fetch_data[’replies’];
echo $replay;
}else{
}

?>

new.php

Department of Computer Science 77


Christ College(Autonomous) christ chatbot

<!-- Created By CodingNepal -->


<?php
session_start();
$_SESSION[’x’]=$_POST[’text’];
$x=$_SESSION[’x’];
$conn = mysqli_connect("localhost", "root", "", "mydatabase") or die("Database Error");

// getting user message through ajax


$getMesg = $_POST[’text’];
$aa=$_POST[’text’];
//checking user query to database query
$check_data = "SELECT replies FROM chatbot WHERE queries LIKE ’%$getMesg%’";
$run_query = mysqli_query($conn, $check_data) or die("Error");

// if user query matched to database query we’ll show the reply otherwise it go to else stat
if(mysqli_num_rows($run_query) > 0){
//fetching replay from the database according to the user query
$fetch_data = mysqli_fetch_assoc($run_query);
//storing replay to a varible which we’ll send to ajax
$replay = $fetch_data[’replies’];
echo $replay;
}else{
echo "Sorry, I am not able to understand you, You may give your email address so that
I will let you know ";
echo
"<form action=’filldata.php’ method=’get’>
<input type=’text’ name=’email’>
<input type=’hidden’ name=’data’ value=$x>
</input>
<input type=’submit’/>
</form>";

?>
\begin{itemize}
\item TextToSpeech
\end{itemize}
TextToSpech.php
<?php

namespace duncan3dc\Speaker;

use duncan3dc\Speaker\Exceptions\RuntimeException;
use duncan3dc\Speaker\Providers\ProviderInterface;

Department of Computer Science 78


Christ College(Autonomous) christ chatbot

use function file_put_contents;


use function is_file;
use function md5;
use function serialize;
use function sys_get_temp_dir;

/**
* Convert a string of a text to spoken word audio.
*/
class TextToSpeech implements TextToSpeechInterface
{
/**
* @var string $text The text to convert.
*/
private $text;

/**
* @var ProviderInterface $provider The provider instance to handle text conversion.
*/
private $provider;

/**
* @var string $data The audio data.
*/
private $data;

/**
* Create a new instance.
*
* @param string $text The text to convert
* @param ProviderInterface $provider
*/
public function __construct(string $text, ProviderInterface $provider)
{
$this->text = $text;
$this->provider = $provider;
}

/**
* Get the audio for this text.
*
* @return string The audio data
*/
public function getAudioData(): string

Department of Computer Science 79


Christ College(Autonomous) christ chatbot

{
if ($this->data === null) {
$this->data = $this->provider->textToSpeech($this->text);
}

return $this->data;
}

/**
* Generate the filename to be used for this text.
*
* @return string
*/
public function generateFilename(): string
{
$options = $this->provider->getOptions();

$options["text"] = $this->text;

$data = serialize($options);

return md5($data) . "." . $this->provider->getFormat();


}

/**
* Create an audio file on the filesystem.
*
* @param string $filename The filename to write to
*
* @return $this
*/
public function save(string $filename): TextToSpeechInterface
{
$result = file_put_contents($filename, $this->getAudioData());

if ($result === false) {


throw new RuntimeException("Unable to save the file ({$filename})");
}

return $this;
}

/**

Department of Computer Science 80


Christ College(Autonomous) christ chatbot

* Store the audio file on the filesystem.


*
* This function uses caching so if the file already exists
* a call to the text-to-speech service is not made.
*
* @param string $path The path to the directory to store the file in
*
* @return string The full path and filename
*/
public function getFile(string $path = null): string
{
if ($path === null) {
$path = sys_get_temp_dir();
}

$filename = $path . "/" . $this->generateFilename();

if (!is_file($filename)) {
$this->save($filename);
}

return $filename;
}
}
TextToSpechInterface.php
<?php

namespace duncan3dc\Speaker;

use duncan3dc\Speaker\Providers\ProviderInterface;

/**
* Convert a string of a text to spoken word audio.
*/
interface TextToSpeechInterface
{
/**
* Get the audio for this text.
*
* @return string The audio data
*/
public function getAudioData(): string;

/**

Department of Computer Science 81


Christ College(Autonomous) christ chatbot

* Generate the filename to be used for this text.


*
* @return string
*/
public function generateFilename(): string;

/**
* Create an audio file on the filesystem.
*
* @param string $filename The filename to write to
*
* @return $this
*/
public function save(string $filename): TextToSpeechInterface;

/**
* Store the audio file on the filesystem.
*
* @param string $path The path to the directory to store the file in
*
* @return string The full path and filename
*/
public function getFile(string $path = null): string;
}

Department of Computer Science 82

You might also like