[go: up one dir, main page]

0% found this document useful (0 votes)
167 views66 pages

VI Sem Project PDF

This document presents a project report for the Brain-Connect Academic Solution, submitted by three students to Midnapore College Autonomous in partial fulfillment of their Bachelor of Science degree in Computer Science. The report describes the development of a website to help circulate academic announcements, notices, and subject notes to students in an organized manner. Key sections of the report include an analysis of requirements, proposed modules, design diagrams, technologies used like HTML, PHP, and MySQL, implementation details, testing procedures, sample outputs, and a conclusion.
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)
167 views66 pages

VI Sem Project PDF

This document presents a project report for the Brain-Connect Academic Solution, submitted by three students to Midnapore College Autonomous in partial fulfillment of their Bachelor of Science degree in Computer Science. The report describes the development of a website to help circulate academic announcements, notices, and subject notes to students in an organized manner. Key sections of the report include an analysis of requirements, proposed modules, design diagrams, technologies used like HTML, PHP, and MySQL, implementation details, testing procedures, sample outputs, and a conclusion.
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/ 66

BRAIN-CONNECT ACADEMIC SOLUTION REPORT

A Project Report Submitted to

Midnapore College Autonomous, Midnapore

In partial fulfilment of the requirements


for the award of the degree of

BACHELOR OF SCIENCE
IN
COMPUTER SCIENCE (HONS.)

by

Abhishek Maity 2018-1578(3364)


Debarupa Santra 2018-1231(3321)
Sandip Roy 2018-1793(3350)

Under the guidance of

Smt. Piyali Sanyal


Associate Professor

DEPARTMENT OF COMPUTER SCIENCE AND APPLICATION

MIDNAPORE COLLEGE AUTONOMOUS


(Affiliated to VIDYASAGAR UNIVERSITY, Approved by AICTE and Accredited by NAAC)
Raja Bazar Main Rd, Midnapore - 721101, MIDNAPORE
2020 – 2021
DEPARTMENT OF COMPUTER SCIENCE AND APPLICATION
MIDNAPORE COLLEGE AUTONOMOUS
(Affiliated to VIDYASAGAR UNIVERSITY, Approved by AICTE and Accredited by NAAC)
Raja Bazar Main Rd, Midnapore - 721101, MIDNAPORE

Certificate
This is to certify that the project work entitled “Brain-Connect Academic
Solution” is the bonafide work done
by

Abhishek Maity 2018-1578(3364)


Debarupa Santra 2018-1231(3321)
Sandip Roy 2018-1793(3350)

in the Department of Computer Science and Application, MIDNAPORE


COLLEGE AUTONOMOUS, Midnapore is submit-ted to Vidyasagar
University, Midnapore in partial ful-filment of the requirements for the award
of B.Sc degree in Computer Science (Hons.) during 2018-2021.

Guide: Department Academic Incharge:


Smt. Piyali Sanyal Mr. Sovon Roy
Associate Professor, Associate Professor,
Dept of Comp. Sc & Appl., Dept of Comp. Sc & Appl.,
Midnapore College Autonomous, Midnapore College Autonomous,
Midnapore – 721101, West Bengal. Midnapore – 721101, West Bengal.

Viva-Voice held on……………………………………………

Internal Examiner External Examiner


ACKNOWLEDGEMENT
The satisfaction that accompanies the successful completion of the task would be put incom-
plete without the mention of the people who made it possible, whose constant guidance and
encouragement crown all the efforts with success.

We avail this opportunity to express our deep sense of gratitude and hearty thanks to Sri G C
Bera, Principle of Midnapore College Autonomous, for providing congenial atmosphere and
encouragement.

We are thankful to our guide Smt. Piyali Sanyal, Associate Professor, Computer Science
and Application for his sustained inspiring Guidance and cooperation throughout the
process of this project. His wise counsel and suggestions were invaluable.

We would like to thank Mr. K Kundu, Associate Professor and Mrs. S Pal, Associate-
Professor, Computer Science and Application fortheir expert guidance and encouragement
at various levels of our Project.

We express our deep sense of gratitude and thanks to all the teaching and non-teaching staff
of our college who stood with us during the project and helped us to make it a successful ven-
ture.

We place highest regards to our parents, our friends and well wishers who helped a lot in
making the report of this project.

Avishek Maity 2018-1578(3364)


Debarupa Santra 2018-1231(3321)
Sandip Roy 2018-1793(3350)
DECLARATION

We hereby declare that this project report is titled “Brain-Connect Academic Solution” is a
genuine project work carried out by us, in B.Sc (Computer Science and Application) degree
course of Vidyasagar University Midnapore, Midnapore and has not been submitted to
any other course or university for the award of my degree by me.

Signature of the Student

1.

2.

3.
INDEX
Contents Chapter Number

Introduction …………………………………………………………………2

1. Analysis
1.1 Feasibility Study ............................................................................................4
1.2 Requirement Analysis ....................................................................................4
1.3 Current Conditions .........................................................................................6
1.4 Current Solutions ...........................................................................................7
1.5 Proposed Solution. .........................................................................................8
1.6 Modules..........................................................................................................9

2. Design
2.1 Introduction. .................................................................................................11
2.2 UML Diagrams ............................................................................................ 11
2.3 E-R Diagram ................................................................................................15

3. Technologies used
3.1 HTML ..................................................................................................................... 17
3.2 PHP ......................................................................................................................... 19
4.2 mySQL ................................................................................................................... 13
4.2 JavaScript ............................................................................................................... 26
4.2 CSS ......................................................................................................................... 27

4. Implementation and Coding


5.0 Introduction ..................................................................................................29
5.1 Login Page ...................................................................................................29
5.2 Home Page ...................................................................................................33
5.3 Registration Page .........................................................................................37
5.4 Recovery Page .............................................................................................42
5.5 Upload Page .................................................................................................45
5.6 Download Page ............................................................................................47

5. Testing and Validation


5.1 Introduction ..................................................................................................53
5.2 Types of Testing ...........................................................................................54
5.3 Test Cases ....................................................................................................55

6. Output Screens ............................................................................................. 56


7. Conclusion..................................................................................................... 63
8. Bibliography
8.1 Book References ..........................................................................................66
8.2 Websites .......................................................................................................66
Chapter 1
INTRODUCTION
1. INTRODUCTION

1.1 Problem Definition


In order to circulate the Academic announcements, notice and subject related notes
throughout the students, Academic Institutions does not have any proper way and also
creating problems towards students. In this pandemic situation, it is very vital issue for
students specially College and University student, so this academic solution generated
provides all the document properly through website. If any inconsistency can be identified
will be managed and the course related documents can easily get in there quite circulate
without any hurry. This report is known as Brain Connect Academic Solution.

A Document is created by Academic end as well as teachers end and students end. After
considering various factors such as potential holidays, Important notice, Class reference &
notes, Question suggestions, with the aim that it must be followed for a stress-free
administration work.

In Brain-Connect Academic solution, separate id is provided for every user. That’s how some
one can actually join and use the provided documents. In this solution there are a upload
feature for the administrative, teacher and for students also, and a download feature to gain
that. The Documents are stored in servers so that at any time when it needed just download
and use it.

1.2 Objective of the project

Brain-Connect Academic Solution, as a project, has a set of defined deliveries and objectives,
and they are as follows:

• Provide a clean and intuitive User-Interface for the Users.


• Provide hassle-free data entry support for Class Representatives as well as Students.
• Academic pdf, Administrative stuff and other important info get easily through this
project.
• Design a non-redundant database model.
• Develop a set of well-coupled web pages.
• Implement secure authentication functionalities.
• Easy to upload/download and access to many important academic related information.

Page 2 of 66
Chapter 2
ANALYSIS
2. ANALYSIS

2.1 Feasibility Study

Below, we discuss the feasibilities of the proposed solution.

2.1.1 Technical Feasibility


We believe that it is technically feasible, since there will not be much difficulty in gathering
resources required for the development of this system and its maintenance. We will be utilis-
ing the resources which are already available in the organisation.

2.1.2 Economic Feasibility


Development of this application is economically feasible, as the organisation does not need
to spend much money to the develop of this system. The development will only require an
environment with an effective supervision. By doing so, we can attain maximum usability
of the current resources, and the organisation will not need to invest more to maintain it after
its development.

2.2 Requirement Analysis

The development of Brain-Connect Academic Solution has been done by using various open-
source software, and they are listed below:

• XAMPP:
It is a free and open source cross-platform web server solution stack package de-
veloped by Apache Friends, consisting mainly of the Apache HTTP Server, Mari-
aDB database, and interpreters for scripts written in the PHP and Perl program-
ming languages. XAMPP stands for Cross-Platform (X), Apache (A), MariaDB
(M), PHP (P) and Perl (P). It is a simple, lightweight Apache distribution that
makes it extremely easy for developers to create a local web server for testing and
deployment purposes. Everything needed to set up a web server – server applica-
tion (Apache), database (MariaDB), and scripting language (PHP) – is included in
an extractable file. XAMPP is also cross-platform, which means it works equally
well on Linux, Mac and Windows. Since most actual web server deployments use
the same components as XAMPP, it makes transitioning from a local test server to
a live server extremely easy as well.

• Notepad++:
Notepad++ is a text editor and source code editor for use with Microsoft Win-
dows. Unlike Notepad, the built-in Windows text editor, it supports tabbed edit-
ing, which allows working with multiple open files in a single window.Notepad++
is one of the most popular source code editors in the world, and supports syntax
highlighting and code folding for over 50 programming, scripting, and mark-up
languages.

Page 4 of 66
• Google Chrome:
Google Chrome is a freeware web browser developed by Google. It was first re-
leased in 2008, for Microsoft Windows, and was later ported to Linux, OS
X, iOS and Android. Google Chrome is also the main component of Chrome OS,
where it serves a platform for running web apps. It was mainly used for testing
purposes.

• Github:
GitHub is a web-based Git repository hosting service. It offers all of the dis-
tributed version control and source code management (SCM) functionality of Git
as well as adding its own features. It provides access control and several collabo-
ration features such as bug tracking, feature requests, task management, and wikis
for every project.
GitHub offers both plans for private repositories, and free accounts which are
commonly used to host open-source software projects.

• CodeSandBox Editor:
CodeSandBox is an online editor for rapid web development. With CodeSandBox,
you can prototype quickly, and share creation in just one click. Use it to create sta-
tic sites, full-stack web pages, or component on any device with a web Browser.
Our mission is to create web development faster. By removing complexity, we en-
able web developers to be more productive. By simplifying collaboration, we ma-
ke it easier for terms to work on code together.

2.2.1 System requirements


To efficiently run Brain-Connect Academic Solution on a client computer, it must satisfy a
few requirements which addressed below.

• Google Chrome:
Google Chrome is a freeware web browser developed by Google. Any other
equivalent browser works fine as well.

• Internet access:
512 Kbps or above is required for a smooth experience.

Page 5 of 66
2.3 Existing Conditions
2.3.1 Overview

As mentioned earlier, the present system requires a lot of PDF/Document that must be
maintained for a proper execution. But, there are physical limitations to this system and are
addressed in the following section.

2.3.2 Limitations

Like every other system, Brain-Connect Academic Solution also has its problems, and most
of them seem to be physical limitations.

• This software provides a various types of data coming through academic section,
teacher’s and students also. The overall data stored in to the system in an align way is
difficult sometimes.
• Searching through search menu bar is easy to find out the documents. But sometime if
error occurs then it probably unable to show the resulted document.
• Using the manual way to find out the desired document and download it is quit time tak-
ing procedure for all the users.
• If any error gets detected by the, the whole process must berestarted, wasting a
lot of time and energy.
• Data can be tampered with, by anybody and discovering the tampered data will be
difficult for the management.
• All previous records must be saved, in order to access past- information.
• If someone uploaded wrong data/documents, it is difficult to find out while uploading.

The overall expense in time and resources does not make the existing system suitable for
use, thus requiring an overhaul.

Page 6 of 66
2.4 Current Solutions
2.4.1 Overview
There are probably no pre-existing alternative that provides this kind of useability to the
academic sector. Using such software has the following benefits and cons.

2.4.2 Advantages
• Does not require any kind of paper or related product, as everything will be stored
virtually.
• The data can be entered without as much difficulty, and reading through the reports
will be significantly easier. Download that document is also easy .
• Instead of carrying this software, any one ,having an Id and Password can access it
online,conveniently and everywhere.

2.4.3 Disadvantages
• Requires using third-party cloud vendors for storing and accessing documents.
• Although data entry and retrieval is improved, maintaining documents will be a has-
sle, as every year, at least 1000 documents must be maintained, assuming there are a
Lot of departments in total.
• This is a fully online based software so slow network is an issue to work somoothly.

Page 7 of 66
2.5 Proposed Solution
2.5.1 Overview
This system is called Brain-Connect Academic Solution. The website is designed and
developed solely for this purpose and it also allows for future im- provements without much
difficulty. The system is robust, cost-efficient and secure, making it a much suitable than
others.

2.5.2 Advantages
The advantages provided by Brain-Connect Academic Solution are down below.

• Does not require any kind of paper or related product, as everything will be stored on
the Institutional database.
• The specifically designed User- Interface allows for a smooth data entry ,storing and
downloading.
• As everything is stored and maintained online, in the database, a single click of a but-
ton is enough to upload and read. A single click can also helps to download it.
• RDBMS allows for storing data with very less redundancy.
• All previous records can be accessed in this system.

Page 8 of 66
2.6 Modules

Brain-Connect Academic Solution uses various modules to improve readability and the
maintenance (debugging) of the project. Each module, described below, can be made up of
multiple web pages or can be used in multiple web pages. The prime modules are described
below.

• Login Module:
Authenticates the user details and based on the account type, it redirects to an ap-
propriate module

• Upload Module:
Presents a unique page for user, wherein they can select a document and upload it
to the system. There are three types of users. They can upload their documents in
the system

• Search Module:
This is the module which is use to search the particular document which you want.
It checks all the documents and helps to find the particular document easily and
quickly.

• Download Module:
The download module works after search module. If some one want to download
the searched document then it helps to download it .

Page 9 of 66
Chapter 3
DESIGN
3. DESIGN

3.1 Introduction
A system architecture or systems architecture is the conceptual model that defines the struc-
ture, behaviour, and more views of a system. An architecture description is a formal descrip-
tion and representation of a system, organised in a way that supports reasoning about the
structures and behaviours of the system.A system architecture can comprise system compo-
nents, the expand systems developed, that will work together to implement the overall sys-
tem.

3.2 UML Diagrams

3.2.1 Deployment Diagram

Deployment diagram is a structure diagram which shows architecture of the system as de-
ployment (distribution) of software artefacts to deployment targets. Artefacts represent con-
crete elements in the physical world that are the result of a development process. Examples of
artefacts are executable files, libraries, archives, database schemas, configuration files, etc.
Deployment target is usually represented by a node which is either hardware device or some
software execution environment. Nodes could be connected through communication paths to
create networked systems of arbitrary complexity.

Page 11 of 66
3.2.2 Use Case Diagram #1

Use case diagrams are usually referred to as behaviour diagrams used to describe a set of ac-
tions (use cases) that some system or systems (subject) should or can perform in collabora-
tion with one or more external users of the system (actors). Each use case should provide
some observable and valuable result to the actors or other stakeholders of the system.

Figure 3.2.2 :Case Diagram I

Page 12 of 66
3.2.3 Use Case Diagram #2

Figure 3.2.3 :Case Diagram II

Page 13 of 66
3.2.4 Activity Diagram

Activity diagram is UML behaviour diagram which shows flow of control or object flow with
emphasis on the sequence and conditions of the flow. The actions coordinated by activity
models can be initiated because other actions finish executing, because objects and data be-
come available, or because some events external to the flow occurs.

Figure 3.2.4 : Activity Diagram

Page 14 of 66
3.3 Database Architecture / ER Diagram

Figure 3.3 : E-R Diagram

Page 15 of 66
Chapter 4
TECHNOLOGIES USED
4. TECHNOLOGIES USED

4.1 HTML

Html is a language which is used to create web pages with html marking up a page to indicate
its format, telling the web browser where you want a new line to begin or how you want the
text or images aligned and more are possible. We have used the following tags in our project.

4.1.1 Table
Tables are so popular with web page authors is as they let you arrange the elements of a web
page in such a way that the browser won’t rearrange their web page authors frequently use
tables to structure web pages.

TR
TR is used to create a row in a table encloses <TH>and <TD> elements. <TR> contain many
attributes. Some of them are
• ALIGN: specifies the horizontal alignment of the text in the table row.
• BGCOLOR: Specifies the background colour for the row.
• BORDERCOLOR: Sets the external border colour for the row.
• VALIGN: Sets the vertical alignment of the data in this row.

TH
TH is used to create table heading.
• ALIGN: Sets the horizontal alignment of the content of the table cell. Sets LEFT,
RIGHT.
• BACKGROUND: Species the background image for the table cell.
• BGCOLOR: Specifies the background colour of the table cell
• VALIGN: Sets the vertical alignment of the data. Sets to TOP, MIDDLE, BOTTOM
or BASELINE.
• WIDTH: Specifies the width of the cell. Set to a pixel width or a percentage of the
display area.

TD
TD is used to create table data that appear in the cells of a table.
• ALIGN: Species the horizontal alignment of content in the table cell. Sets to LEFT,
CENTER, RIGHT.
• BGCOLOR: Specifies the background image for the table cell.
• BGCOLOR: sets the background colour of the table cells.
• WIDTH: Species the width of the cell

Page 17 of 66
4.1.2 Frames
Frames are used to either run off the page or display only small slices of what are supposed to
be shown and to configure the frame we can use <FRAMESET>. There are two important
points to consider when working with <FRAMESET>.
• <FRAMESET> element actually takes the place of the <BODY> element in a docu-
ment.

4.1.3 Form
The purpose of FORM is to create an HTML form; used to enclose HTML controls, like but-
tons and text fields.
Attributes:
• ACTION: Gives the URL that will handle the form data.
• NAME: Gives the name to the form so you can reference it in code set to an al-
phanumeric string.
• METHOD: method or protocol is used to send data to the target action URL. The
GET method is the default, it is used to send all form name/value pair information in an
URL.Using the POST method, the contents of the form are encoded as with the GET
method, but are sent in environment variables.

4.1.4 Controls in HTML

<INPUT TYPE =BUTTON>:


Creates an html button in a form.
Attributes:
• NAME: gives the element a name. Set to alphanumeric characters.
• SIZE: sets the size.
• VALUE: sets the caption of the element.

<INPUT TYPE = PASSWORD>:


Creates a password text field, which makes typed input.
Attributes:
• NAME: gives the element a name, set to alphanumeric characters.
• VALUE: sets the default content of the element.

<INPUT TYPE=SUBMIT>:
Creates a submit button that the user can click to send data in the form back to the web
server.
Attributes:
• NAME: Gives the element a name. Set to alphanumeric characters.
• VALUE: Gives this button another label besides the default, Submit Query. Set to al-
phanumeric characters.

<INPUT TYPE=TEXT>:
Creates a text field that the user can enter or edit text.
Attributes:
• NAME: Gives the element a name. Set to alphanumeric characters.
• VALUE: Holds the initial text in the text field. Set to alphanumeric characters.

Page 18 of 66
4.2 PHP
PHP is a server-side scripting language designed primarily for web development, but is also
used as a general-purpose programming language. Originally created by Rasmus Lerdorf in
1994, the PHP reference implementation is now produced by The PHP Development
Team PHP originally stood for Personal Home Page, but it now stands for the recursive
acronym PHP: Hypertext Preprocessor.
PHP code may be embedded into HTML code, or it can be used in combination with
various web template systems, web content management systems and web frameworks. PHP
code is usually processed by a PHP interpreter implemented as a module in the web server or
as a Common Gateway Interface (CGI) executable. The web server combines the results of
the interpreted and executed PHP code, which may be any type of data, including images,
with the generated web page. PHP code may also be executed with a command-line
interface (CLI) and can be used to implement standalone graphical applications.
The standard PHP interpreter, powered by the Zend Engine, is free software released under
the PHP License. PHP has been widely ported and can be deployed on most web servers on
almost every operating system and platform, free of charge.
The PHP language evolved without a written formal specification or standard until 2014,
leaving the canonical PHP interpreter as a de facto standard. Since 2014 work has gone on to
create a formal PHP specification.
4.2.1 Syntax

<!DOCTYPE html>
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?phpecho'<p>Hello World</p>';?>
</body>
</html>

An example of PHP ‘for loop’:

<?php
for($x=0;$x<=100;$x++){
echo"The number is: $x<br>";
}?>

Page 19 of 66
4.2.2 Data types
PHP stores integers in a platform-dependent range, either a 64-bit or 32-integer equivalent to
the C-language long type. Unsigned integers are converted to signed values in certain situa-
tions; this behavior is different from that of other programming languages.Integer variables
can be assigned using decimal (positive and negative), octal, hexadecimal, and binary nota-
tions.
Floating point numbers are also stored in a platform-specific range. They can be specified
using floating point notation, or two forms of scientific notation. PHP has a
native Boolean type that is similar to the native Boolean types in Java and C++. Using the
Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as
in Perl and C++.
Variables of the "resource" type represent references to resources from external sources.
These are typically created by functions from a particular extension, and can only be pro-
cessed by functions from the same extension; examples include file, image, and database re-
sources.
Arrays can contain elements of any type that PHP can handle, including resources, objects,
and other arrays. Order is preserved in lists of values and in hashes with both keys and val-
ues, and the two can be intermingled. PHP also supports strings, which can be used with sin-
gle quotes, double quotes, nowdoc or heredoc syntax.

4.2.3 Functions
PHP defines a large array of functions in the core language and many are also available in
various extensions; these functions are well documented in the online PHP documenta-
tion.However, the built-in library has a wide variety of naming conventions and associated
inconsistencies, as described under history above.
Custom functions may be defined by the developer, e.g.:
functionmyAge($birthYear){// defines a function, this one is named "myAge"
$yearsOld=date('Y')-$birthYear;// calculates the age
return$yearsOld.' year'.($yearsOld!=1?'s':'');// returns the age in a descriptive form
}

echo'I am currently '.myAge(1981).' old.';// outputs the text concatenated// with the return
value of myAge()

Page 20 of 66
4.2.4 Object-Oriented Programming
Basic object-oriented programming functionality was added in PHP 3 and improved in PHP
4 This allowed for PHP to gain further abstraction, making creative tasks easier for program-
mers using the language. Object handling was completely rewritten for PHP 5, expanding the
feature set and enhancing performance.In previous versions of PHP, objects were handled
like value types.The drawback of this method was that code had to make heavy use of PHP's
"reference" variables if it wanted to modify an object it was passed rather than creating a
copy of it. In the new approach, objects are referenced by handle, and not by value.
PHP 5 introduced private and protected member variables and methods, along with abstract
classes, final classes, abstract methods, and final methods. It also introduced a standard way
of declaring constructors and destructors, similar to that of other object-oriented languages
such as C++, and a standard exception handling model.
If the developer creates a copy of an object using the reserved word clone, the Zend engine
will check whether a clone() method has been defined. If not, it will call a
default clone() which will copy the object's properties. If a clone() method is defined,
then it will be responsible for setting the necessary properties in the created object. For con-
venience, the engine will supply a function that imports the properties of the source object, so
the programmer can start with a by-value replica of the source object and only override prop-
erties that need to be changed.

Page 21 of 66
The following is a basic example of object-oriented programming in PHP:
classPerson
{
public$firstName;
public$lastName;

publicfunction construct($firstName,$lastName=''){$this->firstName=$firstName;
$this->lastName=$lastName;
}

publicfunctiongreet(){
return'Hello, my name is '.$this->firstName.
(($this->lastName!='')?(' '.$this->lastName):'').'.';
}

publicstaticfunctionstaticGreet($firstName,$lastName){
return'Hello, my name is '.$firstName.' '.$lastName.'.';
}
}

$he=newPerson('John','Smith');
$she=newPerson('Sally','Davis');
$other=newPerson('iAmine');

echo$he->greet();echo'<br />';
echo$she->greet();echo'<br />';
echo$other->greet();
echo'<br />';

echoPerson::staticGreet('Jane','Doe');

Page 22 of 66
4.3 MySQL

MySQL is the most popular Open Source Relational SQL database management system.
MySQL is one of the best RDBMS being used for developing web-based software ap-
plications.
A database is a separate application that stores a collection of data. Each database has one or
more distinct APIs for creating, accessing, managing, searching and replicating the data it
holds.
Other kinds of data stores can be used, such as files on the file system or large hash tables in
memory but data fetching and writing would not be so fast and easy with those types of sys-
tems.
So nowadays, we use relational database management systems (RDBMS) to store and man-
age huge volume of data. This is called relational database because all the data is stored into
different tables and relations are established using primary keys or other keys known as for-
eign keys.

A Relational DataBase Management System (RDBMS) is a software that:


• Enables you to implement a database with tables, columns and indexes.
• Guarantees the Referential Integrity between rows of various tables.
• Updates the indexes automatically.
• Interprets an SQL query and combines information from various tables.

4.3.1 RDBMS Terminology:


Before we proceed to explain MySQL database system, let's revise few definitions related to
database.

Database:
A database is a collection of tables, with related data.

Table:
A table is a matrix with data. A table in a database looks like a simple spreadsheet.

Column:
One column (data element) contains data of one and the same kind, for example the column
postcode.

Row:
A row (= tuple, entry or record) is a group of related data, for example the data of one sub-
scription.

Redundancy:
Avoids storing data more than once, causing the system to faster.

Primary Key:
A primary key is unique. A key value cannot occur twice in one table. With a key, you can
find at most one row.

Page 23 of 66
Foreign Key:
A foreign key is the linking pin between two tables.

Compound Key:
A compound key (composite key) is a key that consists of multiple columns, because one
column is not sufficiently unique.

Index:
An index in a database resembles an index at the back of a book.

Referential Integrity:
Referential Integrity makes sure that a foreign key value always points to an existing row.

4.3.2 Key points as to why MySQLis used:

1. MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses.
MySQL is developed, marketed, and supported by MySQL AB, which is a Swedish
company. MySQL is becoming so popular because of many good reasons:
2. MySQL is released under an open-source license. So you have nothing to pay to use
it.
3. MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.
4. MySQL uses a standard form of the well-known SQL data language.
5. MySQL works on many operating systems and with many languages including PHP,
PERL, C, C++, JAVA, etc.
6. MySQL works very quickly and works well even with large data sets.
7. MySQL is very friendly to PHP, the most appreciated language for web development.
8. MySQL supports large databases, up to 50 million rows or more in a table. The de-
fault file size limit for a table is 4GB, but you can increase this (if your operating sys-
tem can handle it) to a theoretical limit of 8 million terabytes (TB).
9. MySQL is customisable. The open-source GPL license allows programmers to modify
the MySQL software to fit their own specific environments.

Page 24 of 66
mysql> help

4.3.3 List of all MySQL commands:

Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command.
tee (\T) Set outfile [to_outfile]. Append everything into given out file.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing

Page 25 of 66
4.4 Java Script
Java script originally supported by Netscape navigator is the most popular web scripting lan-
guage today. Java script lets you embedded programs right in your web pages and run these
programs using the web browser. You place these programs in a <SCRIPT> element, usually
within the <HEAD> element. If you want the script to write directly to the web page, place it
in the <BODY> element.JavaScript is the programming language of HTML and the We-
b.Programming makes computers do what you want them to do.JavaScript is easy to learn.

4.4.1 JavaScript Methods:

Writeln:
Document.writeln() is a method, which is used to write some text to the current web page.

onClick:
Occurs when an element is clicked.

onLoad:
Occurs when the page loads.

onMouseDown:
Occurs when a mouse button goes down.

onMouseMove:
Occurs when the mouse moves.

onUnload:
Occurs when a page is unloaded.

4.4.2 JavaScript Can Change HTML Content


One of many JavaScript HTML methods is getElementById(). This example uses the method
to "find" an HTML element (with id="demo") and changes the element content (inner-
HTML) to "Hello JavaScript":
document.getElementById("demo").innerHTML = "Hello JavaScript”;
JavaScript Can Change HTML Styles (CSS)
Changing the style of an HTML element, is a variant of changing an HTML attribute:
document.getElementById("demo").style.fontSize = "25px";
JavaScript Can Hide/Show HTML Elements
Hiding HTML elements can be done by changing the display style:
document.getElementById(“demo").style.display="none";
document.getElementById(“demo”).style.display="block";

Page 26 of 66
4.5 CSS

CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be dis-
played on screen, paper, or in other media. It can control the layout of multiple web pages all
at once. External stylesheets are stored in CSS files

4.5.1 Why Use CSS?


CSS is used to define styles for your web pages, including the design, layout and variations in
display for different devices and screen sizes. CSS solved a Big Problem. HTML was never
intended to contain tags for formatting a web page!
HTML was created to describe the content of a web page, like:

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

When tags like <font>, and color attributes were added to the HTML 3.2 specification, it
started a nightmare for web developers. Development of large websites, where fonts and col-
or information were added to every single page, became a long and expensive process.
To solve this problem, the World Wide Web Consortium (W3C) created CSS.
CSS removed the style formatting from the HTML page!
The style definitions are normally saved in external .css files.
With an external stylesheet file, you can change the look of an entire website by changing
just one file!

4.5.2 CSS Syntax


A CSS rule-set consists of a selector and a declaration block:

The selector points to the HTML element you want to style.


The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a CSS property name and a value, separated by a colon.
A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by
curly braces.

Page 27 of 66
Chapter 5
IMPLEMENTATION AND CODING
5. IMPLEMENTATION AND CODING
5.1 Introduction
All of the major web pages and their scripts are described below. The languages that were
used to implement e-DCWR are HTML, PHP, JavaScript and CSS; quite a lot of MySQL
queries are also included in the PHP scripts.

5.2 Login Page

<?php
include('db.php');
session_start();
if(isset($_POST['email']) && $_POST['password']){
$email=$_POST['email'];
$password=$_POST['password'];
$res=mysqli_query($con,"select * from user where email='$email' and password='$password'");
$check=mysqli_num_rows($res);
if($check>0){
$row=mysqli_fetch_assoc($res);
$verification_status=$row['verification_status'];
if($verification_status==0){
echo "You have not confirmed your account yet. Please check your inbox and verify
your email id.";
}else{
echo "done";
$_SESSION['IS_LOGIN']=1;
}
}else{
echo "Please enter corect login details";
}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<title>Login Form</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
body{
height:1000px;
background:#475d62 url(../../assets/img/star-sky.jpg);
background-size:cover;
position:relative;
}
.form-control{
height: 40px;
Page 29 of 66
box-shadow: none;
color: #969fa4;
}
.form-control:focus{
border-color: #5cb85c;
}
.form-control, .btn{
border-radius: 3px;
}
.signup-form{
width: 400px;
margin: 0 auto;
padding: 30px 0;
}
.signup-form h2{
color: #636363;
margin: 0 0 15px;
position: relative;
text-align: center;
}
.signup-form h2:before, .signup-form h2:after{
content: "";
height: 2px;
width: 30%;
background: #d4d4d4;
position: absolute;
top: 50%;
z-index: 2;
}
.signup-form h2:before{
left: 0;
}
.signup-form h2:after{
right: 0;
}
.signup-form .hint-text{
color: #999;
margin-bottom: 30px;
text-align: center;
}
.signup-form form{
color: #999;
border-radius: 3px;
margin-bottom: 15px;
background: #f2f3f7;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.signup-form .form-group{
margin-bottom: 20px;
}
.signup-form input[type="checkbox"]{
margin-top: 3px;
}
.signup-form .btn{
font-size: 16px;
font-weight: bold;
min-width: 140px;
outline: none !important;
}
Page 30 of 66
.signup-form .row div:first-child{
padding-right: 10px;
}
.signup-form .row div:last-child{
padding-left: 10px;
}
.signup-form a{
color: #fff;
text-decoration: underline;
}
.signup-form a:hover{
text-decoration: none;
}
.signup-form form a{
color: #5cb85c;
text-decoration: none;
}
.signup-form form a:hover{
text-decoration: underline;
}
.signup-form .message{
color:red;
}
</style>
</head>
<body>
<div class="signup-form">
<form method="post">
<h2>Login</h2>
<p class="hint-text">Enter your email id and password.</p>

<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Email">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" id="password" placeholder="Password">
</div>

<div class="form-group">
<button type="button" class="btn btn-success btn-lg btn-block" onclick="login_now()">Login Now</button>
</div>
<div class="message"></div>
</form>

<a href="registration.php" class="btn btn-sm btn-warning">Signup</a>


<br><br><a href="forget_password.php" class="btn btn-sm btn-warning">HELP</a>
<br><br>
<a href="users/" class="btn btn-sm btn-warning">I don't want(Back to Home)</a>
<br><br>
</div>
<script>
function login_now(){
var email=jQuery('#email').val();
var password=jQuery('#password').val();

jQuery.ajax({
url:'login_check.php',
type:'post',
data:'email='+email+'&password='+password,
success:function(result){
Page 31 of 66
if(result=='done'){
window.location.href='home.php';
}
jQuery('.message').html(result);
}
});
}
</script>
</body>
</html>

Page 32 of 66
5.3 Home Page

<?php
$i = 0;
require_once 'php/DBConnect.php';
$db = new DBConnect();
$db->auth();
//Search By City
if (isset($_POST['searchBycodeBtn'])) {
$city = $_POST['city'];
$code = $db->searchDonorByCity($city);
}
$title = "Home";
$setHomeActive = "active";
include 'layout/_header.php';

include 'layout/_top_nav.php';
?>
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="form-group col-md-12">

</form>
<form class="form-horizontal" method="post" action="home.php">
<div class="form-group">
<label class="col-sm-6">Search for pdf by code </label>
<div class="col-sm-4">
<input type="text" name="city" value="" required="true" class="form-control"/>
</div>
<div class="col-sm-2">
<button class="btn btn-info btn-sm" name="searchBycodeBtn" >Search</button>
</div>
</div>

</form>
</div>
</div>
<div class="col-md-3"></div>
</div>

<div class="row">
<div class="col-md-1">
</div>
<div class="col-md-10">

<!-- If the donor is search by a particular City -->


<?php if(isset($_POST['searchBycodeBtn'])): ?>
<?php if(isset($code[0])): ?>
<label>Total Number of code:</label> <span class="emphasize"><?= count($code); ?></span>
<?php endif; ?>
<?php endif; ?>

Page 33 of 66
<!-- if result has been fetched succesffully -->
<?php if (isset($code)): ?>
<table class="table table-condensed">
<tr>
<th>Index</th>
<th>Name</th>
<th>Gender</th>
<th>Address</th>
<th>City</th>
<th>Mobile</th>
<th>Phone</th>
<th>Blood Group</th>
<tr>
<?php foreach ($code as $d): $i++; ?>
<tr class="<?php
if ($i % 2 == 0) {
echo "bg-success";
} else {
echo "bg-danger";
}
?>" >
<td><?= $i; ?></td>
<td><a href="profile.php?id=<?= $d['id']; ?>"><?= $d['fname'] . " " . $d['mname'] . " " .
$d['lname']; ?></a></td>
<td><?= $d['sex']; ?></td>
<td><?= wordwrap($d['h_address'], 20, "<br>"); ?></td>
<td><?= $d['city']; ?></td>
<td><?= $d['mobile']; ?></td>
<td><?= $d['phone']; ?></td>
<td><?= $d['b_type']; ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
<div class="col-md-1"></div>
</div>
</div>

Page 34 of 66
5.4 Dashboard Page

<?php
session_start();
if(!isset($_SESSION['IS_LOGIN'])){
header('location:login.php');
die();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home page</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div class="wrapper">
<div class="logo">
<img src="https://i.postimg.cc/mg4rWBmv/logo.png" alt="">
</div>
<ul class="nav-area">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">Contact</a></li>
<li><a href="logout.php">Logout</a></li>

<script src="https://kit.fontawesome.com/b99e675b6e.js"></script>

<div class="search_wrap search_wrap">


<div class="search_box">
<input type="text" class="input" placeholder="search...">
<div class="btn btn_common">
<i class="fas fa-search"></i>
</div>
</div>
</div>
</ul>
</div>
<div class="welcome-text">
<h1>
We are <span>Creative</span></h1>
<a href="#">KNOW MORE</a>
Page 35 of 66
</div>
</header>

</body>
</html>

Page 36 of 66
5.5 Registration Page

<?php
include('db.php');
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

$msg="";
if(isset($_POST['submit'])){
$name=$_POST['name'];
$email=$_POST['email'];
$password=$_POST['password'];

$check=mysqli_num_rows(mysqli_query($con,"select * from user where email='$email'"));

if($check>0){
$msg="Email id already present";
}else{
$verification_id=rand(111111111,999999999);

mysqli_query($con,"insert into
user(name,email,password,verification_status,verification_id)
values('$name','$email','$password',0,'$verification_id')");

$msg="We've just sent a verification link to <strong>$email</strong>. Please check


your inbox and click on the link to get started. If you can't find this email (which could be due to
spam filters), just request a new one here.";

$mailHtml="Please confirm your account registration by clicking the button or link


below: <a
href='http://127.0.0.1/otp/check.php?id=$verification_id'>http://127.0.0.1/otp/check.php?id=$verifi
cation_id</a>";

smtp_mailer($email,'Account Verification',$mailHtml);

}
}

function smtp_mailer($to,$subject, $msg){

//Load Composer's autoloader


require 'vendor/autoload.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Host = "smtp.gmail.com";
Page 37 of 66
$mail->Port = 587;
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Username = "confirmation.signup.otp@gmail.com";
$mail->Password = "Qwerty@123";
$mail->SetFrom("confirmation.signup.otp@gmail.com");
$mail->Subject = $subject;
$mail->Body =$msg;
$mail->AddAddress($to);
if(!$mail->Send()){
echo "OTP HAS BEEN NOT SENT ,TRY WITH DIFFERENT MAIL";
return 0;
}else{
echo"OTP HAS BEEN SENT !!! Confirm through your mail";
return 1;
}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<title>Registration Form</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-
theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
body{
height:1000px;
background:#475d62 url(../../assets/img/star-sky.jpg);
background-size:cover;
position:relative;
}
.form-control{
height: 40px;
box-shadow: none;
color: #969fa4;
}
.form-control:focus{
border-color: #5cb85c;
}
.form-control, .btn{
border-radius: 3px;
}
Page 38 of 66
.signup-form{
width: 400px;
margin: 0 auto;
padding: 30px 0;
}
.signup-form h2{
color: #636363;
margin: 0 0 15px;
position: relative;
text-align: center;
}
.signup-form h2:before, .signup-form h2:after{
content: "";
height: 2px;
width: 30%;
background: #d4d4d4;
position: absolute;
top: 50%;
z-index: 2;
}
.signup-form h2:before{
left: 0;
}
.signup-form h2:after{
right: 0;
}
.signup-form .hint-text{
color: #999;
margin-bottom: 30px;
text-align: center;
}
.signup-form form{
color: #999;
border-radius: 3px;
margin-bottom: 15px;
background: #f2f3f7;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.signup-form .form-group{
margin-bottom: 20px;
}
.signup-form input[type="checkbox"]{
margin-top: 3px;
}
.signup-form .btn{
font-size: 16px;
font-weight: bold;
min-width: 140px;
outline: none !important;
}
Page 39 of 66
.signup-form .row div:first-child{
padding-right: 10px;
}
.signup-form .row div:last-child{
padding-left: 10px;
}
.signup-form a{
color: #fff;
text-decoration: underline;
}
.signup-form a:hover{
text-decoration: none;
}
.signup-form form a{
color: #5cb85c;
text-decoration: none;
}
.signup-form form a:hover{
text-decoration: underline;
}
.signup-form .message{
color:red;
}
</style>
</head>
<body>
<div class="signup-form">
<form method="post">
<h2>Register</h2>
<p class="hint-text">Create your account. It's free and only takes a minute.</p>
<div class="form-group">
<input type="text" class="form-control" name="name" id="name" placeholder="Name"
required>
</div>
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Email"
required>
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" id="password"
placeholder="Password" required>
</div>

<div class="form-group">
<button type="submit" name="submit" class="btn btn-success btn-lg btn-block">Register
Now</button>
</div>
<div class="message">
<?php
echo $msg;
?>
Page 40 of 66
</div>
</form>
<div class="text-center">Already have an account? <a href="login.php">Sign in</a></div>
</div>
</body>
</html>

Page 41 of 66
5.6 Recovery Page

<?php
include('db.php');
$msg='';
if(isset($_POST['submit'])){
$name=$_POST['name'];
$email=$_POST['email'];
$password=$_POST['password'];

$check=mysqli_num_rows(mysqli_query($con,"select * from user where email='$email'"));

if($check>0){
$msg="Email id already present";
}
else{
$verification_id=rand(111111111,999999999);

mysqli_query($con,"insert into user(name,email,password,verification_status,verification_id)


values('$name','$email','$password',0,'$verification_id')");

}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<title>Registration Form</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-
theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
body{
height:1000px;
background:#475d62 url(../../assets/img/star-sky.jpg);
background-size:cover;
position:relative;
}
.form-control{
height: 40px;
box-shadow: none;
color: #969fa4;
}
Page 42 of 66
.form-control:focus{
border-color: #5cb85c;
}
.form-control, .btn{
border-radius: 3px;
}
.signup-form{
width: 400px;
margin: 0 auto;
padding: 30px 0;
}
.signup-form h2{
color: #636363;
margin: 0 0 15px;
position: relative;
text-align: center;
}
.signup-form h2:before, .signup-form h2:after{
content: "";
height: 2px;
width: 30%;
background: #d4d4d4;
position: absolute;
top: 50%;
z-index: 2;
}
.signup-form h2:before{
left: 0;
}
.signup-form h2:after{
right: 0;
}
.signup-form .hint-text{
color: #999;
margin-bottom: 30px;
text-align: center;
}
.signup-form form{
color: #999;
border-radius: 3px;
margin-bottom: 15px;
background: #f2f3f7;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.signup-form .form-group{
margin-bottom: 20px;
}
.signup-form input[type="checkbox"]{
margin-top: 3px;
}
.signup-form .btn{
font-size: 16px;
font-weight: bold;
min-width: 140px;
Page 43 of 66
outline: none !important;
}
.signup-form .row div:first-child{
padding-right: 10px;
}
.signup-form .row div:last-child{
padding-left: 10px;
}
.signup-form a{
color: #fff;
text-decoration: underline;
}
.signup-form a:hover{
text-decoration: none;
}
.signup-form form a{
color: #5cb85c;
text-decoration: none;
}
.signup-form form a:hover{
text-decoration: underline;
}
.signup-form .message{
color:red;
}
</style>
</head>
<body>
<div class="signup-form">
<form method="post">
<h2>Enter password</h2>
<p class="hint-text">Create your account. It's free and only takes a minute.</p>
<div class="form-group">
<input type="password" class="form-control" name="password" id="password"
placeholder="Password" required>
</div>

<div class="form-group">
<button type="submit" name="submit" class="btn btn-success btn-lg btn-block">Submit
now</button>
</div>
<div class="message">
<?php
echo $msg;
?>
</div>
</form>

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

Page 44 of 66
5.7 Upload Page

<?php

include 'config.php';

$link = "";
$link_status = "display: none;";

if (isset($_POST['upload'])) { // If isset upload button or not


// Declaring Variables
$location = "uploads/";
$file_new_name = date("dmy") . time() . $_FILES["file"]["name"]; // New and unique name of
uploaded file
$file_name = $_FILES["file"]["name"]; // Get uploaded file name
$file_temp = $_FILES["file"]["tmp_name"]; // Get uploaded file temp
$file_size = $_FILES["file"]["size"]; // Get uploaded file size

/*
How we can get mb from bytes
(mb*1024)*1024

In my case i'm 10 mb limit


(10*1024)*1024
*/

if ($file_size > 10485760) { // Check file size 10mb or not


echo "<script>alert('Woops! File is too big. Maximum file size allowed for upload 10
MB.')</script>";
} else {
$sql = "INSERT INTO uploaded_files (name, new_name)
VALUES ('$file_name', '$file_new_name')";
$result = mysqli_query($conn, $sql);
if ($result) {
move_uploaded_file($file_temp, $location . $file_new_name);
echo "<script>alert('Wow! File uploaded successfully.')</script>";
// Select id from database
$sql = "SELECT id FROM uploaded_files ORDER BY id DESC";
$result = mysqli_query($conn, $sql);
if ($row = mysqli_fetch_assoc($result)) {
$link = $base_url . "download.php?id=" . $row['id'];
$link_status = "display: block;";
}
} else {
echo "<script>alert('Woops! Something wong went.')</script>";
}
}
}
$title = "upload";
$setHomeActive = "active";
include 'layout/_header.php';

include 'layout/_top_nav.php';
?>
Page 45 of 66
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-


awesome.min.css">

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

<title>File Upload PHP Script - Pure Coding</title>


</head>
<body>
<div class="file__upload">
<div class="header">
<p><i class="fa fa-cloud-upload fa-
2x"></i><span><span>up</span>load</span></p>
</div>
<form action="" method="POST" enctype="multipart/form-data" class="body">
<!-- Sharable Link Code -->
<input type="checkbox" id="link_checkbox">
<input type="text" value="<?php echo $link; ?>" id="link" readonly>
<label for="link_checkbox" style="<?php echo $link_status; ?>">Get Sharable
Link</label>

<input type="file" name="file" id="upload" required>


<label for="upload">
<i class="fa fa-file-text-o fa-3x"></i>
<p>
<strong>Drag and drop</strong> files here<br>
or <span>browse</span> to begin the upload
</p>
</label>
<button name="upload" class="btn">Upload</button>
</form>
</div>
</body>
</html>

Page 46 of 66
5.8 Download Page

<?php

include 'config.php';

$id = $_GET['id']; // Get id from url bar

if (!$id) {
header("Location: index.php");
}

?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-


awesome.min.css">

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

<title>File Upload PHP Script - Pure Coding</title>


</head>
<body>
<div class="file__upload">
<div class="header">
<p><i class="fa fa-download fa-
2x"></i><span><span>down</span>load</span></p>
</div>
<form class="body">
<div class="download">
<?php

$sql = "SELECT * FROM uploaded_files WHERE id='$id'";


$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
if ($row = mysqli_fetch_assoc($result)) {
?>
<a href="uploads/<?php echo $row['new_name']; ?>" download="<?php echo $row['name']; ?>"
class="download_link"><?php echo $row['name']; ?></a>
<?php
}
}

?>
</div>
</form>
</div>
</body>
</html>
Page 47 of 66
Chapter 6
TESTING TOOLS
6. TESTING TOOLS
6.1 Introduction
Although testing can determine the correctness of software under the assumption of some
specific hypotheses (see hierarchy of testing difficulty below, testing cannot identify all the
defects within the software. Instead, it furnishes a criticism or comparison that compares the
state and behaviour of the product against oracles—principles or mechanisms by which
someone might recognise a problem. These oracles may include (but are not limited to) speci-
fications, contracts, comparable products, past versions of the same product, inferences about
intended or expected purpose, user or customer expectations, relevant standards, applicable
laws, or other criteria.
A primary purpose of testing is to detect software failures so that defects may be discovered
and corrected. Testing cannot establish that a product functions properly under all conditions,
but can only establish that it does not function properly under specific conditions. The scope
of software testing often includes examination of the code as well as execution of that code in
various environments and conditions as well as examining the aspects of code: does it do
what it is supposed to do and do what it needs to do. In the current culture of software devel-
opment, a testing organisation may be separate from the development team. There are various
roles for testing team members. Information derived from software testing may be used to
correct the process by which software is developed
Every software product has a target audience. For example, the audience for video game
software is completely different from banking software. Therefore, when an organisation de-
velops or otherwise invests in a software product, it can assess whether the software product
will be acceptable to its end users, its target audience, its purchasers and other stakeholders.
Software testing is the process of attempting to make this assessment.

Page 53 of 66
6.2 Types of Testing

6.2.1 White box testing


White box testing is a testing case design method that uses the control structure of the pro-
cedural design to derive test cases. All independent paths in a module are exercised at least
once, all logical decisions are exercised at once, execute all loops at boundaries and within
their operational bounds exercise internal data structure to ensure their validity. Here the
customer is given three chances to enter a valid choice out of the given menu. After which the
control exit the current menu.

6.2.2 Black Box Testing


Black Box Testing attempts to find errors in following areas or categories, incorrect or miss-
ing functions, interface error, errors in data structures, performance error and initialisation
and termination error. Here all the input data must match the data type to become a valid en-
try. The following are the different tests at various levels:

• Unit Testing
Unit testing is essential for the verification of the code produced during the coding
phase and the goal is to test the internal logic of the module/program. In the Generic
code project, the unit testing is done during the coding phase of data entry forms,
whether the functions are working properly or not. In this phase all the drivers are
tested they are rightly connected or not.

• Integration Testing
All the tested modules are combined into subsystems, which are then tested. The
goal is to see if the modules are properly integrated, and the emphasis being on the
testing interfaces between the modules. In the generic code integration testing is
done mainly on table creation module and insertion module.

• Validation Testing
This testing concentrates on confirming that the software is error-free in all respects. All
the specified validations are verified and the software is subject to hard-core testing. It
also aims at determining the degree of deviation that exists in the software designed from
the specifications; they are listed out and are corrected.

• System Testing
This testing is a series of different tests whose primary is to fully exercise the computer-
based system. This involves:Implementing the system in a simulated production envi-
ronment and testing it.Introducing errors and testing for error handling.

Page 54 of 66
6.3 Test Cases

Test Case 1 - Incorrect Login


Whenever an incorrect id or an incorrect password is entered, the login page displays a mes-
sage saying “Incorrect Username and/or password”.

Test Case 3–Data Unavailable


If the system couldn’t find the pdf then it shows “No data found(No Data/Missingdata).”

Test Case Expectation Actual Result Repot P/


F

Incorrect Login Display Message “In- Pass


correct Username and/ (Working
or Password” Valid Message Dis- Properly)
payed

Data Unavailable Display Message “No


data found (No Valid Message Dis- Pass
data/Miss- ing data).” payed (Working
Properly)

Table 6.3 : Test Cases for Modules

Page 55 of 66
Chapter 7
OUTPUT SCREENS
7. OUTPUT SCREENS

7.1 Login Page

Figure 7.1: Login Page

Page 57 of 66
7.2 Home Page

Figure 7.2: HomePage

Page 58 of 66
7.3 Registration & Recovery page

Figure 7.3.1: Registration Page displaying user to register

Figure 7.3.2: Recovery page to retrieve account

Page 59 of 66
7.4 Upload Page

Figure 7.4: Upload page

7.5 Download page

Figure 7.5: Download page

Page 60 of 66
7.5 About us Page

Figure 7.6: About us page

Page 61 of 66
Chapter 8
CONCLUSION

Page 62 of 66
CONCLUSION

The major problems educational institutions face with the usage of the Brain-Connect
Academic Solution are, seemingly, fixed in the proposed solution of using this online system .
It successfully manages to save costs, time and natural resources, provide better data-
managing abilities.

However, similar to the traditional model, the proposed system also requires administrator,
Teachers and Students, meaning that the load on each person is reduced, but it still requires
all of them to function correctly. There are a few such possible and achievable extensions
which can be made, and they will be added in the next versions, hope- fully.

8.1Future Enhancements

Brain-Connect Academic Solution, currently, works as intended and achieves the specified
goal effectively. But there are many possibilities to improve which can be made in the future
builds.

• Daily Report & Analysis module:


Adding such additional module like daily report and analysis will be more helpful
for the users specially the students. The daily report card holds the daily class
topics described by their teachers, holidays, special occasion, and all academic
related stuffs. This report card is maintained by the CR and it will be passed to
Academic-In-Charge who notify that in the website. And the analysis can also be
used to visualize and draw graphs, which will aid In-charges in making
appropriate decisions during the semester.

• Reducing data usage:


The CSS and scripting required by the web pages could be reduced, so that older
computers can run it as well, subsequently increasing the range of hardware that
can run it.

• Single Website for all:


The current system requires different universities/colleges to maintain their own
individual website. A single website can be used instead, where all colleges can
log in and store their details at one specific server ; this will aid in saving storage
space and also in fixing bugs quickly, as more support will be available to one
project.

Page 63 of 66
Chapter 9
BIBLIOGRAPHY

Page 64 of 66
Bibliography
1. R.S. Pressman, Software Engineering: A Practitione’s Approach, McGraw Hill, 2009.
2. P. Jalote, An Integrated Approach to Software Engineering, Narosa Publishing House,
2003.
3. K.K. Aggarwal and Y. Singh, Software Engineering, New Age International
Publishers, 2008.

4. Randal L. Schwartz and Tom Christiansen. Learning Perl, 2nd Edition. O’Reilly &
As-sociates, Inc., 101 Morris Street, Sebastopol, CA 95472, 1997, pp. 76.
5. Randy Jay Yarger, George Reese, and Tim King. MySQL and mSQL. O’Reilly &
As-sociates, Inc., 101 Morris Street, Sebastopol, CA 95472, 1999, pp. 51.
6. “Web Programming” by Chris Bates.
7. “Database Management Systems” by Ramakrishnan and Gehrke.
8. R. Elmasri, S.B. Navathe, Fundamentals of Database Systems 6th Edition, Pearson Education, 2010.
9. R. Ramakrishanan, J. Gehrke, Database Management Systems 3rd Edition, McGraw-Hill, 2002.
10. “Software Engineering” by Roger S. Pressman.

9.1 Websites

1. http://php.net/manual/en/
2. www.w3schools.com
3. www.tutorialspoint.com
4. www.stackoverflow.com
5. www.quora.com
6. www.youtube.com

Page 66 of 66

You might also like