0% found this document useful (0 votes)
26 views79 pages

MCA4

Uploaded by

majhiramesh7077
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)
26 views79 pages

MCA4

Uploaded by

majhiramesh7077
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/ 79

BALASORE COLLEGE OF ENGINEERING AND TECHNOLOGY

[Approved by AICTE, New Delhi and Affiliated to BPUT, Odisha.]


SERGARH, BALASORE - 756060, ODISHA. PH. - (06782) 236045, FAX - (06782) 236609
Website : www.bcetorissa.org, Mail Id. : bcetbalasore@yahoo.com

Project Report

On

ONLINE LIBRARY MANAGEMENT SYSTEM


Submitted to BPUT for the partial fulfilment of the
requirement For the award of degree for

Master In Computer Application

In the Session 2022-2024


BALASORE COLLEGE OF ENGINEERING & TECHNOLOGY,
SERAGARH,BALASORE,ODISHA

ACKNOWLEDGEMENT

We take this opportunity to express our hearty thanks to all those who
individually as well as collectively helped us in the successful completion of
this report .We are thankful to Dr Basanta Kumar Padhi, H.O.D., Department
of Master in Computer Application and also thankful to all the faculty
members of our MCA Department of Balasore College of Engineering and
Technology for having supported me to carry out this project report and for
their constant advice .

We also acknowledge the continuous encouragement rendered by our friends.


DECLARTION

We are the student of MCA hereby declare that We own our responsibility for
the information and results provided in the project titled “-Online Library
Management System-” , submitted to BPUT, Rourkela, Odisha for award
for MCA degree . We have taken care of , in all respect to honour the
intellectual property right and have acknowledged the contributions of others
for using them in this academic purpose . We further declare that in case of
any violation of intellectual property rights or copyright ,We as the candidate
would be fully responsible for the same .Our supervisor and institute should
not be held for full or partial violation of copyright if found at any stage of my
degree.

Date: 05-05-2024
Place: BALASORE
BALASORE COLLEGE OF ENGINEERING & TECHNOLOGY
SERAGARH,BALASORE,ODISHA

CERTIFICATE

This is to certify that the project entitled “Online library Management system” is carried out
by AMRUTANSHU PRUSTY a student of Master in Computer Application of Balasore
College of Engineering & Technology, Sergarh, Balasore bearing Regd. No. 2205225004
under my supervision and guidance .This project has been submitted in partial fulfilment
of course of MCA at BCET, Balasore.

No part of this project has been submitted for the award of any previous degree to the best
of my

knowledge.
CONTENT

Chapter-1
1.1 Introduction.

1.2 Motivation.

1.3 Objective.

Chapter-2
2.1 Background.

2.2 Scope of the problem.

2.3 Challenges.

Chapter-3
3.1 Requirement Analysis.

3.2 Requirement specification.

3.3 Scripting language.

Chapter- 4
4.1 Implementation & testing

4.2 Test results and report

Chapter -5
5.1 Conclusion

5.2 Future scope

References
Chapter: 1
1.1 Introduction
Introduction: Modern Generation is going to dependable on computer and through computer
we use Software. Hence, we are learning java that’s why we create an Application for managing
library system by using java. By using this, we can store a student’s information, issue a book
and store a student’s information who take a book from this library. Mainly this application are
used by Library administration.

1.2 Motivation: Libraries are essential in a process of giving


citizens access to knowledge. In digital times they are needed more
than ever before. In our country, library systems are written that’s why we make a great use of
paper. By making paper we cut trees. It is very harmful for our environment. For our
environment, we take this step to reduce this.

1.3 Objectives: The aim of this project is to develop a system that can handle & manage the
activities involved in a library in an efficient & reliable way. Less managing personnel & easy
searching availability & user profile managing are major goals in this project.

 Develop a system that can replace the manual library managing system.

 Develop a database which stores user details & book details.

 Give reliable search facility for the users.

 Administrator or librarian should have logins.

 Create an easy to understand user friendly environment.

 Attractive user interfaces to navigate through the system for the users.
 Develop the system documentation with detailed UML specifications.
Chapter: 2
2.1 Background
Library Management System is an application which refers to library systems which are
generally small or medium in size. It is used by librarian to manage the library using a
computerized system where he/she can record various transactions like issue of books, return of
books, addition of new books, addition of new students etc.

Books and student maintenance modules are also included in this system which would keep
track of the students using the library and also a detailed description about the books a library
contains. With this computerized system there will be no loss of book record or member record
which generally happens when a non computerized system is used.

All these modules are able to help librarian to manage the library with more convenience and
in a more efficient way as compared to library systems which are not computerized.
2.2 Scope of the Problem:

 When connect with Database table .


 When make a runnable jar file.
 When make a Exe file.

 When need to add some of extra jar file.

2.3 Challenges:

 Work with database.


 Make a runnable jar File.
 Make jar file to exe File.

 UMl design.
 Working with java GUI and Swim.
.
Chapter: 3
3.1 Requirement Specification
Requirement Collection & Analysis:

Software configuration:

This software package is developed using java as front end which is supported by sun micro
system. Microsoft SQL server is the back end to store the database.
Operating system: Windows 7, 8,10
Language: java Runtime Environment, NetBeans 8.2(front end) Database: Sqlite server
Hardware Configuration:

Processor: Pentium(R) Dual-core CPU to corei-7 Hard Disk:


minimum 40GB
RAM: 256 MB or more

SOFTWARE TOOL USED


The whole Project is divided in two parts the front end and the back end.

Frontend

The front end is designed using of Php, css, Java script.

PHP-

PHP is a server-side scripting language designed for web development but also used as a general-
purpose programming language. PHP is now installed on more than 244 million websites and 2.1
million web servers. Originally created by Rasmus Lerdorf in 1995, the reference implementation of
PHP is now produced by The PHP Group. While PHP originally stood for Personal Home Page, it
now stands for PHP: Hypertext Preprocessor, a recursive backronym .PHPcode is interpreted by a
web server with a PHP processor module, which generates the resulting web page: PHP commands
can be embedded directly into an HTML source document rather than calling an external file to
process data. It has also evolved to include a command-line inter face capability and can be used
in standalone graphical applications. PHP is free software released under the PHP License. PHP
can be deployed on most web servers and also as a stand alone shell on almost every operating
system and platform, free of charge.

Scripting Language:

A script is a set of programming instructions that is interpreted at runtime.

A scripting language is a language that interprets scripts at runtime. Scripts are usually embedded
into other software environments.

31.3M

460

What is Database SQL

Next
Stay

The purpose of the scripts is usually to enhance the performance or perform routine tasks for an
application.

Server side scripts are interpreted on the server while client side scripts are interpreted by the client
application.

PHP is a server side script that is interpreted on the server while JavaScript is an example of a client
side script that is interpreted by the client browser. Both PHP and JavaScript can be embedded into
HTML pages.

Programming Language Vs Scripting Language


Programming language Scripting language

Has all the features needed to develop Mostly used for routine tasks
complete applications.

The code has to be compiled before it can The code is usually executed without
be executed compiling

Does not need to be embedded into other Is usually embedded into other software
languages environments.
PHP means - Personal Home Page, but it now stands for the recursive backronym PHP: Hypertext Pre
processor.

PHP code may be embedded into HTML code, or it can be used in combination with various web
template systems, web content management system and web frameworks.

A PHP file can also contain tags such as HTML and client side scripts such as JavaScript.

 HTML is an added advantage when learning PHP Language. You can even learn PHP without
knowing HTML but it’s recommended you at least know the basics of HTML.
 Database management systems DBMS for database powered applications.
 For more advanced topics such as interactive applications and web services, you will
need JavaScript and XML.

The flowchart diagram shown below illustrates the basic architecture of a PHP web application and how
the server handles the requests.
Why use PHP?

You have obviously heard of a number of programming languages out there; you may be wondering why
we would want to use PHP as our poison for the web programming. Below are some of the compelling
reasons.

 PHP is open source and free.


 Short learning curve compared to other languages such as JSP, ASP etc.
 Large community document
 Most web hosting servers support PHP by default unlike other languages such as ASP that need
IIS. This makes PHP a cost effective choice.
 PHP is regular updated to keep abreast with the latest technology trends.
 Other benefit that you get with PHP is that it’s a server side scripting language; this means you
only need to install it on the server and client computers requesting for resources from the server
do not need to have PHP installed; only a web browser would be enough.
 PHP has in built support for working hand in hand with MySQL; this doesn’t mean you can’t
use PHP with other database management systems. You can still use PHP with
o Postgres
o Oracle
o MS SQL Server
o ODBC etc.
 PHP is cross platform; this means you can deploy your application on a number of different
operating systems such as windows, Linux, Mac OS etc.

What is PHP used for & Market share

In terms of market share, there are over 20 million websites and application on the internet developed
using PHP scripting language.

This may be attributed to the points raised above;

The diagram below shows some of the popular sites that use PHP
PHP vs Asp.Net VS JSP VS CFML

ASP – Active Server Pages, JSP – Java Server Pages, CFML – Cold Fusion Markup language The table
below compares the various server side scripting languages with PHP

FEATURE PHP ASP JSP CFML

Learning curve short Longer than Longer than Longer than PHP
PHP PHP

Web hosting Supported by Needs Fairly Needs dedicated


almost all dedicated supported server
hosting servers server

Open source Yes No Yes Both commercial


and open source

Web services Built in Uses the Uses add on Built in


support .NET libraries
framework

Integration Easy Fairly Fairly Easy


with HTML complex complex

MySQL Native Needs third Needs third Current version has


support party drivers party drivers native support.
Older versions use
ODBC
Easily Yes No Extended Yes
extended by using Java
other languages classes and
libraries.

PHP File Extensions

File extension and Tags In order for the server to identify our PHP files and scripts, we
must save the file with the “.php” extension. Older PHP file extensions include

 .phtml
 .php3
 .php4
 .php5
 .phps

PHP was designed to work with HTML, and as such, it can be embedded into the HTML code.

You can create PHP files without any html tags and that is called Pure PHP file .

The server interprets the PHP code and outputs the results as HTML code to the web browsers.

In order for the server to identify the PHP code from the HTML code, we must always enclose the PHP
code in PHP tags.

A PHP tag starts with the less than symbol followed by the question mark and then the words “php”.

PHP is a case sensitive language, “VAR” is not the same as “var”.

The PHP tags themselves are not case-sensitive, but it is strongly recommended that we use lower case
letter. The code below illustrates the above point.
<?php … ?>

We will be referring to the PHP lines of code as statements. PHP statements end with a semi colon (;). If
you only have one statement, you can omit the semi colon. If you have more than one statement, then you
must end each line with a semi colon. For the sake of consistency, it is recommended that you always end
your statement(s) with a semi colon. PHP scripts are executed on the server. The output is returned in
form of HTML.

 CSS

CSS Stands for "Cascading Style Sheet." Cascading style sheets are used to format the layout of Web
pages. They can be used to define text styles, table sizes, and other aspects of Web pages that
previously could only be defined in a page's HTML. The basic purpose of CSS is to separate the
content of a web document (written in any markup language)from its presentation (that is written
using Cascading Style Sheets). There are lots of benefits that one can extract through CSS like
improved content accessibility ,better flexibility and more over, CSS gives a level of control over
various presentation characteristics of the document. It also helps in reducing the complexity and helps
in saving overall presentation time. CSS gives the option of selecting various style schemes and
rules according to the requirements and it also allows the same HTML document to be presented in more
than one varying style.

Advantages of CSS

 CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML pages.
You can define a style for each HTML element and apply it to as many Web pages as you want.

 Pages load faster − If you are using CSS, you do not need to write HTML tag attributes every
time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code
means faster download times.

 Easy maintenance − To make a global change, simply change the style, and all elements in all
the web pages will be updated automatically.

 Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can
give a far better look to your HTML page in comparison to HTML attributes.
 Multiple Device Compatibility − Style sheets allow content to be optimized for more than one
type of device. By using the same HTML document, different versions of a website can be
presented for handheld devices such as PDAs and cell phones or for printing.

 Global web standards − Now HTML attributes are being deprecated and it is being
recommended to use CSS. So its a good idea to start using CSS in all the HTML pages to make
them compatible to future browsers.

Who Creates and Maintains CSS?

CSS is created and maintained through a group of people within the W3C called the CSS Working
Group. The CSS Working Group creates documents called specifications. When a specification has been
discussed and officially ratified by the W3C members, it becomes a recommendation.

These ratified specifications are called recommendations because the W3C has no control over the actual
implementation of the language. Independent companies and organizations create that software.

A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding
elements in your document. A style rule is made of three parts −

 Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like
<h1> or <table> etc.

 Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes
are converted into CSS properties. They could be color, border etc.

 Value − Values are assigned to properties. For example, color property can have value
either red or #F1F1F1 etc.

You can put CSS Style Rule Syntax as follows −

selector { property: value }


 JAVASCRIPT

JavaScript is considered to be one of the most famous scripting languages of all time. JavaScript, by
definition, is a Scripting Language of the World Wide Web. The main usage of JavaScript is to add
various Web function a lities, Web form validations, browser detections, creation of cookies and so
on. JavaScript is one of the most popular scripting languages and that is why it is supported by almost all
web browsers available today like Firefox, We used the browser Opera or Internet Explorer.
JavaScript is considered to be one of the most powerful scripting languages in use today. It is often
used for the development of client-side web development. JavaScript is used to make web pages
more interactive and dynamic.
JavaScript is a light weight programming language and it is embedded directly into the HTML code.
JavaScript, as the name suggests, was influenced by many languages, especially Java.

Where to find JavaScript information

The JavaScript documentation on MDN includes the following:

 Learn Web Development provides information for beginners and introduces basic concepts of
programming and the Internet.
 JavaScript Guide (this guide) provides an overview about the JavaScript language and its objects.
 JavaScript Reference provides detailed reference material for JavaScript.
If you are new to JavaScript, start with the articles in the learning area and the JavaScript Guide. Once you
have a firm grasp of the fundamentals, you can use the JavaScript Reference to get more details on
individual objects and statements.

What is JavaScript?

JavaScript is a cross-platform, object-oriented scripting language used to make webpages interactive (e.g.,
having complex animations, clickable buttons, popup menus, etc.). There are also more advanced server
side versions of JavaScript such as Node.js, which allow you to add more functionality to a website than
downloading files (such as realtime collaboration between multiple computers). Inside a host environment
(for example, a web browser), JavaScript can be connected to the objects of its environment to provide
programmatic control over them.

JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language
elements such as operators, control structures, and statements. Core JavaScript can be extended for a
variety of purposes by supplementing it with additional objects; for example:

 Client-side JavaScript extends the core language by supplying objects to control a browser and
its Document Object Model (DOM). For example, client-side extensions allow an application to
place elements on an HTML form and respond to user events such as mouse clicks, form input, and
page navigation.
 Server-side JavaScript extends the core language by supplying objects relevant to running
JavaScript on a server. For example, server-side extensions allow an application to communicate
with a database, provide continuity of information from one invocation to another of the
application, or perform file manipulations on a server.
This means that in the browser, JavaScript can change the way the webpage (DOM) looks. And, likewise,
Node.js JavaScript on the server can respond to custom requests from code written in the browser.

JavaScript and Java

JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript
language resembles Java but does not have Java's static typing and strong type checking. JavaScript
follows most Java expression syntax, naming conventions and basic control-flow constructs which was the
reason why it was renamed from Live Script to JavaScript.

In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime
system based on a small number of data types representing numeric, Boolean, and string values. JavaScript
has a prototype-based object model instead of the more common class-based object model. The prototype-
based model provides dynamic inheritance; that is, what is inherited can vary for individual objects.
JavaScript also supports functions without any special declarative requirements. Functions can be
properties of objects, executing as loosely typed methods.

JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes,
and methods. You do not have to be concerned with whether methods are public, private, or protected, and
you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly
typed.

Java is a class-based programming language designed for fast execution and type safety. Type safety
means, for instance, that you can't cast a Java integer into an object reference or access private memory by
corrupting Java byte codes. Java's class-based model means that programs consist exclusively of classes
and their methods. Java's class inheritance and strong typing generally require tightly coupled object
hierarchies. These requirements make Java programming more complex than JavaScript programming.

In contrast, JavaScript descends in spirit from a line of smaller, dynamically typed languages such as
HyperTalk and dBASE. These scripting languages offer programming tools to a much wider audience
because of their easier syntax, specialized built-in functionality, and minimal requirements for object
creation.

For more information on the differences between JavaScript and Java, see the chapter Details of the object
model.

JavaScript and the ECMAScript specification

JavaScript is standardized at Ecma International — the European association for standardizing information
and communication systems (ECMA was formerly an acronym for the European Computer Manufacturers
Association) to deliver a standardized, international programming language based on JavaScript. This
standardized version of JavaScript, called ECMA Script, behaves the same way in all applications that
support the standard. Companies can use the open standard language to develop their implementation of
JavaScript. The ECMA Script standard is documented in the ECMA-262 specification. See New in
JavaScript to learn more about different versions of JavaScript and ECMA Script specification editions.

The ECMA-262 standard is also approved by the ISO (International Organization for Standardization) as
ISO-16262. You can also find the specification on the Ecma International website. The ECMA Script
specification does not describe the Document Object Model (DOM), which is standardized by the World
Wide Web Consortium (W3C) and/or WHATWG (Web Hypertext Application Technology Working
Group). The DOM defines the way in which HTML document objects are exposed to your script. To get a
better idea about the different technologies that are used when programming with JavaScript, consult the
article JavaScript technologies overview.
The ECMA Script specification is a set of requirements for implementing ECMA Script. It is useful if you
want to implement standards-compliant language features in your ECMA Script implementation or engine
(such as Spider Monkey in Firefox, or V8 in Chrome).

The ECMA Script document is not intended to help script programmers. Use the JavaScript documentation
for information when writing scripts.

The ECMA Script specification uses terminology and syntax that may be unfamiliar to a JavaScript
programmer. Although the description of the language may differ in ECMA Script, the language itself
remains the same. JavaScript supports all functionality outlined in the ECMA Script specification.

The JavaScript documentation describes aspects of the language that are appropriate for a JavaScript
programmer.

What is a Database?
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 also 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 type of systems.

Nowadays, we use relational database management systems (RDBMS) to store and manage 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 Foreign 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.

RDBMS Terminology
Before we proceed to explain the MySQL database system, let us revise a few definitions related to the
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 spread sheet.
 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
subscription.
 Redundancy − Storing data twice, redundantly to make the system faster.
 Primary Key − A primary key is unique. A key value can not occur twice in one table. With a
key, you can only find one row.
 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.
MySQL Database
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 −
 MySQL is released under an open-source license. So you have nothing to pay to use it.
 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.
 MySQL uses a standard form of the well-known SQL data language.
 MySQL works on many operating systems and with many languages including PHP, PERL, C,
C++, JAVA, etc.
 MySQL works very quickly and works well even with large data sets.
 MySQL is very friendly to PHP, the most appreciated language for web development.
 MySQL supports large databases, up to 50 million rows or more in a table. The default file size
limit for a table is 4GB, but you can increase this (if your operating system can handle it) to a
theoretical limit of 8 million terabytes (TB).
 MySQL is customizable. The open-source GPL license allows programmers to modify the
MySQL software to fit their own specific environments.
All downloads for MySQL are located at MySQL Downloads. Pick the version number of MySQL
Community Server which is required along with the platform you will be running it on.
Installing MySQL on Linux/UNIX
The recommended way to install MySQL on a Linux system is via RPM. MySQL AB makes the
following RPMs available for download on its website −
 MySQL − The MySQL database server manages the databases and tables, controls user access
and processes the SQL queries.
 MySQL-client − MySQL client programs, which make it possible to connect to and interact with
the server.
 MySQL-devel − Libraries and header files that come in handy when compiling other programs
that use MySQL.
 MySQL-shared − Shared libraries for the MySQL client.
 MySQL-bench − Benchmark and performance testing tools for the MySQL database server.
The MySQL RPMs listed here are all built on a SuSE Linux system, but they will usually work on other
Linux variants with no difficulty.
Now, you will need to adhere to the steps given below, to proceed with the installation −
 Login to the system using the root user.
 Switch to the directory containing the RPMs.
 Install the MySQL database server by executing the following command. Remember to replace
the filename in italics with the file name of your RPM.
[root@host]# rpm -i MySQL-5.0.9-0.i386.rpm
The above command takes care of installing the MySQL server, creating a user of MySQL, creating
necessary configuration and starting the MySQL server automatically.
You can find all the MySQL related binaries in /usr/bin and /usr/sbin. All the tables and databases will
be created in the /var/lib/mysql directory.
The following code box has an optional but recommended step to install the remaining RPMs in the
same manner −
[root@host]# rpm -i MySQL-client-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-devel-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-shared-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-bench-5.0.9-0.i386.rpm

Installing MySQL on Windows


The default installation on any version of Windows is now much easier than it used to be, as MySQL
now comes neatly packaged with an installer. Simply download the installer package, unzip it anywhere
and run the setup.exe file.
The default installer setup.exe will walk you through the trivial process and by default will install
everything under C:\mysql.
Test the server by firing it up from the command prompt the first time. Go to the location of the mysqld
server which is probably C:\mysql\bin, and type −

mysqld.exe --console

NOTE − If you are on NT, then you will have to use mysqld-nt.exe instead of mysqld.exe

If all went well, you will see some messages about startup and InnoDB. If not, you may have a
permissions issue. Make sure that the directory that holds your data is accessible to whatever user
(probably MySQL) the database processes run under.

MySQL will not add itself to the start menu, and there is no particularly nice GUI way to stop the server
either. Therefore, if you tend to start the server by double clicking the mysqld executable, you should
remember to halt the process by hand by using mysqladmin, Task List, Task Manager, or other
Windows-specific means.

Verifying MySQL Installation

After MySQL, has been successfully installed, the base tables have been initialized and the server has
been started: you can verify that everything is working as it should be via some simple tests.

Use the mysqladmin Utility to Obtain Server Status

Use mysqladmin binary to check the server version. This binary would be available in /usr/bin on linux
and in C:\mysql\bin on windows.

[root@host]#mysqladmin --version

It will produce the following result on Linux. It may vary depending on your installation −

mysqladmin Ver 8.23 Distrib 5.0.9-0, for redhat-linux-gnu on i386

If you do not get such a message, then there may be some problem in your installation and you would
need some help to fix it.

Execute simple SQL commands using the MySQL Client

You can connect to your MySQL server through the MySQL client and by using the mysql command.
At this moment, you do not need to give any password as by default it will be set as blank.

You can just use following command −

[root@host]#mysql
It should be rewarded with a mysql> prompt. Now, you are connected to the MySQL server and you can
execute all the SQL commands at the mysql> prompt as follows −

mysql> SHOW DATABASES;


+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.13 sec)
Post-installation Steps

MySQL ships with a blank password for the root MySQL user. As soon as you have successfully
installed the database and the client, you need to set a root password as given in the following code block

[root@host]#mysqladmin -u root password "new_password";

Now to make a connection to your MySQL server, you would have to use the following command −

[root@host]#mysql -u root -p
Enter password:*******

UNIX users will also want to put your MySQL directory in your PATH, so you won't have to keep
typing out the full path every time you want to use the command-line client.

For bash, it would be something like −

export PATH = $PATH:/usr/bin:/usr/sbin


Running MySQL at Boot Time

If you want to run the MySQL server at boot time, then make sure you have the following entry in the
/etc/rc.local file.

/etc/init.d/mysqld start
Running and Shutting down MySQL Server

First check if your MySQL server is running or not. You can use the following command to check it −

ps -ef | grep mysqld

If your MySql is running, then you will see mysqld process listed out in your result. If server is not
running, then you can start it by using the following command −

root@host# cd /usr/bin
./safe_mysqld&

Now, if you want to shut down an already running MySQL server, then you can do it by using the
following command −

root@host# cd /usr/bin
./mysqladmin -u root -p shutdown
Enter password: ******

Setting Up a MySQL User Account

For adding a new user to MySQL, you just need to add a new entry to the user table in the
database mysql.

The following program is an example of adding a new user guest with SELECT, INSERT and UPDATE
privileges with the password guest123; the SQL query is −

root@host# mysql -u root -p


Enterpassword:*******
mysql>usemysql;
Database changed

mysql> INSERT INTO user


(host, user, password,
select_priv,insert_priv,update_priv)
VALUES ('localhost','guest',
PASSWORD('guest123'),'Y','Y','Y');
Query OK,1 row affected (0.20 sec)

mysql> FLUSH PRIVILEGES;


Query OK,1 row affected (0.01 sec)

mysql> SELECT host, user, password FROM user WHERE user ='guest';
+-----------+---------+------------------+
| host |user | password |
+-----------+---------+------------------+
| localhost | guest|6f8c114b58f2ce9e|
+-----------+---------+------------------+
1 row inset(0.00 sec)

When adding a new user, remember to encrypt the new password using PASSWORD() function
provided by MySQL. As you can see in the above example, the password mypass is encrypted to
6f8c114b58f2ce9e.

Notice the FLUSH PRIVILEGES statement. This tells the server to reload the grant tables. If you don't
use it, then you won't be able to connect to MySQL using the new user account at least until the server is
rebooted.

You can also specify other privileges to a new user by setting the values of following columns in user
table to 'Y' when executing the INSERT query or you can update them later using UPDATE query.
 Select_priv
 Insert_priv
 Update_priv
 Delete_priv
 Create_priv
 Drop_priv
 Reload_priv
 Shutdown_priv
 Process_priv
 File_priv
 Grant_priv
 References_priv
 Index_priv
 Alter_priv

Another way of adding user account is by using GRANT SQL command. The following example will
add user zara with password zara123 for a particular database, which is named as TUTORIALS.

root@host# mysql -u root -p password;


Enterpassword:*******
mysql>usemysql;
Database changed

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP


-> ON TUTORIALS.*
-> TO 'zara'@'localhost'
-> IDENTIFIED BY 'zara123';

This will also create an entry in the MySQL database table called as user.

NOTE − MySQL does not terminate a command until you give a semi colon (;) at the end of the SQL
command.
The /etc/my.cnf File Configuration

In most of the cases, you should not touch this file. By default, it will have the following entries −

[mysqld]
datadir=/var/lib/mysql
socket =/var/lib/mysql/mysql.sock

[mysql.server]
user =mysql
basedir=/var/lib

[safe_mysqld]
err-log =/var/log/mysqld.log
pid-file =/var/run/mysqld/mysqld.pid

Here, you can specify a different directory for the error log, otherwise you should not change any entry
in this table.

Administrative MySQL Command

Here is the list of the important MySQL commands, which you will use time to time to work with
MySQL database −

 USE Databasename − This will be used to select a database in the MySQL workarea.

 SHOW DATABASES − Lists out the databases that are accessible by the MySQL DBMS.

 SHOW TABLES − Shows the tables in the database once a database has been selected with the
use command.

 SHOW COLUMNS FROM tablename: Shows the attributes, types of attributes, key
information, whether NULL is permitted, defaults, and other information for a table.

 SHOW INDEX FROM tablename − Presents the details of all indexes on the table, including
the PRIMARY KEY.

 SHOW TABLE STATUS LIKE tablename\G − Reports details of the MySQL DBMS
performance and statistics.
MySQL works very well in combination of various programming languages like PERL, C, C++, JAVA
and PHP. Out of these languages, PHP is the most popular one because of its web application
development capabilities.

This tutorial focuses heavily on using MySQL in a PHP environment. If you are interested in MySQL
with PERL, then you can consider reading the PERL Tutorial.

PHP provides various functions to access the MySQL database and to manipulate the data records inside
the MySQL database. You would require to call the PHP functions in the same way you call any other
PHP function.

The PHP functions for use with MySQL have the following general format −

mysql_function(value,value,...);

The second part of the function name is specific to the function, usually a word that describes what the
function does. The following are two of the functions, which we will use in our tutorial −

mysqli_connect($connect);mysqli_query($connect,"SQL statement");
DATA FLOW DIAGRAM’S

LEVEL 0

LEVEL 1
Chapter:4

4.1 Implementation & Testing CODING:-


Dashboard.php

<?php

session_start();

error_reporting(0);

include('includes/config.php');

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{?>

<!DOCTYPE html>

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

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

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

<meta name="author" content="" />

<title>Online Library Management System | User Dash Board</title>

<!-- BOOTSTRAP CORE STYLE -->

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

<!-- FONT AWESOME STYLE -->


<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

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

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />

</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

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

<h4 class="header-line">ADMIN DASHBOARD</h4>

</div>

</div>

<div class="row">

<div class="col-md-3 col-sm-3 col-xs-6">


<div class="alert alert-info back-widget-set text-center">

<i class="fa fa-bars fa-5x"></i>

<?php

$sid=$_SESSION['stdid'];

$sql1 ="SELECT id from tblissuedbookdetails where StudentID=:sid";

$query1 = $dbh -> prepare($sql1);

$query1->bindParam(':sid',$sid,PDO::PARAM_STR);

$query1->execute();

$results1=$query1->fetchAll(PDO::FETCH_OBJ);

$issuedbooks=$query1->rowCount();

?>

<h3><?php echo htmlentities($issuedbooks);?> </h3>

Book Issued

</div>

</div>

<div class="col-md-3 col-sm-3 col-xs-6">

<div class="alert alert-warning back-widget-set text-center">

<i class="fa fa-recycle fa-5x"></i>

<?php

$rsts=0;

$sql2 ="SELECT id from tblissuedbookdetails where StudentID=:sid and RetrunStatus=:rsts";

$query2 = $dbh -> prepare($sql2);

$query2->bindParam(':sid',$sid,PDO::PARAM_STR);

$query2->bindParam(':rsts',$rsts,PDO::PARAM_STR);

$query2->execute();
$results2=$query2->fetchAll(PDO::FETCH_OBJ);

$returnedbooks=$query2->rowCount();

?>

<h3><?php echo htmlentities($returnedbooks);?></h3>

Books Not Returned Yet

</div>

</div>

</div>

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->

<!-- CORE JQUERY -->

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

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

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</body>

</html>

<?php } ?>
my-profile.php

<?php

session_start();

include('includes/config.php');

error_reporting(0);

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{

if(isset($_POST['update']))

$sid=$_SESSION['stdid'];

$fname=$_POST['fullanme'];

$mobileno=$_POST['mobileno'];

$sql="update tblstudents set FullName=:fname,MobileNumber=:mobileno where StudentId=:sid";

$query = $dbh->prepare($sql);

$query->bindParam(':sid',$sid,PDO::PARAM_STR);

$query->bindParam(':fname',$fname,PDO::PARAM_STR);

$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);

$query->execute();

echo '<script>alert("Your profile has been updated")</script>';

}
?>

<!DOCTYPE html>

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

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

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

<meta name="author" content="" />

<!--[if IE]>

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<![endif]-->

<title>Online Library Management System | Student Signup</title>

<!-- BOOTSTRAP CORE STYLE -->

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

<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

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

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />

</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>
<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

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

<h4 class="header-line">My Profile</h4>

</div>

</div>

<div class="row">

<div class="col-md-9 col-md-offset-1">

<div class="panel panel-danger">

<div class="panel-heading">

My Profile

</div>

<div class="panel-body">

<form name="signup" method="post">

<?php

$sid=$_SESSION['stdid'];

$sql="SELECT StudentId,FullName,EmailId,MobileNumber,RegDate,UpdationDate,Status from tblstudents


where StudentId=:sid ";

$query = $dbh -> prepare($sql);

$query-> bindParam(':sid', $sid, PDO::PARAM_STR);

$query->execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;

if($query->rowCount() > 0)

foreach($results as $result)

{ ?>

<div class="form-group">

<label>Student ID : </label>

<?php echo htmlentities($result->StudentId);?>

</div>

<div class="form-group">

<label>Reg Date : </label>

<?php echo htmlentities($result->RegDate);?>

</div>

<?php if($result->UpdationDate!=""){?>

<div class="form-group">

<label>Last Updation Date : </label>

<?php echo htmlentities($result->UpdationDate);?>

</div>

<?php } ?>

<div class="form-group">

<label>Profile Status : </label>

<?php if($result->Status==1){?>

<span style="color: green">Active</span>


<?php } else { ?>

<span style="color: red">Blocked</span>

<?php }?>

</div>

<div class="form-group">

<label>Enter Full Name</label>

<input class="form-control" type="text" name="fullanme" value="<?php echo htmlentities($result-


>FullName);?>" autocomplete="off" required />

</div>

<div class="form-group">

<label>Mobile Number :</label>

<input class="form-control" type="text" name="mobileno" maxlength="10" value="<?php echo


htmlentities($result->MobileNumber);?>" autocomplete="off" required />

</div>

<div class="form-group">

<label>Enter Email</label>

<input class="form-control" type="email" name="email" id="emailid" value="<?php echo htmlentities($result-


>EmailId);?>" autocomplete="off" required readonly />

</div>

<?php }} ?>

<button type="submit" name="update" class="btn btn-primary" id="submit">Update Now </button>


</form>

</div>

</div>

</div>

</div>

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<script src="assets/js/jquery-1.10.2.js"></script>

<!-- BOOTSTRAP SCRIPTS -->

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

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</body>

</html>

<?php } ?>

Index.php
<?php

session_start();

error_reporting(0);

include('includes/config.php');

if($_SESSION['login']!=''){

$_SESSION['login']='';

if(isset($_POST['login']))

{
//code for captach verification

if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') {

echo "<script>alert('Incorrect verification code');</script>" ;

else {

$email=$_POST['emailid'];

$password=md5($_POST['password']);

$sql ="SELECT EmailId,Password,StudentId,Status FROM tblstudents WHERE EmailId=:email and


Password=:password";

$query= $dbh -> prepare($sql);

$query-> bindParam(':email', $email, PDO::PARAM_STR);

$query-> bindParam(':password', $password, PDO::PARAM_STR);

$query-> execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

if($query->rowCount() > 0)

foreach ($results as $result) {

$_SESSION['stdid']=$result->StudentId;

if($result->Status==1)

$_SESSION['login']=$_POST['emailid'];

echo "<script type='text/javascript'> document.location ='dashboard.php'; </script>";

} else {

echo "<script>alert('Your Account Has been blocked .Please contact admin');</script>";

}
}

else{

echo "<script>alert('Invalid Details');</script>";

?>

<!DOCTYPE html>

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

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

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

<meta name="author" content="" />

<title>Online Library Management System | </title>

<!-- BOOTSTRAP CORE STYLE -->

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

<!-- FONT AWESOME STYLE -->

<link href="assets/css/font-awesome.css" rel="stylesheet" />

<!-- CUSTOM STYLE -->

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

<!-- GOOGLE FONT -->

<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />


</head>

<body>

<!------MENU SECTION START-->

<?php include('includes/header.php');?>

<!-- MENU SECTION END-->

<div class="content-wrapper">

<div class="container">

<div class="row pad-botm">

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

<h4 class="header-line">USER LOGIN FORM</h4>

</div>

</div>

<!--LOGIN PANEL START-->

<div class="row">

<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3" >

<div class="panel panel-info">

<div class="panel-heading">

LOGIN FORM

</div>

<div class="panel-body">

<form role="form" method="post">

<div class="form-group">

<label>Enter Email id</label>

<input class="form-control" type="text" name="emailid" required autocomplete="off" />

</div>
<div class="form-group">

<label>Password</label>

<input class="form-control" type="password" name="password" required autocomplete="off" />

<p class="help-block"><a href="user-forgot-password.php">Forgot Password</a></p>

</div>

<div class="form-group">

<label>Verification code : </label>

<input type="text" class="form-control1" name="vercode" maxlength="5" autocomplete="off" required


style="height:25px;" />&nbsp;<img src="captcha.php">

</div>

<button type="submit" name="login" class="btn btn-info">LOGIN </button> | <a href="signup.php">Not


Register Yet</a>

</form>

</div>

</div>

</div>

</div>

<!---LOGIN PABNEL END-->

</div>

</div>

<!-- CONTENT-WRAPPER SECTION END-->

<?php include('includes/footer.php');?>

<!-- FOOTER SECTION END-->

<script src="assets/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->

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

<!-- CUSTOM SCRIPTS -->

<script src="assets/js/custom.js"></script>

</body>

</html>

Index.php
<?php

session_start();

include('includes/config.php');

if(isset($_POST['login']))

$emailreg=$_POST['emailreg'];

$password=$_POST['password'];

$stmt=$mysqli->prepare("SELECT email,password,id FROM userregistration WHERE (email=? ||


regNo=?) and password=? ");

$stmt->bind_param('sss',$emailreg,$emailreg,$password);

$stmt->execute();

$stmt -> bind_result($email,$password,$id);

$rs=$stmt->fetch();

$stmt->close();

$_SESSION['id']=$id;
$_SESSION['login']=$emailreg;

$uip=$_SERVER['REMOTE_ADDR'];

$ldate=date('d/m/Y h:i:s', time());

if($rs)

$uid=$_SESSION['id'];

$uemail=$_SESSION['login'];

$ip=$_SERVER['REMOTE_ADDR'];

$geopluginURL='http://www.geoplugin.net/php.gp?ip='.$ip;

$addrDetailsArr = unserialize(file_get_contents($geopluginURL));

$city = $addrDetailsArr['geoplugin_city'];

$country = $addrDetailsArr['geoplugin_countryName'];

$log="insert into userLog(userId,userEmail,userIp,city,country)


values('$uid','$uemail','$ip','$city','$country')";

$mysqli->query($log);

if($log)

header("location:dashboard.php");

else

echo "<script>alert('Invalid Username/Email or


password');</script>";

}
?>

<!doctype html>

<html lang="en" class="no-js">

<head>

<meta charset="UTF-8">

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

<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1,


maximum-scale=1">

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

<meta name="author" content="">

<meta name="theme-color" content="#3e454c">

<title>Student Hostel Registration</title>

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

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

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

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

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

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

<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">

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

<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>

<script type="text/javascript" src="js/validation.min.js"></script>

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>

<script type="text/javascript">

function valid()
{

if(document.registration.password.value!= document.registration.cpassword.value)

alert("Password and Re-Type Password Field do not match !!");

document.registration.cpassword.focus();

return false;

return true;

</script>

</head>

<body>

<?php include('includes/header.php');?>

<div class="ts-main-content">

<?php include('includes/sidebar.php');?>

<div class="content-wrapper">

<div class="container-fluid">

<div class="row">

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

<h2 class="page-title">User Login </h2>

<div class="row">

<div class="col-md-6 col-md-offset-3">

<div class="well row pt-2x pb-3x bk-light">

<div class="col-md-8 col-md-offset-2">

<form action="" class="mt" method="post">


<label for="" class="text-uppercase
text-sm">Email / Registration Number</label>

<input type="text"
placeholder="Email / Registration Number" name="emailreg" class="form-control mb" required="true">

<label for="" class="text-uppercase text-


sm">Password</label>

<input type="password"
placeholder="Password" name="password" class="form-control mb" required="true">

<input type="submit" name="login"


class="btn btn-primary btn-block" value="login" >

</form>

</div>

</div>

<div class="text-center text-light" style="color:black;">

<a href="forgot-password.php"
style="color:black;">Forgot password?</a>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>
</div>

</div>

</div>

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

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

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

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

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

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

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

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

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

</body>

</html>
Registration.php
<?php
session_start();
include('includes/config.php');
if(isset($_POST['submit']))
{
$regno=$_POST['regno'];
$fname=$_POST['fname'];
$mname=$_POST['mname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$contactno=$_POST['contact'];
$emailid=$_POST['email'];
$password=$_POST['password'];
$result ="SELECT count(*) FROM userRegistration WHERE email=? || regNo=?";
$stmt = $mysqli->prepare($result);
$stmt->bind_param('ss',$email,$regno);
$stmt->execute();
$stmt->bind_result($count);
$stmt->fetch();
$stmt->close();
if($count>0)
{
echo"<script>alert('Registration number or email id already registered.');</script>";
}else{

$query="insert into userRegistration(regNo,firstName,middleName,lastName,gender,contactNo,email,password)


values(?,?,?,?,?,?,?,?)";
$stmt = $mysqli->prepare($query);
$rc=$stmt->bind_param('sssssiss',$regno,$fname,$mname,$lname,$gender,$contactno,$emailid,$password);
$stmt->execute();
echo"<script>alert('Student Succssfully register');</script>";
}
}
?>

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-
scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="theme-color" content="#3e454c">
<title>User Registration</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">>
<link rel="stylesheet" href="css/bootstrap-social.css">
<link rel="stylesheet" href="css/bootstrap-select.css">
<link rel="stylesheet" href="css/fileinput.min.css">
<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
<script type="text/javascript" src="js/validation.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
function valid()
{
if(document.registration.password.value!= document.registration.cpassword.value)
{
alert("Password and Re-Type Password Field do not match !!");
document.registration.cpassword.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<?php include('includes/header.php');?>
<div class="ts-main-content">
<?php include('includes/sidebar.php');?>
<div class="content-wrapper">
<div class="container-fluid">

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

<h2 class="page-title">Student Registration </h2>

<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">Fill all
Info</div>
<div class="panel-body">
<form method="post" action="" name="registration" class="form-horizontal"
onSubmit="return valid();">

<div class="form-group">
<label class="col-sm-2 control-label"> Registration No : </label>
<div class="col-sm-8">
<input type="text" name="regno" id="regno" class="form-control" required="required"
onBlur="checkRegnoAvailability()">
<span id="user-reg-availability" style="font-size:12px;"></span>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">First Name : </label>
<div class="col-sm-8">
<input type="text" name="fname" id="fname" class="form-control" required="required" >
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Middle Name : </label>
<div class="col-sm-8">
<input type="text" name="mname" id="mname" class="form-control">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Last Name : </label>
<div class="col-sm-8">
<input type="text" name="lname" id="lname" class="form-control" required="required">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Gender : </label>
<div class="col-sm-8">
<select name="gender" class="form-control" required="required">
<option value="">Select Gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="others">Others</option>
</select>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Contact No : </label>
<div class="col-sm-8">
<input type="text" name="contact" id="contact" class="form-control" required="required">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Email id: </label>
<div class="col-sm-8">
<input type="email" name="email" id="email" class="form-control" onBlur="checkAvailability()"
required="required">
<span id="user-availability-status" style="font-size:12px;"></span>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Password: </label>
<div class="col-sm-8">
<input type="password" name="password" id="password" class="form-control" required="required">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Confirm Password : </label>
<div class="col-sm-8">
<input type="password" name="cpassword" id="cpassword" class="form-control" required="required">
</div>
</div>

<div class="col-sm-6 col-sm-offset-4">


<button class="btn btn-default" type="reset">Reset</button>
<input type="submit" name="submit" Value="Register" class="btn btn-primary">
</div>
</form>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/fileinput.js"></script>
<script src="js/chartData.js"></script>
<script src="js/main.js"></script>
</body>
<script>
function checkAvailability() {

$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'emailid='+$("#email").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
$("#loaderIcon").hide();
},
error:function ()
{
event.preventDefault();
alert('error');
}
});
}
</script>
<script>
function checkRegnoAvailability() {

$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'regno='+$("#regno").val(),
type: "POST",
success:function(data){
$("#user-reg-availability").html(data);
$("#loaderIcon").hide();
},
error:function ()
{
event.preventDefault();
alert('error');
}
});
}
</script>

</html>

Dashboard.php

<?php
session_start();
include('includes/config.php');
include('includes/checklogin.php');
check_login();

?>
<!doctype html>
<html lang="en" class="no-js">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-
scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="theme-color" content="#3e454c">

<title>DashBoard</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-social.css">
<link rel="stylesheet" href="css/bootstrap-select.css">
<link rel="stylesheet" href="css/fileinput.min.css">
<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
<link rel="stylesheet" href="css/style.css">

</head>

<body>
<?php include("includes/header.php");?>

<div class="ts-main-content">
<?php include("includes/sidebar.php");?>
<div class="content-wrapper">
<div class="container-fluid">

<div class="row" >


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

<h2 class="page-title" style="margin-top:10%">Dashboard</h2>

<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<div class="panel panel-
default">
<div class="panel-body
bk-primary text-light">
<div class="stat-
panel text-center">

<div
class="stat-panel-number h1 ">My Profile</div>

</div>
</div>
<a href="my-
profile.php" class="block-anchor panel-footer">Full Detail <i class="fa fa-arrow-right"></i></a>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-
default">
<div class="panel-body
bk-success text-light">
<div class="stat-
panel text-center">

<div class="stat-
panel-number h1 ">My Room</div>

</div>
</div>
<a href="room-
details.php" class="block-anchor panel-footer text-center">See All &nbsp; <i class="fa fa-arrow-right"></i></a>
</div>
</div>

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

</div>
</div>

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

<!-- Loading Scripts -->


<script src="js/jquery.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/fileinput.js"></script>
<script src="js/chartData.js"></script>
<script src="js/main.js"></script>

<script>

window.onload = function(){

// Line chart from swirlData for dashReport


var ctx = document.getElementById("dashReport").getContext("2d");
window.myLine = new Chart(ctx).Line(swirlData, {
responsive: true,
scaleShowVerticalLines: false,
scaleBeginAtZero : true,
multiTooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
});

// Pie Chart from doughutData


var doctx = document.getElementById("chart-area3").getContext("2d");
window.myDoughnut = new Chart(doctx).Pie(doughnutData, {responsive : true});

// Dougnut Chart from doughnutData


var doctx = document.getElementById("chart-area4").getContext("2d");
window.myDoughnut = new Chart(doctx).Doughnut(doughnutData, {responsive : true});

}
</script>

</body>

</html>

Registration.php
<?php
session_start();
include('includes/config.php');
if(isset($_POST['submit']))
{
$regno=$_POST['regno'];
$fname=$_POST['fname'];
$mname=$_POST['mname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$contactno=$_POST['contact'];
$emailid=$_POST['email'];
$password=$_POST['password'];
$result ="SELECT count(*) FROM userRegistration WHERE email=? || regNo=?";
$stmt = $mysqli->prepare($result);
$stmt->bind_param('ss',$email,$regno);
$stmt->execute();
$stmt->bind_result($count);
$stmt->fetch();
$stmt->close();
if($count>0)
{
echo"<script>alert('Registration number or email id already registered.');</script>";
}else{

$query="insert into userRegistration(regNo,firstName,middleName,lastName,gender,contactNo,email,password)


values(?,?,?,?,?,?,?,?)";
$stmt = $mysqli->prepare($query);
$rc=$stmt->bind_param('sssssiss',$regno,$fname,$mname,$lname,$gender,$contactno,$emailid,$password);
$stmt->execute();
echo"<script>alert('Student Succssfully register');</script>";
}
}
?>

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-
scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="theme-color" content="#3e454c">
<title>User Registration</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">>
<link rel="stylesheet" href="css/bootstrap-social.css">
<link rel="stylesheet" href="css/bootstrap-select.css">
<link rel="stylesheet" href="css/fileinput.min.css">
<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
<script type="text/javascript" src="js/validation.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
function valid()
{
if(document.registration.password.value!= document.registration.cpassword.value)
{
alert("Password and Re-Type Password Field do not match !!");
document.registration.cpassword.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<?php include('includes/header.php');?>
<div class="ts-main-content">
<?php include('includes/sidebar.php');?>
<div class="content-wrapper">
<div class="container-fluid">

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

<h2 class="page-title">Student Registration </h2>

<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">Fill all
Info</div>
<div class="panel-body">
<form method="post" action="" name="registration" class="form-horizontal"
onSubmit="return valid();">

<div class="form-group">
<label class="col-sm-2 control-label"> Registration No : </label>
<div class="col-sm-8">
<input type="text" name="regno" id="regno" class="form-control" required="required"
onBlur="checkRegnoAvailability()">
<span id="user-reg-availability" style="font-size:12px;"></span>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">First Name : </label>
<div class="col-sm-8">
<input type="text" name="fname" id="fname" class="form-control" required="required" >
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Middle Name : </label>
<div class="col-sm-8">
<input type="text" name="mname" id="mname" class="form-control">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Last Name : </label>
<div class="col-sm-8">
<input type="text" name="lname" id="lname" class="form-control" required="required">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Gender : </label>
<div class="col-sm-8">
<select name="gender" class="form-control" required="required">
<option value="">Select Gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="others">Others</option>
</select>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Contact No : </label>
<div class="col-sm-8">
<input type="text" name="contact" id="contact" class="form-control" required="required">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Email id: </label>
<div class="col-sm-8">
<input type="email" name="email" id="email" class="form-control" onBlur="checkAvailability()"
required="required">
<span id="user-availability-status" style="font-size:12px;"></span>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Password: </label>
<div class="col-sm-8">
<input type="password" name="password" id="password" class="form-control" required="required">
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label">Confirm Password : </label>
<div class="col-sm-8">
<input type="password" name="cpassword" id="cpassword" class="form-control" required="required">
</div>
</div>

<div class="col-sm-6 col-sm-offset-4">


<button class="btn btn-default" type="reset">Reset</button>
<input type="submit" name="submit" Value="Register" class="btn btn-primary">
</div>
</form>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/fileinput.js"></script>
<script src="js/chartData.js"></script>
<script src="js/main.js"></script>
</body>
<script>
function checkAvailability() {

$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'emailid='+$("#email").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
$("#loaderIcon").hide();
},
error:function ()
{
event.preventDefault();
alert('error');
}
});
}
</script>
<script>
function checkRegnoAvailability() {

$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'regno='+$("#regno").val(),
type: "POST",
success:function(data){
$("#user-reg-availability").html(data);
$("#loaderIcon").hide();
},
error:function ()
{
event.preventDefault();
alert('error');
}
});
}
</script>

</html>

Dashboard.php

<?php
session_start();
include('includes/config.php');
include('includes/checklogin.php');
check_login();

?>
<!doctype html>
<html lang="en" class="no-js">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-
scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="theme-color" content="#3e454c">
<title>DashBoard</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-social.css">
<link rel="stylesheet" href="css/bootstrap-select.css">
<link rel="stylesheet" href="css/fileinput.min.css">
<link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
<link rel="stylesheet" href="css/style.css">

</head>

<body>
<?php include("includes/header.php");?>

<div class="ts-main-content">
<?php include("includes/sidebar.php");?>
<div class="content-wrapper">
<div class="container-fluid">

<div class="row" >


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

<h2 class="page-title" style="margin-top:10%">Dashboard</h2>

<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<div class="panel panel-
default">
<div class="panel-body
bk-primary text-light">
<div class="stat-
panel text-center">

<div
class="stat-panel-number h1 ">My Profile</div>

</div>
</div>
<a href="my-
profile.php" class="block-anchor panel-footer">Full Detail <i class="fa fa-arrow-right"></i></a>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-
default">
<div class="panel-body
bk-success text-light">
<div class="stat-
panel text-center">

<div class="stat-
panel-number h1 ">My Room</div>

</div>
</div>
<a href="room-
details.php" class="block-anchor panel-footer text-center">See All &nbsp; <i class="fa fa-arrow-right"></i></a>
</div>
</div>

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

</div>
</div>

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

<!-- Loading Scripts -->


<script src="js/jquery.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/fileinput.js"></script>
<script src="js/chartData.js"></script>
<script src="js/main.js"></script>

<script>

window.onload = function(){

// Line chart from swirlData for dashReport


var ctx = document.getElementById("dashReport").getContext("2d");
window.myLine = new Chart(ctx).Line(swirlData, {
responsive: true,
scaleShowVerticalLines: false,
scaleBeginAtZero : true,
multiTooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
});

// Pie Chart from doughutData


var doctx = document.getElementById("chart-area3").getContext("2d");
window.myDoughnut = new Chart(doctx).Pie(doughnutData, {responsive : true});

// Dougnut Chart from doughnutData


var doctx = document.getElementById("chart-area4").getContext("2d");
window.myDoughnut = new Chart(doctx).Doughnut(doughnutData, {responsive : true});

}
</script>

</body>

</html>
Test results and report:

Login
System Testing
The testing process focuses on the logical intervals of the software ensuring

that all statements have been tested and on functional interval is conducting

tests to uncover errors and ensure that defined input will produce actual

results that agree with the required results. Program level testing, modules

level testing integrated and carried out.

Testing Methods

There are two major type of testing they are

1) White Box Testing.

2) Black Box Testing.

White Box Testing


White box sometimes cal ed “Glass box testing” is a test case design uses the

control structure of the procedural design to drive test case.

Black box Testing

Black box testing focuses on the functional requirements of the software. This

is black box testing enables the software engineering to derive a set of input

conditions that will fully exercise all functional requirements for a program.

Black box testing is not an alternative to white box testing rather it is

complementary approach that is likely to uncover a different class of errors

that white box methods like..

 Interface errors

 Performance in data structure

 Performance errors
Unit testing

Unit testing is a software verification and validation method in which a

programmer tests if individual units of source code are fit for use.

A unit is the smallest testable part of an application. In procedural

programming a unit may be an individual function or procedure.

Ideally, each test case is independent from the others: substitutes like

method stubs, objects, fakes and test harnesses can be used to assist testing a

module in isolation.

Integration Testing:
This testing is sometimes called Integration and Testing. Integration testing is

the phase in software testing in which individual software modules are

combined and tested as a group. It occurs after unit testing and before system

testing. Integration testing takes as its input modules that have been unit

tested, groups them in larger aggregates, applies tests defined in an integration

test plan to those aggregates and delivers as its output the integrated system

ready for system testing.

Validation Testing:

Validation Testing can be defined in many ways, but a simple definition is

that validation succeeds when the software functions in a manner that can

reasonably expected by a customer. After validation test has been conducted,

one of the following two possible conditions exists. The functions or

performance characteristics confirm to specification and are accepted.


 In the administrator and login modules, all the fields must be filled.

 In the student registration, contact number should contain exactly 10 numbers.

User Acceptance Testing:

User acceptance of a system is a key factor of any system. The system under

consideration is tested for the acceptance by constantly keeping in touch with

the prospective system users at the same time of developing and marketing

changes whenever required. This is done in regard to the following points:

 Input Screen Design

 Output Screen Design

Test Cases

NO INPUT EXPECTE ACTUAL TEST ACTION

GIVEN D OUTPUT OUTPUT PASS TAKEN

OCCURED

1 Admin , pass Admin Home Admin Home Yes -

page page

3 Admin, Admin Invalid No The wrong


kumar
Home page password password

for user ***** is

Admin given for

user Admin.
4 SignUp,Sanjana Signup Page Please enter No The

a valid wrong

password. password

******* is

given for

user

sanjana.
Chapter: 5
5.1 Conclusion & Future Scope
Discussion & conclusion: In this application we can entry a new book
which has a specific id, price, pages, book name, publisher. We also add a
student’s information such as name, id, father’s name, batch, semester which is
help admin when a student issue a book & return a book. If admin wants to see
the details information of returning or issuing a book with date, he needs to click
just a button on our application.

5.2 Scope for further development: we have many scope for developing our
Application. We can make this application as Server based application. In our
application we don’t have student’s interaction to this application. We can
make this happen in future. We can make this application as an android
application which is very helpful to the user and the library authority.

References:

1. https://netbeans.org/downloads/
2. http://www.oracle.com/technetwork/java/javase/downloads/jdk 8-
downloads-2133151.html
3. http://www.jtattoo.net/Download.html
4. http://launch4j.sourceforge.net/
5. https://sourceforge.net/projects/finalangelsanddemons/files/rs2x
ml.jar/download
6. https://bitbucket.org/xerial/sqlite-jdbc/downloads/
7. http://www.java2s.com/Code/Jar/j/Downloadjcalendar14jar.htm
8. https://www.youtube.com/playlist?list=PLEAQNNR8IlB4R7NfqBY1
frapYo97L6fOQ

You might also like