0% found this document useful (0 votes)
363 views

"Library Management System": Bachelor of Computer Applications From C.C.S University, Meerut (2018-2021)

This document is a project report for a Library Management System submitted by Shubham Kumar Singh. It includes an introduction, system analysis, system design, system implementation, system testing, and conclusion. The project aims to develop a computerized system to manage all daily operations of a library more efficiently compared to a non-computerized system. It allows for online book issuing and returns, a digital library, student and teacher login accounts, and generates various reports.

Uploaded by

rahulprajap
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
363 views

"Library Management System": Bachelor of Computer Applications From C.C.S University, Meerut (2018-2021)

This document is a project report for a Library Management System submitted by Shubham Kumar Singh. It includes an introduction, system analysis, system design, system implementation, system testing, and conclusion. The project aims to develop a computerized system to manage all daily operations of a library more efficiently compared to a non-computerized system. It allows for online book issuing and returns, a digital library, student and teacher login accounts, and generates various reports.

Uploaded by

rahulprajap
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 74

A

PROJECT REPORT

ON

“LIBRARY MANAGEMENT SYSTEM”


Submitted in Partial fulfillment of the Requirements for the Award of the Degree of

BACHELOR OF COMPUTER APPLICATIONS


FROM
C.C.S UNIVERSITY, MEERUT
(2018-2021)

SUBMITTED TO: SUBMITTED BY:


JPIEAS SHUBHAM KUMAR SINGH (BCA-3RD YEAR)

ROLL NO.-180920106065

JP INSTITUTE OD EDUCATION & APPLIED SCIENCE


RAJPURA MAWANA ROAD, MEERUT (UP)
CERTIFICATE

Certified that SHUBHAM KUMAR SINGH (Roll No. 180920106065), have


carried out the Project work having “LIBRARY MANAGEMENT SYSTEM” for
Bachelor of Computer Applications from JP INSTITUTE OF EDUCATION &
APPLIED SCIENCE, Meerut under my supervision. The project report embodies
original work, and studies are carried out by the student himself/herself and the
contents of the project report do not form the basis for the award of any other
degree to the candidate or to anybody else from this or any other
University/Institution.

This is to certify that the above statement made by the candidate is correct to the
best of my Knowledge.

Date:

SHUBHAM KUMAR SINGH (Roll No. 180920106065)

Mr. Ashish Aggarwal


HOD (BCA DEPT.)
ACKNOWLEDGEMENT

It is my pleasure to acknowledge you that I have received a project on Library


Management System from my teacher.

My first sincere appreciation and gratitude goes to Mr. Ashish Aggarwal for his
guidance, constructive comments and valuable suggestions. During making of my
Project he helped me a lot.

All the work done in coming up with this system is dedicated to my brother for
being with/part of me in the whole process.

Finally, I wish to say thanks to all co-helper for helping me a lot.

Thank you,

SHUBHAM KUMAR SINGH


DECLARATION

I hereby declare that research report entitled “LIBRARY


MANAGEMENT SYSTEM” submitted for the partial fulfillment of the

requirements for the award of Bachelor of Computer Administration is


the outcome of original study undertaken by me and the has not
formed the basis for the award of any degree, diploma or any other
similar title.

Date: (Name & Sign. Of Student)

Place:
Contents

ABSTRACT 1

INTRODUCTION 2

1.1 PROJECT AIMS AND OBJECTIVES 2

1.2 BACKGROUND OF PROJECT..................................................................2

1.3 OPERATION ENVIRONMENT..................................................................3

2. SYSTEM ANALYSIS......................................................................................4

2.1 SOFTWARE REQUIREMENT SPECIFICATION..................................4

2.2 EXISTING VS PROPOSED.......................................................................10

2.3 SOFTWARE TOOL USED.........................................................................11

3. SYSTEM DESIGN.........................................................................................14

3.1 TABLE DESIGN.....................................................................................14

3.2 DATA FLOW DIAGRAM’S..................................................................19

4. SYSTEM IMPLEMENTATION.............................................................23

4.1 SCREENSHOTS..........................................................................................23

4.2 SOURCE CODE..........................................................................................29

5. SYSTEM TESTING………………………………………………………………………...…65

6. CONCLUSION & FUTURE SCOPE 67


6.1 REFERENCES.............................................................................................67

ABSTRACT

Library management system is a project which aims in developing a computerized


system to maintain all the daily work of library .This project has many features
which are generally not availiable in normal library management systems like
facility of user login and a facility of teachers login .It also has a facility of admin
login through which the admin can monitor the whole system .It also has facility
of an online notice board where teachers can student can put up information
about workshops or seminars being held in our colleges or nearby colleges and
librarian after proper verification from the concerned institution organizing the
seminar can add it to the notice board . It has also a facility where student after
logging in their accounts can see list of books issued and its issue date and return
date and also the students can request the librarian to add new books by filling
the book request form.The librarian after logging into his account ie admin
account can generate various reports such as student report , issue report,
teacher report and book report

Overall this project of ours is being developed to help the students as well as staff
of library to maintain the library in the best way possible and also reduce the
human efforts.

1
INTRODUCTION

This chapter gives an overview about the aim , objectives ,background and operation
environment of the system.

1.1 PROJECT AIMS AND OBJECTIVES

The project aims and objectives that will be achieved after completion of this project are
discussed in this subchapter. The aims and objectives are as follows:

 Online book issue


 Request column for librarian for providing new books
 A separate column for digital library
 Student login page where student can find books issued by him/her and date of
return.
 A search column to search availability of books
 A teacher login page where teacher can add any events being organized in the
college and important suggestions regarding books.
 Online notice board about the workshop.

1.2 BACKGROUND OF PROJECT

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.

2
In addition, report module is also included in Library Management System. If
user’s position is admin, the user is able to generate different kinds of reports like
lists of students registered, list of books, issue and return reports.
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.

1.3 OPERATIONAL ENVIRONMENT

PROCESSOR INTEL CORE PROCESSOR OR


BETTER PERFORMANCE

OPERATING SYSTEM WINDOWS VISTA ,WINDOWS7,


UBUNTU

MEMORY 1 GB RAM OR MORE

HARD DISK SPACE MINIMUM 3 GB FOR DATABASE


USAGE FOR FUTURE

DATABASE MY SQL

3
2. SYSTEM ANALYSIS
In this chapter, we will discuss and analyze about the developing process of
Library Management System including software requirement specification (SRS)
and comparison between existing and proposed system . The functional and non
functional requirements are included in SRS part to provide complete description
and overview of system requirement before the developing process is carried out.
Besides that, existing vs proposed provides a view of how the proposed system
will be more efficient than the existing one.

2.1 SOFTWARE REQUIREMENT SPECIFICATION

2.1.1 GENERAL DESCRIPTION

PRODUCT DESCRIPTION:

Library Management System is a computerized system which helps user(librarian)


to manage the library daily activity in electronic format. It reduces the risk of paper
work such as file lost, file damaged and time consuming.
It can help user to manage the transaction or record more effectively and time-
saving.

PROBLEM STATEMENT:

The problem occurred before having computerized system includes:


 File lost

When computerized system is not implemented file is always lost because of


human environment. Some times due to some human error there may be a loss of
records.
 File damaged When a computerized system is not there file is always lost due
to some accdent like spilling of water by some member on file accidentally.Besides
some natural disaster like floods or fires may also damage the files.

4
 Difficult to search record

When there is no computerized system there is always a difficulty in searching of


records if the records are large in number .
 Space consuming

After the number of records become large the space for physical storage of file and
records also increases if no computerized system is implemented.
 Cost consuming

As there is no computerized system the to add each record paper will be needed
which will increase the cost for the management of library.

2.1.2 SYSTEM OBJECTIVES


 Improvement in control and performance

The system is developed to cope up with the current issues and problems of
library .The system can add user, validate user and is also bug free.
 Save cost

After computerized system is implemented less human force will be required to


maintain the library thus reducing the overall cost.
 Save time

Librarian is able to search record by using few clicks of mouse and few search
keywords thus saving his valuable time.
 Option of online Notice board

Librarian will be able to provide a detailed description of workshops going in the


college as well as in nearby colleges
 Lecture Notes

Teacher have a facility to upload lectures notes in a pdf file having size not more
than 10mb

5
2.1.3 SYSTEM REQUIREMENTS

2.1.3.1 NON FUNCTIONAL REQUIREMENTS

 Product Requirements

EFFICIENCY REQUIREMENT

When a library management system will be implemented librarian and user will
easily acess library as searching and book transaction will be very faster .

RELIABILITY REQUIREMENT

The system should accurately performs member registration ,member validation ,


report generation, book transaction and search

USABILITY REQUIREMENT
The system is designed for a user friendly environment so that student and staff of
library can perform the various tasks easily and in an effective way.

ORGANIZATIONAL REQUIREMENT
IMPLEMENTATION REQUIREMNTS

In implementing whole system it uses html in front end with php as server side
scripting language which will be used for database connectivity and the backend ie
the database part is developed using mysql.

DELIVERY REQUIREMENTS

The whole system is expected to be delivered in six months of time with a weekly
evaluation by the project guide.

6
2.1.3.2 FUNCTIONAL REQUIREMENTS
1. NORMAL USER

1.1 USER LOGIN

Description of feature

This feature used by the user to login into system. They are required to enter user
id and password before they are allowed to enter the system .The user id and
password will be verified and if invalid id is there user is allowed to not enter the
system.

Functional requirements

-user id is provided when they register


-The system must only allow user with valid id and password to enter the system
-The system performs authorization process which decides what user level can
acess to.
-The user must be able to logout after they finished using system.

1.2 REGISTER NEW USER

Description of feature
This feature can be performed by all users to register new user to create account.
Functional requirements
-System must be able to verify information
-System must be able to delete information if information is wrong

1.3 REGISTER NEW BOOK

Description of feature
This feature allows to add new books to the library
Functional requirements
-System must be able to verify information
-System must be able to enter number of copies into table.
- System must be able to not allow two books having same book id.

7
1.5 SEARCH BOOK

DESCRIPTION OF FEATURE
This feature is found in book maintenance part . we can search book based on book
id , book name , publication or by author name.
Functional requirements
- System must be able to search the database based on select search type
- System must be able to filter book based on keyword enterd
- System must be able to show the filtered book in table view

1.5 ISSUE BOOKS AND RETURN BOOKS

DESCRIPTION OF FEATURE
This feature allows to issue and return books and also view reports of book issued.
Functional requirements
-System must be able to enter issue information in database.
-System must be able to update number of books.
- System must be able to search if book is available or not before issuing books
-System should be able to enter issue and return date information

1.6 EVENT ADDITION

DESCRIPTION OF FEATURE
This feature allows teacher and student to add information about various
workshops being conducted in college and colleges nearby.

8
Functional requirements
-System should be able to add detailed information about events .
-System should be able to display information on notice board available in the
homepage of site

2.1.4 SOFTWARE AND HARDWARE REQUIREMENTS

This section describes the software and hardware requirements of the system

2.1.4.1 SOFTWARE REQUIREMENTS

 Operating system- Windows 7 is used as the operating system as it is stable


and supports more features and is more user friendly

 Database MYSQL-MYSQL is used as database as it easy to maintain and


retrieve records by simple queries which are in English language which are easy to
understand and easy to write.

 Development tools and Programming language- HTML is used to write the


whole code and develop webpages with css, java script for styling work and php
for sever side scripting.

2.1.4.2 HARDWARE REQUIREMENTS

Intel core i5 2nd generation is used as a processor because it is fast than other
processors an provide reliable and stable and we can run our pc for longtime. By
using this processor we can keep on developing our project without any worries.
Ram 1 gb is used as it will provide fast reading and writing capabilities and
will in turn support in processing.

9
2.2 EXISTING VS PROPOSED SYSTEM

i. Existing system does not have any facility of teachers login or student
login where as proposed system will have a facility of student login as
well as teacher’s login

ii. Existing system does not have a facility of online reservation of books
whereas proposed system has a facility of online reservation of books.

iii. Existing system does not have any facility of online notice board where
description of workshops happening in our college as well as nearby
colleges is being provided.

iv. Existing system does not has any option of lectures notes uploaded by
teachers whereas proposed system will have this facility.

v. Existing system does not have any facility to generate student reports as
well book issue reports whereas proposed system provides librarian with
a tool to generate reports.

vi. Existing system does not has any facility for book request and
sugeestions where as in proposed system after logging in to their
accounts student can request books as well as provide suggestions to
improve library.

10
2.3 SOFTWARE TOOLS USED

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

2.3.1 Front end

The front end is designed using of html , Php ,css, Java script
 HTML - HTML or Hyper Text Markup Language is the main markup
language for creating web pages and other information that can be
displayed in a web browser.HTML is written in the form of HTML elements
consisting of tags enclosed in angle brackets (like <html>), within the web
page content. HTML tags most commonly come in pairs like <h1> and
</h1>, although some tags represent empty elements and so are
unpaired, for example <img>. The first tag in a pair is the start tag, and the
second tag is the end tag (they are also called opening tags and closing
tags). In between these tags web designers can add text, further tags,
comments and other types of text-based content. The purpose of a web
browser is to read HTML documents and compose them into visible or
audible web pages. The browser does not display the HTML tags, but uses
the tags to interpret the content of the page.HTML elements form the
building blocks of all websites. HTML allows images and objects to be
embedded and can be used to create interactive forms. It provides a
means to create structured documents by denoting structural semantics for
text such as headings, paragraphs, lists, links, quotes and other items. It
can embed scripts written in languages such as JavaScript which affect the
behavior of HTML web pages.

 CSS- Cascading Style Sheets (CSS) is a style sheet language used for
describing the look and formatting of a document written in a markup
language. While most often used to style web pages and interfaces written
in HTML and XHTML, the language can be applied to any kind of XML
document, including plain XML, SVG and XUL. CSS is a cornerstone
specification of the web and almost all web pages use CSS style sheets to
describe their presentation.CSS is designed primarily to enable the
separation of document content from document presentation, including
elements such as the layout, colors, and fonts. This separation can improve
content accessibility, provide more flexibility and control in the specification
of presentation characteristics, enable multiple pages to share formatting,
and reduce complexity and repetition in the structural content (such as by
allowing for table less web design).CSS can also allow the same markup
page to be presented in different styles for different rendering methods,
such as on-screen, in print, by voice (when read out by a speech-based
browser or screen reader) and on Braille-based, tactile devices. It can also
be used to allow the web page to display differently depending on the
screen size or device on which it is being viewed. While the author of a
document typically links that document to a CSS file, readers can use a
different style sheet, perhaps one on their own computer, to override the
one the author has specified. However if the author or the reader did not
link the document to a specific style sheet the default style of the browser
will be applied.CSS specifies a priority scheme to determine which style
rules apply if more than one rule matches against a particular element. In
this so-called cascade, priorities or weights are calculated and assigned to
rules, so that the results are predictable.

 JAVA SCRIPT- JavaScript (JS) is a dynamic computer programming


language. It is most commonly used as part of web browsers, whose
implementations allow client-side scripts to interact with the user, control
the browser, communicate asynchronously, and alter the document content
that is displayed. It is also being used in server-side programming, game
development and the creation of desktop and mobile applications.
JavaScript is a prototype-based scripting language with dynamic typing and
has first-class functions. Its syntax was influenced by C. JavaScript copies
many names and naming conventions from Java, but the two languages
are otherwise unrelated and have very different semantics. The key design
principles within JavaScript are taken from the Self and Scheme
programming languages. It is a multi-paradigm language, supporting
object-oriented, imperative, and functional programming styles. The
application of JavaScript to use outside of web pages—for example, in PDF
documents, site-specific browsers, and desktop widgets—is also
significant. Newer and faster JavaScript VMs and platforms built upon them
(notably Node.js) have also increased the popularity of JavaScript for
server-side web applications. On the client side, JavaScript was
traditionally implemented as an interpreted language but just-in-time
compilation is now performed by recent (post-2012) browsers.

12
 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.PHP code 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 interface 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
standalone shell on almost every operating system and platform, free of
charge.

2.3.2 BACK END- The back end is designed using mysql which is used to
design the databases

MYSQL- MySQL ("My S-Q-L", officially, but also called "My Sequel")
is (as of July 2013) the world's second most widely used open-source
relational database management system (RDBMS). It is named after co-
founder Michael Widenius daughter, My. The SQL phrase stands for
Structured Query Language. The MySQL development project has made
its source code available under the terms of the GNU General Public
License, as well as under a variety of proprietary agreements. MySQL was
owned and sponsored by a single for-profit firm, the Swedish company
MySQL AB, now owned by Oracle Corporation .MySQL is a popular choice
of database for use in web applications, and is a central component of the
widely used LAMP open source web application software stack (and other
'AMP' stacks). LAMP is an acronym for "Linux, Apache, MySQL,
Perl/PHP/Python." Free-software-open source projects that require a full-
featured database management system often use MySQL. For commercial
use, several paid editions are available, and offer additional functionality.
Applications which use MySQL databases include: TYPO3, MODx, Joomla,
WordPress, phpBB, MyBB, Drupal and other software. MySQL is also used
in many high-profile, large-scale websites, including Wikipedia, Google
(though not for searches), Facebook, Twitter, Flickr, and YouTube
SYSTEM DESIGN

3.1 TABLE DESIGN

VARIOUS TABELS TO MAINTAIN INFORMATION

BOOKS TABLE
FIELD DATATYPE DEFAULT KEY EXTRA
ID Int(10) NONE PRIMARY Auto_Increment
ISBN_NO Varchar(100) NO
BOOK_TITLE Varchar(200) NO
BOOK_TYPE Int(10) NO
AUTHOR_NAME Varchar(100) NO
QUANTITY Int(11) NO
PURCHASE_DA Date NO
TE
EDITION Varchar(40) NO
PRICE Decimal(10.2) 0.00
PAGES Int(11) NO
PUBLISHER Varchar(140) NO

14
BOOK ISSUE

FIELD DATATYPE DEFAULT KEY EXTRA


ID Int(10) NONE PRIMARY Auto_Increment
MEMBER Int(10) NULL
NUMBER Int(10) NULL
BOOK_NO Int(10) NULL
BOOK_TITLE Int(10) NULL
ISSUE_DATE Date NULL
RETURN_DA Date NULL
TE
STATUS Varchar(40) NULL
ISSUE_ID Varchar(40) NULL

MAGAZINES
FIELD DATATYPE DEFAULT KEY EXTRA
ID Int(10) NONE PRIMARY Auto_Increment
TYPE Varchar(40) NULL
NAME Varchar(100) NULL
DATE_OF_RECEI Date NULL
PT
DATE_PUBLISHE Date NULL
D
PAGES Int(11) NULL
PRICE Decimal(10.2) 0.00
PUBLISHER Varchar(140) NULL
MEMBERSHIP GROUPPERMISSION
FIELD DATATYPE DEFAULT KEY EXTRA
PERMISSION_I Int(10) NONE PRIMARY Auto_Increment
D
GROUP_ID Int(11) NULL
TABLE_NAME Varchar(100) NULL
ALLOWINSERT Tinyint(4) NULL
ALLOWVIEW Tinyint(4) 0
ALLOWEDIT Tinyint(4) 0
ALLOWDELETE Tinyint(4) 0

MEMBERSHIP GROUPS
FIELD DATATYPE DEFAULT KEY EXTRA
GROUP_ID Int(10) NONE PRIMARY Auto_Increment
NAME Varchar(20) NULL
DESCRIPTION Text NULL
ALLOWSIGNUP Tinyint(4) NULL
NEEDSAPPROV Tinyint(4) NULL
AL

TYPES
FIELD DATATYPE DEFAULT KEY EXTRA
ID Int(10) NONE PRIMARY Auto_Increment
NAME Varchar(40) NULL
16
MEMBERSHIP_USERRECORDS
FIELD DATATYPE DEFAULT KEY EXTRA
RECID Bigint(20) NONE PRIMARY Auto_Increment
TABLENAME Varchar(100) NULL
PKVALUE Varchar(255) NULL
MEMBERID Varchar(20) NULL
DATEADDED Bigint(20) NULL
DATEUPDATED Bigint(20) NULL
GROUPID Int(11) NULL

MEMBERSHIP_USERPERMISSION
FIELD DATATYPE DEFAULT KEY EXTRA
PERMISSIONID Int(10) NONE PRIMARY Auto_Increment
MEMBERID Varchar(20) NONE
TABLENAME Varchar(100) NULL
ALLOWINSERT Tinyint(4) NULL
ALLOEVIEW Tinyint(4) 0
ALLOWEDIT Tinyint(4) 0
ALLOWDELETE Tinyint(4) 0

NEWSPAPERS
FIELD DATATYPE DEFAULT KEY EXTRA
ID Int(10) NONE PRIMARY Auto_Increment
LANGUAGE Varchar(100) NULL
NAME Varchar(100) NULL
DATE_OF_RECEI Date NULL
PT
DATE_PUBLISHE Date NULL
D
PAGES Int(11) NULL
PRICE Decimal(10.2) 0
TYPE Varchar(40) NULL
PUBLISHER Varchar(100) NULL
17

RETURN_BOOK
FIELD DATATYPE DEFAULT KEY EXTRA
ID Int(10) NULL PRIMARY Auto_Increment
BOOK_NO Int(10) NULL
BOOK_TITLE Int(10) NULL
ISSUE_DATE Date NULL
DUE_DATE Int(10) 1
RETURN_DAT Date NULL
E
MEMBER Int(10) NULL
NUMBER Int(10) NULL
FINE Decimal(10.2) 0.00
STATUS Varchar(40) NULL

MEMBERSHIP_USERS
FIELD DATATYPE DEFAULT KEY EXTRA
MEMBERID Varchar(20) NONE
PASSMD5 Varchar(40) NULL
EMAIL Varchar(100) NULL
SIGNUP Date NULL
GROUPID Int(10) NULL
ISBANNED Tinyint(4) NULL
ISAPPROVED Tinyint(4) NULL
CUSTOM1 Text NULL
CUSTOM2 Text NULL
CUSTOM3 Text NULL
CUSTOM4 Text NULL
COMMENTS Text NULL
PASS_RESET_KEY Text NULL
PASS_RESET_EXPI Int(10) NULL
RY
18
3.2 DATA FLOW DIAGRAMS

19
SYSTEM IMPLEMENTATION

1. Screenshots

Screenshot of Admin Dashboard

23
Screenshot of SignUp/Login Page

Screenshot of ‘Books’ Page


Screenshot of ‘Magazines’ Page

Screenshot of ‘Newspaper’ Page


Screenshot of ‘Members/Users’ Page

Screenshot of ‘Books Issue’ Page


Screenshot of ‘Returned Books’ Page
SOURCE CODE

Home.php
<?php if(!isset($Translation)){ @header('Location: index.php'); exit; } ?>

<?php include_once("{$currDir}/header.php"); ?>

<?php @include("{$currDir}/hooks/links-home.php"); ?>

<?php

/*

Classes of first and other blocks

---------------------------------

For possible classes, refer to the Bootstrap grid columns, panels and buttons
documentation:

Grid columns: http://getbootstrap.com/css/#grid

Panels: http://getbootstrap.com/components/#panels

Buttons: http://getbootstrap.com/css/#buttons

*/

$block_classes = array(

'first' => array(

'grid_column' => 'col-sm-12 col-md-8 col-lg-6',

'panel' => 'panel-warning',

'link' => 'btn-warning'),

'other' => array(

'grid_column' => 'col-sm-6 col-md-4 col-lg-3',

'panel' => 'panel-info',


'link' => 'btn-info')

); ?>

<style>

.panel-body-description{

margin-top: 10px;

height: 100px;

overflow: auto;

.panel-body .btn img{

margin: 0 10px;

max-height: 32px;

</style>

<?php

/* accessible tables */

$arrTables = get_tables_info();

if(is_array($arrTables) && count($arrTables)){

/* how many table groups do we have? */

$groups = get_table_groups();

$multiple_groups = (count($groups) > 1 ? true : false);

/* construct $tg: table list grouped by table group */

$tg = array();

if(count($groups)){

foreach($groups as $grp => $tables){


foreach($tables as $tn){

$tg[$tn] = $grp;

}}

$i = 0; $current_group = '';

foreach($tg as $tn => $tgroup){

$tc = $arrTables[$tn];

/* is the current table filter-first? */

$tChkFF = array_search($tn, array());

/* hide current table in homepage? */

$tChkHL = array_search($tn,
array('books','NewsPapers','Magazines','Users','Book_Issue','Return_Book','Types'));

/* allow homepage 'add new' for current table? */

$tChkAHAN = array_search($tn, array());

/* homepageShowCount for current table? */

$count_badge = '';

if($tc['homepageShowCount']){

$sql_from = get_sql_from($tn);

$count_records = ($sql_from ? sqlValue("select count(1) from " .


$sql_from) : 0);

$count_badge = '<span class="badge hspacer-lg text-bold">' .


number_format($count_records) . '</span>';

$t_perm = getTablePermissions($tn);

$can_insert = $t_perm['insert'];
$searchFirst = (($tChkFF !== false && $tChkFF !== null) ? '?Filter_x=1' : '');

?>

<?php if(!$i && !$multiple_groups){ /* no grouping, begin row


*/ ?>

<div class="row table_links">

<?php } ?>

<?php if($multiple_groups && $current_group != $tgroup){ /*


grouping, begin group & row */ ?>

<?php if($current_group != ''){ /* not first group, so we


should first end previous group */ ?>

</div><!-- /.table_links -->

<div class="row custom_links">

<?php

/* custom home links for


current group, as defined in "hooks/links-home.php" */

echo
get_home_links($homeLinks, $block_classes['other'], $current_group);

?>

</div>

</div><!-- /.collapse -->

<?php } ?>

<?php $current_group = $tgroup; ?>


<a class="btn btn-primary btn-block btn-lg collapser
vspacer-lg" data-toggle="collapse" href="#group-<?php echo md5($tgroup); ?>"><?php echo
$tgroup; ?> <i class="glyphicon glyphicon-chevron-right"></i></a>

<div class="collapse" id="group-<?php echo md5($tgroup);


?>">

<div class="row table_links">

<?php } ?>

<?php if($tChkHL === false || $tChkHL === null){ /* if table


is not set as hidden in homepage */ ?>

<div id="<?php echo $tn; ?>-tile" class="<?php


echo (!$i ? $block_classes['first']['grid_column'] : $block_classes['other']['grid_column']); ?>">

<div class="panel <?php echo (!$i ?


$block_classes['first']['panel'] : $block_classes['other']['panel']); ?>">

<div class="panel-body">

<?php if($can_insert &&


$tChkAHAN !== false && $tChkAHAN !== null){ ?>

<div class="btn-
group" style="width: 100%;">

<a style="width:
85%;" class="btn btn-lg <?php echo (!$i ? $block_classes['first']['link'] : $block_classes['other']
['link']); ?>" title="<?php echo preg_replace("/&amp;(#[0-9]+|[a-z]+);/i", "&$1;",
html_attr(strip_tags($tc['Description']))); ?>" href="<?php echo $tn; ?>_view.php<?php echo
$searchFirst; ?>"><?php echo ($tc['tableIcon'] ? '<img src="' . $tc['tableIcon'] . '">' : '');?
><strong><?php echo $tc['Caption']; ?></strong><?php echo $count_badge; ?></a>

<a id="<?php echo


$tn; ?>_add_new" style="width: 15%;" class="btn btn-add-new btn-lg <?php echo (!$i ?
$block_classes['first']['link'] : $block_classes['other']['link']); ?>" title="<?php echo
html_attr($Translation['Add New']); ?>" href="<?php echo $tn; ?>_view.php?addNew_x=1"><i
style="vertical-align: bottom;" class="glyphicon glyphicon-plus"></i></a>

</div>

<?php }else{ ?>

<a class="btn btn-


block btn-lg <?php echo (!$i ? $block_classes['first']['link'] : $block_classes['other']['link']); ?>"
title="<?php echo preg_replace("/&amp;(#[0-9]+|[a-z]+);/i", "&$1;",
html_attr(strip_tags($tc['Description']))); ?>" href="<?php echo $tn; ?>_view.php<?php echo
$searchFirst; ?>"><?php echo ($tc['tableIcon'] ? '<img src="' . $tc['tableIcon'] . '">' : '');?
><strong><?php echo $tc['Caption']; ?></strong><?php echo $count_badge; ?></a>

<?php } ?>

<div class="panel-body-
description"><?php echo $tc['Description']; ?></div>

</div>

</div>

</div>

<?php } ?>

<?php if($i == (count($arrTables) - 1) && !$multiple_groups){ /*


no grouping, end row */ ?>

</div> <!-- /.table_links -->

<div class="row custom_links" id="custom_links">

<?php
/* custom home links, as defined in
"hooks/links-home.php" */

echo get_home_links($homeLinks,
$block_classes['other'], '*');

?>

</div>

<?php } ?>

<?php if($i == (count($arrTables) - 1) && $multiple_groups){ /*


grouping, end last group & row */ ?>

</div> <!-- /.table_links -->

<div class="row custom_links"


id="custom_links">

<?php

/* custom home links for last


table group, as defined in "hooks/links-home.php" */

echo
get_home_links($homeLinks, $block_classes['other'], $tgroup);

/* custom home links having


no table groups, as defined in "hooks/links-home.php" */

echo
get_home_links($homeLinks, $block_classes['other']);

?>

</div>

</div><!-- /.collapse -->


<?php } ?>

<?php

$i++;

}else{

?><script>window.location='index.php?signIn=1';</script><?php

?>

<script>

$j(function(){

var table_descriptions_exist = false;

$j('div[id$="-tile"] .panel-body-description').each(function(){

if($j.trim($j(this).html()).length) table_descriptions_exist = true;

});

if(!table_descriptions_exist){

$j('div[id$="-tile"] .panel-body-description').css({height: 'auto'});

$j('.panel-body .btn').height(32);

$j('.btn-add-new').click(function(){

var tn = $j(this).attr('id').replace(/_add_new$/, '');


modal_window({

url: tn + '_view.php?addNew_x=1&Embedded=1',

size: 'full',

title: $j(this).prev().text() + ": <?php echo


html_attr($Translation['Add New']); ?>"

});

return false;

});

/* adjust arrow directions on opening/closing groups, and initially open first


group */

$j('.collapser').click(function(){

$j(this).children('.glyphicon').toggleClass('glyphicon-chevron-right
glyphicon-chevron-down');

});

/* hide empty table groups */

$j('.collapser').each(function(){

var target = $j(this).attr('href');

if(!$j(target + " .row div").length) $j(this).hide();

});

$j('.collapser:visible').eq(0).click();

});

</script>

<?php include_once("$currDir/footer.php"); ?>


Login.php
<?php if(!isset($Translation)){ @header('Location: index.php?signIn=1'); exit; } ?>

<?php include_once("$currDir/header-start.php"); ?>

<?php if($_GET['loginFailed']){ ?>

<div class="alert alert-danger"><?php echo $Translation['login failed']; ?></div>

<?php } ?>

<div class="row">

<div class="col-sm-6 col-lg-8" id="login_splash">

<!-- customized splash content here -->

</div>

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

<div class="panel panel-success">

<div class="panel-heading">

<h1 class="panel-title"><strong><?php echo $Translation['sign in here'];


?></strong></h1>

<?php if(sqlValue("select count(1) from membership_groups where


allowSignup=1")){ ?>

<a class="btn btn-success pull-right"


href="membership_signup.php"><?php echo $Translation['sign up']; ?></a>

<?php } ?>

<div class="clearfix"></div>

</div>

<div class="panel-body">

<form method="post" action="index.php">

<div class="form-group">

<label class="control-label" for="username"><?php


echo $Translation['username']; ?></label>
<input class="form-control" name="username" id="username" type="text" placeholder="<?php echo
$Translation['username']; ?>" required>

</div>

<div class="form-group">

<label class="control-label" for="password"><?php


echo $Translation['password']; ?></label>

<input class="form-control" name="password"


id="password" type="password" placeholder="<?php echo $Translation['password']; ?>" required>

<span class="help-block"><?php echo


$Translation['forgot password']; ?></span>

</div>

<div class="checkbox">

<label class="control-label" for="rememberMe">

<input type="checkbox" name="rememberMe"


id="rememberMe" value="1">

<?php echo $Translation['remember me']; ?>

</label>

</div>

<div class="row">

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

<button name="signIn" type="submit"


id="submit" value="signIn" class="btn btn-primary btn-lg btn-block"><?php echo $Translation['sign
in']; ?></button>

</div>

</div> </form>

</div>

<?php if(is_array(getTableList()) && count(getTableList())){ /* if anon. users can see any tables ... */ ?>
<div class="panel-footer">

<?php echo $Translation['browse as guest']; ?>

</div>

<?php } ?>

</div></div>

</div>

<script>document.getElementById('username').focus();</script>

Main.php
<?php if(!isset($Translation)){ @header('Location:index.php'); exit; } ?>

<?php include_once("{$currDir}/header.php"); ?>

<?php @include("{$currDir}/hooks/links-home.php"); ?>

<!DOCTYPE html>

<html>

<head>

<title>Dashboard</title>

<link id="browser_favicon" rel="shortcut icon" href="<?php echo PREPEND_PATH; ?


>resources/images/appgini-icon.png">

<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/initializr/css/bootstrap.css">

<!--[if gt IE 8]><!-->

<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/initializr/css/bootstrap-


theme.css">

<!--<![endif]-->

<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/lightbox/css/lightbox.css"


media="screen">
<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/select2/select2.css"
media="screen">

<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/timepicker/bootstrap-


timepicker.min.css" media="screen">

<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/datepicker/css/datepicker.css"


media="screen">

<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>dynamic.css.php">

<!--[if lt IE 9]>

<script src="<?php echo PREPEND_PATH; ?>resources/initializr/js/vendor/modernizr-2.6.2-respond-


1.1.0.min.js"></script>

<![endif]-->

<script src="<?php echo PREPEND_PATH; ?>resources/jquery/js/jquery-1.12.4.min.js"></script>

<script>var $j = jQuery.noConflict();</script>

<script src="<?php echo PREPEND_PATH; ?>resources/jquery/js/jquery.mark.min.js"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/initializr/js/vendor/bootstrap.min.js"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/lightbox/js/prototype.js"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/lightbox/js/scriptaculous.js?


load=effects"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/select2/select2.min.js"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/timepicker/bootstrap-


timepicker.min.js"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/jscookie/js.cookie.js"></script>

<script src="<?php echo PREPEND_PATH; ?>resources/datepicker/js/datepicker.packed.js"></script>

<script src="<?php echo PREPEND_PATH; ?>common.js.php"></script>

<?php if(isset($x->TableName) && is_file(dirname(__FILE__) . "/hooks/{$x->TableName}-tv.js")){ ?>

<script src="<?php echo PREPEND_PATH; ?>hooks/<?php echo $x->TableName; ?>-tv.js"></script>

<?php } ?>

</head>
<!--widgets here-->

<div class="row">

<div class="col-lg-3 col-xs-6">

<!-- small box -->

<div class="small-box bg-aqua">

<div class="inner">

<h3><?php include_once('books_count.php');?></h3>

<p>Books</p>

</div>

<div class="icon">

<i class="fa fa-book"></i>

</div>

<a href="books_view.php" class="small-box-footer">More info <i class="fa fa-arrow-circle-


right"></i></a>

</div>

</div>

<!-- ./col -->

<div class="col-lg-3 col-xs-6">

<!-- small box -->

<div class="small-box bg-green">

<div class="inner">

<h3><?php include_once('members_count.php');?></h3>

<p>Members</p>

</div>

<div class="icon">

<i class="fa fa-group"></i>


</div>

<a href="Users_view.php" class="small-box-footer">More info <i class="fa fa-arrow-circle-


right"></i></a>

</div>

</div>

<!-- ./col -->

<div class="col-lg-3 col-xs-6">

<!-- small box -->

<div class="small-box bg-yellow">

<div class="inner">

<h3><?php include_once('newspapers_count.php');?></h3>

<p>NewsPapers</p>

</div>

<div class="icon">

<i class="fa fa-newspaper-o"></i>

</div>

<a href="NewsPapers_view.php" class="small-box-footer">More info <i class="fa fa-arrow-circle-


right"></i></a>

</div>

</div>

<!-- ./col -->

<div class="col-lg-3 col-xs-6">

<!-- small box -->

<div class="small-box bg-red">

<div class="inner">

<h3><?php include_once('magazines_count.php');?></h3>
<p>Magazines</p>

</div>

<div class="icon">

<i class="fa fa-file-word-o"></i>

</div>

<a href="Magazines_view.php" class="small-box-footer">More info <i class="fa fa-arrow-circle-


right"></i></a>

</div>

</div>

<!-- ./col -->

</div><!--/first set-->

<!--second set-->

<div class="row">

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

<div class="info-box">

<span class="info-box-icon bg-aqua"><i class="fa fa-space-shuttle"></i></span>

<div class="info-box-content">

<span class="info-box-text">Issued</span>

<span class="info-box-number"><?php include_once('issue_count.php');?></span>

</div>

<!-- /.info-box-content -->

</div>

<!-- /.info-box -->

</div>

<!-- /.col -->

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


<div class="info-box">

<span class="info-box-icon bg-red"><i class="fa fa-thumbs-up"></i></span>

<div class="info-box-content">

<span class="info-box-text">Returned</span>

<span class="info-box-number"><?php include_once('returned_count.php');?></span>

</div>

<!-- /.info-box-content -->

</div>

<!-- /.info-box -->

</div>

<!-- /.col -->

<!-- fix for small devices only -->

<div class="clearfix visible-sm-block"></div>

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

<div class="info-box">

<span class="info-box-icon bg-green"><i class="fa fa-thumbs-down"></i></span>

<div class="info-box-content">

<span class="info-box-text">Not Returned</span>

<span class="info-box-number"><?php include_once('not_returned.php');?></span>

</div>

<!-- /.info-box-content -->

</div>

<!-- /.info-box -->

</div>

<!-- /.col -->


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

<div class="info-box">

<span class="info-box-icon bg-yellow"><i class="fa fa-calendar-check-o"></i></span>

<div class="info-box-content">

<span class="info-box-text">Date Today</span>

<span class="info-box-number"><?php $today= date("m/d/Y"); echo $today; ?></span>

</div>

<!-- /.info-box-content -->

</div>

<!-- /.info-box -->

</div>

<!-- /.col -->

</div><!--/second set-->

<!--widgets end here-->

<?php include_once('home.php'); ?>

</div>

</div>

</body>

</html>
Membership_Signup.php
<?php

$app_name = 'SAIDE';

$currDir = dirname(__FILE__);

include("{$currDir}/defaultLang.php");

include("{$currDir}/language.php");

include("{$currDir}/lib.php");

include_once("{$currDir}/header.php");

$adminConfig = config('adminConfig');

if(!$cg = sqlValue("select count(1) from membership_groups where allowSignup=1")){

$noSignup = true;

echo error_message($Translation['sign up disabled']);

exit;

if($_POST['signUp'] != ''){

// receive data

$memberID = is_allowed_username($_POST['newUsername']);

$email = isEmail($_POST['email']);

$password = $_POST['password'];

$confirmPassword = $_POST['confirmPassword'];

$groupID = intval($_POST['groupID']);

$custom1 = makeSafe($_POST['custom1']);

$custom2 = makeSafe($_POST['custom2']);

$custom3 = makeSafe($_POST['custom3']);

$custom4 = makeSafe($_POST['custom4']);
// validate data

if(!$memberID){

echo error_message($Translation['username invalid']);

exit;

if(strlen($password) < 4 || trim($password) != $password){

echo error_message($Translation['password invalid']);

exit;

if($password != $confirmPassword){

echo error_message($Translation['password no match']);

exit;

if(!$email){

echo error_message($Translation['email invalid']);

exit;

if(!sqlValue("select count(1) from membership_groups where groupID='$groupID' and


allowSignup=1")){

echo error_message($Translation['group invalid']);

exit;

// save member data

$needsApproval = sqlValue("select needsApproval from membership_groups where


groupID='$groupID'");
sql("INSERT INTO `membership_users` set memberID='$memberID',
passMD5='".md5($password)."', email='$email', signupDate='".@date('Y-m-d')."', groupID='$groupID',
isBanned='0', isApproved='".($needsApproval==1 ? '0' : '1')."', custom1='$custom1',
custom2='$custom2', custom3='$custom3', custom4='$custom4', comments='member signed up
through the registration form.'", $eo);

// admin mail notification

/* ---- application name as provided in AppGini is used here ---- */

$message = nl2br(

"A new member has signed up for {$app_name}.\n\n" .

"Member name: {$memberID}\n" .

"Member group: " . sqlValue("select name from membership_groups where


groupID='{$groupID}'") . "\n" .

"Member email: {$email}\n" .

"IP address: {$_SERVER['REMOTE_ADDR']}\n" .

"Custom fields:\n" .

($adminConfig['custom1'] ? "{$adminConfig['custom1']}: {$custom1}\n" : '') .

($adminConfig['custom2'] ? "{$adminConfig['custom2']}: {$custom2}\n" : '') .

($adminConfig['custom3'] ? "{$adminConfig['custom3']}: {$custom3}\n" : '') .

($adminConfig['custom4'] ? "{$adminConfig['custom4']}: {$custom4}\n" : '')

);

if($adminConfig['notifyAdminNewMembers'] == 2 && !$needsApproval){

sendmail(array(

'to' => $adminConfig['senderEmail'],

'subject' => "[{$app_name}] New member signup",

'message' => $message

));

}elseif($adminConfig['notifyAdminNewMembers'] >= 1 && $needsApproval){


sendmail(array(

'to' => $adminConfig['senderEmail'],

'subject' => "[{$app_name}] New member awaiting approval",

'message' => $message

));

// hook: member_activity

if(function_exists('member_activity')){

$args = array();

member_activity(getMemberInfo($memberID), ($needsApproval ? 'pending' :


'automatic'), $args);

// redirect to thanks page

$redirect = ($needsApproval ? '' : '?redir=1');

redirect("membership_thankyou.php$redirect");

exit;

// drop-down of groups allowing self-signup

$groupsDropDown = preg_replace('/<option.*?value="".*?><\/option>/i', '',


htmlSQLSelect('groupID', "select groupID, concat(name, if(needsApproval=1, ' *', ' ')) from
membership_groups where allowSignup=1 order by name", ($cg == 1 ? sqlValue("select groupID from
membership_groups where allowSignup=1 order by name limit 1") : 0 )));

$groupsDropDown = str_replace('<select ', '<select class="form-control" ', $groupsDropDown);

?>

<?php if(!$noSignup){ ?>

<div class="row">

<div class="hidden-xs col-sm-4 col-md-6 col-lg-8" id="signup_splash">


<!-- customized splash content here -->

</div>

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

<div class="panel panel-success">

<div class="panel-heading">

<h1 class="panel-title"><strong><?php echo $Translation['sign


up here']; ?></strong></h1>

</div>

<div class="panel-body">

<form method="post" action="membership_signup.php">

<div class="form-group">

<label for="username" class="control-label"><?


php echo $Translation['username']; ?></label>

<input class="form-control input-lg" type="text"


required="" placeholder="<?php echo $Translation['username']; ?>" id="username"
name="newUsername">

<span id="usernameAvailable" class="help-


block hidden pull-left"><i class="glyphicon glyphicon-ok"></i> <?php echo str_ireplace(array("'", '"',
'<memberid>'), '', $Translation['user available']); ?></span>

<span id="usernameNotAvailable" class="help-


block hidden pull-left"><i class="glyphicon glyphicon-remove"></i> <?php echo str_ireplace(array("'", '"',
'<memberid>'), '', $Translation['username invalid']); ?></span>

<div class="clearfix"></div>

</div>

<div class="row">

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

<div class="form-group">

<label for="password"
class="control-label"><?php echo $Translation['password']; ?></label>
<input class="form-control"
type="password" required="" placeholder="<?php echo $Translation['password']; ?>" id="password"
name="password">

</div>

</div>

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

<div class="form-group">

<label for="confirmPassword"
class="control-label"><?php echo $Translation['confirm password']; ?></label>

<input class="form-control"
type="password" required="" placeholder="<?php echo $Translation['confirm password']; ?>"
id="confirmPassword" name="confirmPassword">

</div>

</div>

</div>

<div class="form-group">

<label for="email" class="control-label"><?php


echo $Translation['email']; ?></label>

<input class="form-control" type="text"


required="" placeholder="<?php echo $Translation['email']; ?>" id="email" name="email">

</div>

<div class="form-group">

<label for="group" class="control-label"><?php


echo $Translation['group']; ?></label>

<?php echo $groupsDropDown; ?>

<span class="help-block"><?php echo


$Translation['groups *']; ?></span>

</div>

<?php
if(!
$adminConfig['hide_custom_user_fields_during_signup']){

for($cf = 1; $cf <= 4; $cf++){

if($adminConfig['custom'.$cf] !=
''){

?>

<div class="row form-


group">

<div class="col-sm-
3"><label class="control-label" for="custom<?php echo $cf; ?>"><?php echo $adminConfig['custom'.
$cf]; ?></label></div>

<div class="col-sm-
9"><input class="form-control" type="text" placeholder="<?php echo $adminConfig['custom'.$cf]; ?>"
id="custom<?php echo $cf; ?>" name="custom<?php echo $cf; ?>"></div>

</div>

<?php

?>

<div class="row">

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

<button class="btn btn-primary btn-lg


btn-block" value="signUp" id="submit" type="submit" name="signUp"><?php echo $Translation['sign
up']; ?></button>

</div>

</div>

</form>

</div> <!-- /div class="panel-body" -->


</div> <!-- /div class="panel ..." -->

</div> <!-- /div class="col..." -->

</div> <!-- /div class="row" -->

<script>

$j(function() {

$j('#username').focus();

$j('#usernameAvailable, #usernameNotAvailable').click(function()
{ $j('#username').focus(); });

$j('#username').on('keyup blur', checkUser);

/* password strength feedback */

$j('#password').on('keyup blur', function(){

var ps = passwordStrength($j('#password').val(), $j('#username').val());

if(ps == 'strong'){

$j('#password').parents('.form-group').removeClass('has-error
has-warning').addClass('has-success');

$j('#password').attr('title', '<?php echo


html_attr($Translation['Password strength: strong']); ?>');

}else if(ps == 'good'){

$j('#password').parents('.form-group').removeClass('has-
success has-error').addClass('has-warning');

$j('#password').attr('title', '<?php echo


html_attr($Translation['Password strength: good']); ?>');

}else{

$j('#password').parents('.form-group').removeClass('has-
success has-warning').addClass('has-error');

$j('#password').attr('title', '<?php echo


html_attr($Translation['Password strength: weak']); ?>');

}
});

/* inline feedback of confirm password */

$j('#confirmPassword').on('keyup blur', function(){

if($j('#confirmPassword').val() != $j('#password').val() || !
$j('#confirmPassword').val().length){

$j('#confirmPassword').parents('.form-
group').removeClass('has-success').addClass('has-error');

}else{

$j('#confirmPassword').parents('.form-
group').removeClass('has-error').addClass('has-success');

});

/* inline feedback of email */

$j('#email').on('change', function(){

if(validateEmail($j('#email').val())){

$j('#email').parents('.form-group').removeClass('has-
error').addClass('has-success');

}else{

$j('#email').parents('.form-group').removeClass('has-
success').addClass('has-error');

});

/* validate form before submitting */

$j('#submit').click(function(e){ if(!jsValidateSignup()) e.preventDefault(); })

});

var uaro; // user availability request object

function checkUser(){
// abort previous request, if any

if(uaro != undefined) uaro.abort();

reset_username_status();

uaro = $j.ajax({

url: 'checkMemberID.php',

type: 'GET',

data: { 'memberID': $j('#username').val() },

success: function(resp){

var ua=resp;

if(ua.match(/\<!-- AVAILABLE --\>/)){

reset_username_status('success');

}else{

reset_username_status('error');

});

function reset_username_status(status){

$j('#usernameNotAvailable, #usernameAvailable')

.addClass('hidden')

.parents('.form-group')

.removeClass('has-error has-success');

if(status == undefined) return;

if(status == 'success'){
$j('#usernameAvailable')

.removeClass('hidden')

.parents('.form-group')

.addClass('has-success');

if(status == 'error'){

$j('#usernameNotAvailable')

.removeClass('hidden')

.parents('.form-group')

.addClass('has-error');

/* validate data before submitting */

function jsValidateSignup(){

var p1 = $j('#password').val();

var p2 = $j('#confirmPassword').val();

var email = $j('#email').val();

/* user exists? */

if(!$j('#username').parents('.form-group').hasClass('has-success')){

modal_window({ message: '<div class="alert alert-danger"><?php echo


html_attr($Translation['username invalid']); ?></div>', title: "<?php echo
html_attr($Translation['error:']); ?>", close: function(){ $j('#username').focus(); } });

return false;

/* passwords not matching? */

if(p1 != p2){
modal_window({ message: '<div class="alert alert-danger"><?php echo
html_attr($Translation['password no match']); ?></div>', title: "<?php echo
html_attr($Translation['error:']); ?>", close: function(){ $j('#confirmPassword').focus(); } });

return false;

if(!validateEmail(email)){

modal_window({ message: '<div class="alert alert-danger"><?php echo


html_attr($Translation['email invalid']); ?></div>', title: "<?php echo html_attr($Translation['error:']); ?
>", close: function(){ $j('#email').focus(); } });

return false;

return true;

</script>

<style>

#usernameAvailable,#usernameNotAvailable{ cursor: pointer; }

</style>

<?php } ?>

<?php include_once("{$currDir}/footer.php"); ?>


Users_view.php
<?php

// This script and data application were generated by AppGini 5.70

// Download AppGini for free from https://bigprof.com/appgini/download/

$currDir=dirname(__FILE__);

include("$currDir/defaultLang.php");

include("$currDir/language.php");

include("$currDir/lib.php");

@include("$currDir/hooks/Users.php");

include("$currDir/Users_dml.php");

// mm: can the current member access this page?

$perm=getTablePermissions('Users');

if(!$perm[0]){

echo error_message($Translation['tableAccessDenied'], false);

echo '<script>setTimeout("window.location=\'index.php?signOut=1\'", 2000);</script>';

exit;

$x = new DataList;

$x->TableName = "Users";

// Fields that can be displayed in the table view

$x->QueryFieldsTV = array(

"`Users`.`id`" => "id",

"`Users`.`Membership_Number`" => "Membership_Number",

"`Users`.`Name`" => "Name",

"`Users`.`Contact`" => "Contact",


"`Users`.`ID_Number`" => "ID_Number"

);

// mapping incoming sort by requests to actual query fields

$x->SortFields = array(

1 => '`Users`.`id`',

2 => 2,

3 => 3,

4 => 4,

5 => '`Users`.`ID_Number`'

);

// Fields that can be displayed in the csv file

$x->QueryFieldsCSV = array(

"`Users`.`id`" => "id",

"`Users`.`Membership_Number`" => "Membership_Number",

"`Users`.`Name`" => "Name",

"`Users`.`Contact`" => "Contact",

"`Users`.`ID_Number`" => "ID_Number"

);

// Fields that can be filtered

$x->QueryFieldsFilters = array(

"`Users`.`id`" => "ID",

"`Users`.`Membership_Number`" => "Membership Number",

"`Users`.`Name`" => "Name",

"`Users`.`Contact`" => "Contact",

"`Users`.`ID_Number`" => "ID Number"


);

// Fields that can be quick searched

$x->QueryFieldsQS = array(

"`Users`.`id`" => "id",

"`Users`.`Membership_Number`" => "Membership_Number",

"`Users`.`Name`" => "Name",

"`Users`.`Contact`" => "Contact",

"`Users`.`ID_Number`" => "ID_Number"

);

// Lookup fields that can be used as filterers

$x->filterers = array();

$x->QueryFrom = "`Users` ";

$x->QueryWhere = '';

$x->QueryOrder = '';

$x->AllowSelection = 1;

$x->HideTableView = ($perm[2]==0 ? 1 : 0);

$x->AllowDelete = $perm[4];

$x->AllowMassDelete = true;

$x->AllowInsert = $perm[1];

$x->AllowUpdate = $perm[3];

$x->SeparateDV = 1;

$x->AllowDeleteOfParents = 0;

$x->AllowFilters = 1;

$x->AllowSavingFilters = 1;

$x->AllowSorting = 1;
$x->AllowNavigation = 1;

$x->AllowPrinting = 1;

$x->AllowCSV = 1;

$x->RecordsPerPage = 10;

$x->QuickSearch = 1;

$x->QuickSearchText = $Translation["quick search"];

$x->ScriptFileName = "Users_view.php";

$x->RedirectAfterInsert = "Users_view.php?SelectedID=#ID#";

$x->TableTitle = "Users";

$x->TableIcon = "resources/table_icons/group.png";

$x->PrimaryKey = "`Users`.`id`";

$x->ColWidth = array( 150, 150, 150, 150);

$x->ColCaption = array("Membership Number", "Name", "Contact", "ID Number");

$x->ColFieldName = array('Membership_Number', 'Name', 'Contact', 'ID_Number');

$x->ColNumber = array(2, 3, 4, 5);

// template paths below are based on the app main directory

$x->Template = 'templates/Users_templateTV.html';

$x->SelectedTemplate = 'templates/Users_templateTVS.html';

$x->TemplateDV = 'templates/Users_templateDV.html';

$x->TemplateDVP = 'templates/Users_templateDVP.html';

$x->ShowTableHeader = 1;

$x->ShowRecordSlots = 0;

$x->TVClasses = "";

$x->DVClasses = "";

$x->HighlightColor = '#FFF0C2';
// mm: build the query based on current member's permissions

$DisplayRecords = $_REQUEST['DisplayRecords'];

if(!in_array($DisplayRecords, array('user', 'group'))){ $DisplayRecords = 'all'; }

if($perm[2]==1 || ($perm[2]>1 && $DisplayRecords=='user' && !$_REQUEST['NoFilter_x'])){ //


view owner only

$x->QueryFrom.=', membership_userrecords';

$x->QueryWhere="where `Users`.`id`=membership_userrecords.pkValue and


membership_userrecords.tableName='Users' and
lcase(membership_userrecords.memberID)='".getLoggedMemberID()."'";

}elseif($perm[2]==2 || ($perm[2]>2 && $DisplayRecords=='group' && !


$_REQUEST['NoFilter_x'])){ // view group only

$x->QueryFrom.=', membership_userrecords';

$x->QueryWhere="where `Users`.`id`=membership_userrecords.pkValue and


membership_userrecords.tableName='Users' and
membership_userrecords.groupID='".getLoggedGroupID()."'";

}elseif($perm[2]==3){ // view all

// no further action

}elseif($perm[2]==0){ // view none

$x->QueryFields = array("Not enough permissions" => "NEP");

$x->QueryFrom = '`Users`';

$x->QueryWhere = '';

$x->DefaultSortField = '';

// hook: Users_init

$render=TRUE;

if(function_exists('Users_init')){

$args=array();

$render=Users_init($x, getMemberInfo(), $args);


}

if($render) $x->Render();

// hook: Users_header

$headerCode='';

if(function_exists('Users_header')){

$args=array();

$headerCode=Users_header($x->ContentType, getMemberInfo(), $args);

if(!$headerCode){

include_once("$currDir/header.php");

}else{

ob_start(); include_once("$currDir/header.php"); $dHeader=ob_get_contents();


ob_end_clean();

echo str_replace('<%%HEADER%%>', $dHeader, $headerCode);

echo $x->HTML;

// hook: Users_footer

$footerCode='';

if(function_exists('Users_footer')){

$args=array();

$footerCode=Users_footer($x->ContentType, getMemberInfo(), $args);

if(!$footerCode){

include_once("$currDir/footer.php");

}else{
ob_start(); include_once("$currDir/footer.php"); $dFooter=ob_get_contents();
ob_end_clean();

echo str_replace('<%%FOOTER%%>', $dFooter, $footerCode);

?>

Index.php
<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE);

$currDir = dirname(__FILE__);

include("{$currDir}/defaultLang.php");

include("{$currDir}/language.php");

include("{$currDir}/lib.php");

$x = new DataList;

$x->TableTitle = $Translation['homepage'];

$tablesPerRow = 2;

$arrTables = getTableList();

// according to provided GET parameters, either log out, show login form (possibly with a failed
login message), or show homepage

if(isset($_GET['signOut'])){

logOutUser();

redirect("index.php?signIn=1");

}elseif(isset($_GET['loginFailed']) || isset($_GET['signIn'])){

if(!headers_sent() && isset($_GET['loginFailed'])) header('HTTP/1.0 403 Forbidden');

include("{$currDir}/login.php");

}else{

include("{$currDir}/main.php"); }
5. System Testing
The aim of the system testing process was to determine all defects in our project
.The
program was subjected to a set of test inputs and various observations were made
and based
on these observations it will be decided whether the program behaves as expected
or not. Our
Project went through two levels of testing

1.Unit testing
2.integration testing

UNIT TESTING
Unit testing is undertaken when a module has been created and succesfully
reviewed .In order
to test a single module we need to provide a complete environment ie besides the
module we
would require
The procedures belonging to other modules that the module under test calls

Non local data structures that module accesses

A procedure to call the functions of the module under test with appropriate
parameters
Unit testing was done on each and every module that is described under module
description of chapter 4.

1. Test For the admin module

Testing admin login form-This form is used for log in of administrator of


the system.In this we enter the username and password if both are correct
administration page will open other wise if any of data is wrong it will get
redirected back to the login page and again ask for username and password

Student account addition- In this section the admin can verify student
details from student academinc info and then only add student details to
main library database it contains add and delete buttons if user click add
button data will be added to student database and if he clicks delete button
the student data will be deleted

Book Addition- Admin can enter details of book and can add the details to
the main book table also he can view the books requests .

2. Test for Student login module
Test for Student login Form-This form is used for log in of Student .In this
we enter thelibraryid, username and password if all these are correct student
login page will open other wise if any of data is wrong it will get redirected
back to the login page and again ask for libraryid, username and password.

Test for account creation- This form is used for new account creation when
student does not fill the form completely it asks again to fill the whole form
when he fill the form fully it gets redirected to page which show waiting
for conformation message as his data will be only added by administrator
after verification.

2. Test for teacher login module-

Test for teacher login form- This form is used for logg in of teacher .In this we
enter the
username and password if all these are correct teacher login page will open other
wise if any of
data is wrong it will get redirected back to the login page and again ask for
username and
password.

INTEGRATION TESTING
In this type of testing we test various integration of the project module by
providing the input
.The primary objective is to test the module interfaces in order to ensure that no
errors are occurring when one module invokes the other module.

66
6. CONCLUSION & FUTURE SCOPE

This website provides a computerized version of library management system


which will benefit the students as well as the staff of the library.

It makes entire process online where student can search books, staff can generate
reports and do book transactions. It also has a facility for student login where
student can login and can see status of books issued as well request for book or
give some suggestions. It has a facility of teacher’s login where teachers can add
lectures notes and also give necessary suggestion to library and also add info about
workshops or events happening in our college or nearby college in the online
notice board.

There is a future scope of this facility that many more features such as online
lectures video tutorials can be added by teachers as well as online assignments
submission facility , a feature Of group chat where students can discuss various
issues of engineering can be added to this project thus making it more interactive
more user friendly and project which fulfills each users need in the best way
possible.

REFERENCES

http://www.w3schools.com/html/html_intro.asp
http://www.Udemy.com/css/css_background.asp
http://www.w3schools.com/js/js_datatypes.asp

67

You might also like