0% found this document useful (0 votes)
5 views69 pages

Report - Creditcard

The project report details the development of a credit card transaction system utilizing face recognition technology to enhance security and streamline payment processes. It discusses the limitations of existing systems that rely on One-Time Passwords (OTP) and proposes a new method that verifies user identity through facial recognition, thus reducing risks associated with fraud. The report includes acknowledgments, an abstract, system analysis, configuration, and software descriptions, outlining the project's objectives and technical specifications.

Uploaded by

songsloverr.k
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)
5 views69 pages

Report - Creditcard

The project report details the development of a credit card transaction system utilizing face recognition technology to enhance security and streamline payment processes. It discusses the limitations of existing systems that rely on One-Time Passwords (OTP) and proposes a new method that verifies user identity through facial recognition, thus reducing risks associated with fraud. The report includes acknowledgments, an abstract, system analysis, configuration, and software descriptions, outlining the project's objectives and technical specifications.

Uploaded by

songsloverr.k
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/ 69

CREDIT CARD TRANSACTION

USING FACE RECOGNITION

A PROJECT REPORT

Submitted by

ABINAYA G (731220104001)
DHARANISELVI M (731220104007)
ROSHMA I (731220104023)

in partial fulfilment for the award of the degree


of

BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING

J.K.K. MUNIRAJAH COLLEGE OF TECHNOLOGY

T.N. PALAYAM, GOBI – 638506

ANNA UNIVERSITY: CHENNAI-600025

MAY-2024
ANNA UNIVERSITY: CHENNAI-600 025

BONAFIDE CERTIFICATE

Certified that this project report on “CREDIT CARD TRANSACTION


USING FACE RECOGNITION” is the Bonafide work of “ABINAYA G
(731220104001) and DHARANISEVI M (731220104007) and ROSHMA I
(731220104023)” who carried out the project work under my supervision.

SIGNATURE SIGNATURE

Dr.N.SATHYABALAJI M.E., Ph.D., M.I.S.T.E., Mrs.P.SASIREKA, M.E.,

ASSOCIATE PROFESSOR ASSISTANT PROFESSOR

HEAD OF THE DEPARTMENT SUPERVISOR

Dept of Computer Science and Engineering Dept of Computer Science and Engineering

J.K.K. Munirajah College of Technology J.K.K. Munirajah College of Technology

T.N. Palayam. T.N. Palayam.

Submitted for the Viva-Voce examination held on________________________

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

We express our sincere thanks and grateful acknowledgement to our chairman


Dr.J.K.K. MUNIRAJAH., M.Tech(Bolton). D.Litt. for providing all facilities
during the course of study in this college.

We would like to express our thanks to our secretary madam


Mrs. KASTHURIPRIYA KRUPAKARMURALI, M.B.A., who has provided
all the available facilities and support help us in the completion of our project.

We have immense pleasure in expressing my extreme gratitude thanks to our


beloved Principal Dr. K. SRIDHARAN, M.E., M.B.A., Ph.D., M.I.S.T.E., for
his encouragement and support.

We wish to express our heartfelt thanks to our respectful Head of The


Department Dr. N. SATHYABALAJI, M.E., Ph.D., M.I.S.T.E., for his
inspiring help, guidance, efforted energy in the right direction for completing
this project.

We also thank our guide Mrs.P. SASIREKA, M.E., Assistant Professor,


Department of Computer Science and Engineering, who has been driving force
to unveil the immense talents in us.

We sincerely thank our lovable parents for their motivation and great support to
complete this project successfully.

We also thank all the teaching and non-teaching staffs of the Department of
Computer Science and Engineering and all my friends for their help and support
to complete this project successfully.

iii
ABSTRACT
The payment modes at Point of Sales (POS) have different modes such as cash
on delivery, online transaction, credit card transaction and monthly instalments
etc. This project proposes a method for credit card system used in transaction
system which will integrate with the face detection. At the time of payment made
by the user on portal will be compared to the features from the dataset of the
respective user. A method for credit card transaction system which will make use
of face recognition and face detection technology, using Neural network. The
integration of facial recognition technology in credit card transactions presents a
promising avenue for enhancing security and convenience in financial
transactions. This paper explores the implementation of facial recognition
systems as a means to authenticate credit card transactions. The proposed system
leverages advanced facial recognition algorithms to verify the identity of
cardholders during payment processes, mitigating the risks associated with
traditional authentication methods such as PINs or signatures. Additionally, the
system aims to streamline the checkout process, offering a frictionless and user-
friendly experience for consumers. Through a comprehensive analysis of the
technical feasibility, security considerations, and user acceptance, this paper
evaluates the potential benefits and challenges of adopting facial recognition
technology in credit card transactions. Moreover, it discusses the implications of
regulatory frameworks and privacy concerns, highlighting the importance of
robust data protection measures and transparent policies to ensure the ethical and
responsible deployment of such systems. Overall, this research contributes to the
ongoing discourse on leveraging biometric authentication methods to enhance the
security and efficiency of financial transactions in the digital age.

iv
TABLE OF CONTENTS

CHAPTER
TITLE PAGE NO.
NO.
ACKNOWLEDGEMENT iii

ABSTRACT iv

1 INTRODUCTION 1

2 SYSTEM ANALYSIS 3

2.1 Existing System 3

2.2 Proposed System 3

3 SYSTEM CONFIGURATION 4

4 SYSTEM DESCRIPTION 5

4.1 Frontend 5

4.2 Backend 11

5 SYSTEM DESIGN 15

5.1 Module Description 15

5.2 Data Flow Diagram 17

5.3 Use Case Diagram 20

5.4 Sequence Diagram 20

6 SYSTEM STUDY 22

6.1 Feasibility Study 22

v
7 TESTING AND IMPLEMENTATION 23

7.1 Testing 23

7.2 Implementation 26

8 CONCLUSION AND FUTURE 27


ENHANCEMENT
8.1 Conclusion 27

8.2 Future Work 27

9 APPENDIX 28

A. Source Code 28

B. Screen Layout 57

10 BIBILIOGRAPHY 61

vi
1. INTRODUCTION

In the current scenario, credit card and debit card are becoming the most
common type of payment mode. All the credit card related task is managed by
credit card processor. Companies using credit card processing makes sure that
transactions are processed correctly and on time. Many companies prefer online
transaction because it benefits their business. Funds are transferred into account
on time without putting much effort. Since people are comfortable with cashless
transactions, the demand of credit card is increasing rapidly. The main problem
faced by the credit card users is to have a secure online transaction. Credit card
fraud is a big challenge.
‘Fraud’ in credit card transactions is unauthorized and unwanted usage of an
account by someone other than the owner of that account. Care must be taken to
avoid such abuses and the behaviour of this negative behaviour can be learned to
reduce and prevent similar situations in the future. In other words, credit card
fraud can be defined as the situation where some person uses someone else’s
credit card for personal reasons. Fraud research involves monitoring the activities
of groups used to predict, understand or avoid unethical behaviour. the evolution
of financial technology has brought convenience and efficiency to our lives,
particularly through credit card transactions. However, this progress has also led
to a rise in sophisticated fraudulent activities, compelling the need for innovative,
secure solutions. One such ground breaking approach in the realm of fraud
detection is the integration of face recognition technology within credit card
authentication systems. The proposed solution will make use of face detection
and face recognition technology for making credit card transaction system
secured and much better.
E-commerce is fast gaining ground as an accepted and used business
paradigm. More and more business houses are implementing web sites providing
functionality for performing commercial transactions over the web. It is

1
reasonable to say that the process of shopping on the web is becoming
commonplace. The objective of project is to develop a general-purpose e-
commerce store where any product (such as books, CDs, computers, mobile
phones, electronic items, and home appliances) can be bought from the comfort
of home through the Internet. An online store is a virtual store on the internet
where customers can browse the catalog and select products of interest. The
selected items may be collected in a shopping cart. At checkout time, the items
in the shopping cart will be presented as an order. At that time, more information
will be needed to complete the transaction. Usually, the customer will be asked
to fill or select a billing address, a shipping address, a shipping option, and
payment information such as credit card number.
In this project the credit card transaction is using face recognition
technology. If the face detection process is completely finish then only move on
to the next process. An e- mail notification is sent to the customer as soon as the
order is placed. Seller selling products on the web often ask or take reviews from
customers about the products that they have purchased. As e-commerce is
growing and becoming popular day-by-day, the number of feedback received
from customer about the product grows rapidly. For a popular product, the
feedback can go up-to thousands. This creates difficulty for the potential customer
to read them and to make a decision whether to buy or not the product. Problems
also arise for the manufacturer of the product to keep track and to manage
customer opinions. And also, additional difficulties are faced by the manufacturer
because many other merchant sites may sell the same product at good ratings and
the manufacturer normally produces many kinds of products.

2
2. SYSTEM ANALYSIS

2.1 EXISTING SYSTEM


Digital payment systems have significantly increased the convenience and
speed of transactions, particularly in the realm of credit card payments. However,
this convenience comes with inherent security risks, leading to an on-going battle
against fraudulent activities. One pivotal approach to fortifying the security of
credit card transactions involves the integration of One-Time Password (OTP)
verification. Existing system multifaceted landscape of credit card transaction
security bolstered by OTP verification. It explores the fundamental architecture
and mechanisms underlying the OTP-based authentication process within credit
card transactions.
By generating a dynamic, time-sensitive code sent through various
channels such as SMS, email, or authenticator apps, OTP serves as an additional
layer of security, deterring unauthorized access and fraudulent activities. This
abstract also investigates the role of OTP in mitigating diverse forms of cyber
threats, including phishing attacks, card-not-present (CNP) fraud, and identity
theft. Through its ephemeral nature and single-use characteristic, OTP
significantly elevates transactional security by providing a unique code for each
transaction, rendering intercepted codes useless for subsequent unauthorized
access. TP verification often requires a stable network connection to receive the
code. In areas with poor network coverage or during network outages, customers
might face difficulties in receiving OTPs, leading to transaction failures or delays.
Implementing OTP systems requires investments in technology infrastructure and
maintenance, adding to operational costs for businesses. In areas with poor
network coverage or during network outages, customers might face difficulties in
receiving OTPs, leading to transaction failures or delays. Implementing OTP
systems requires investments in technology infrastructure and maintenance,
adding to operational costs for businesses.

3
2.2 PROPOSED SYSTEM

The credit card transaction process incorporating face verification follows


a multi-step procedure to ensure secure and seamless transactions. Initially, upon
initiating a purchase, the system captures the transaction details and prompts the
user for payment. Simultaneously, it activates the face verification feature,
prompting the user to authorize the transaction by scanning their face. The system
utilizes advanced facial recognition algorithms to analyze unique facial features,
comparing them against pre-registered biometric data securely stored in the
database. This comparison verifies the user's identity and confirms their
authorization for the transaction. After successful verification, the system
completes the transaction, providing real-time approval, and initiates the
necessary financial transfer. In the case of a mismatch or inability to verify the
user's face, the transaction is halted, prompting alternate authentication methods
or declining the transaction to prevent unauthorized access.

The proposed system is developed after a detailed study about the


requirements requested by the user. Proposed system is a computerized one,
where all the limitations of manual system are compensated. Product details of
online shopping system with credit card transaction based on face recognition
technology have simplified the working information and make a user-friendly
environment, where the user is provided with much flexibility to manage
effectively. It helps the retailer to generate desirable reports more quickly and
also to produce better results. In the proposed system, we are using face detection
using web application to provide secure transaction authenticity of credit card
holder for online shopping. In this project the user can buy a product through this
website, after buying the products the user can pay the amount using credit card
transaction with face detection.

4
3. SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

• CPU Type : Any Intel or AMD x64 with 2 Core processor


• Clock speed : 2 GHz and Above
• RAM size : 8 GB Recommended
• Disk Space : 512 GB
• Display / Resolution : Min 14” / 1024 by 768 or Higher Display
Resolution
• Keyboard & Mouse : USB or Internal

SOFTWARE REQUIREMENTS

• Operating System : 64-bit Microsoft Windows 11, 10


• Frond End : Python
• Back End : MYSQL (WAMP Server)
• Tool : Python 3.7
• IDE : PyCharm 2019.3

5
4. SOFTWARE DESCRIPTION

4.1 FRONT END


PYTHON
Python is an interpreted high-level programming language for general-
purpose programming. Created by Guido van Rossum and first released in 1991,
Python has a design philosophy that emphasizes code readability, notably using
significant whitespace. It provides constructs that enable clear programming on
both small and large scales. In July 2018, Van Rossum stepped down as the leader
in the language community. Python features a dynamic type system and
automatic memory management. It supports multiple programming paradigms,
including object-oriented, imperative, functional and procedural, and has a large
and comprehensive standard library. Python interpreters are available for many
operating systems. C Python, the reference implementation of Python, is open-
source software and has a community-based development model, as do nearly all
of Python's other implementations. Python and C Python are managed by the non-
profit Python Software Foundation. Rather than having all of its functionality
built into its core, Python was designed to be highly extensible. This compact
modularity has made it particularly popular as a means of adding programmable
interfaces to existing applications. Van Rossum's vision of a small core language
with a large standard library and easily extensible interpreter stemmed from his
frustrations with ABC, which espoused the opposite approach. While offering
choice in coding methodology, the Python philosophy rejects exuberant syntax
(such as that of Perl) in favor of a simpler, less-cluttered grammar. As Alex
Martelli put it: "To describe something as 'clever' is not considered a compliment
in the Python culture. Python’s philosophy rejects the Perl "there is more than
one way to do it" approach to language design in favour of "there should be one—
and preferably only one—obvious way to do it".

6
Python's developers strive to avoid premature optimization, and reject
patches to non-critical parts of C Python that would offer marginal increases in
speed at the cost of clarity. [ When speed is important, a Python programmer can
move time-critical functions to extension modules written in languages such as
C, or use Py, a just-in-time compiler. C Python is also available, which translates
a Python script into C and makes direct C-level API calls into the Python
interpreter. An important goal of Python's developers is keeping it fun to use. This
is reflected in the language's name a tribute to the British comedy group Monty
Python.

Python’s initial development was spearheaded by Guido van Rossum in


the late 1980s. Today, it is developed by the Python Software Foundation.
Because Python is a multiparadigm language, Python programmers can
accomplish their tasks using different styles of programming: object oriented,
imperative, functional or reflective. Python can be used in Web development,
numeric programming, game development, serial port access and more.
There are two attributes that make development time in Python faster than in other
programming languages:

1. Python is an interpreted language, which precludes the need to compile


code before executing a program because Python does the compilation in
the background. Because Python is a high-level programming language, it
abstracts many sophisticated details from the programming code. Python
focuses so much on this abstraction that its code can be understood by most
novice programmers.
2. Python code tends to be shorter than comparable codes. Although Python
offers fast development times, it lags slightly in terms of execution time.
Compared to fully compiling languages like C and C++, Python programs
execute slower. Of course, with the processing speeds of computers these
days, the speed differences are usually only observed in benchmarking

7
tests, not in real-world operations. In most cases, Python is already
included in Linux distributions and Mac OS X machines.
Python itself also provides modules and packages to learn and supports program
modularity and code reuse. As users work with Python, they will want to be
familiar with the current version, development environment and supporting tools,
specifically the following:
Python Tools:
Python 3.0, which dates to 2008, remains the latest version. Unlike
previous updates that concentrated on debugging earlier versions of Python,
Python 3 had forward compatibility and coding style changes. As a result, Python
3 could not support previous releases. The code syntax narrowed in on code
repetition and redundancy, allowing the code to tackle the same tasks in many
different ways. This single change made it much easier for beginners to learn
Python programming.
Integrated Development and Learning Environment (IDLE) is the standard
Python development environment. It enables access to the Python interactive mode
through the Python shell window. Users can also use Python IDLE to create or edit
existing Python source files by leveraging the file editor.
Python Launcher lets developers run Python scripts from the desktop. Simply
select Python Launcher as the default application to open any .py script by double-
clicking on it through the Finder window. Python Launcher offers many options to
control how users launch Python scripts.
Anaconda is a leading open-source distribution for Python and R programming
languages with over 300 built-in libraries specially developed for ML projects. Its
primary objective is to simplify package management and deployment.
Python’s Features includes:
1. Easy to Code: Python is a very high-level programming language, yet it is
effortless to learn. Anyone can learn to code in Python in just a few hours
or a few days. Mastering Python and all its advanced concepts, packages

8
and modules might take some more time. However, learning the basic
Python syntax is very easy, as compared to other popular languages like C,
C++, and Java.
2. Easy to Read: Python code looks like simple English words. There is no
use of semicolons or brackets, and the indentations define the code block.
You can tell what the code is supposed to do simply by looking at it.
3. Free and Open-Source: Python is developed under an OSI-approved
open-source license. Hence, it is completely free to use, even for
commercial purposes. It doesn't cost anything to download Python or to
include it in your application. It can also be freely modified and re-
distributed. Python can be downloaded from the official Python website.
4. Robust Standard Library: Python has an extensive standard library
available for anyone to use. This means that programmers don’t have to
write their code for every single thing unlike other programming
languages. There are libraries for image manipulation, databases, unit-
testing, expressions and a lot of other functionalities. In addition to the
standard library, there is also a growing collection of thousands of
components, which are all available in the Python Package Index.
5. Interpreted: When a programming language is interpreted, it means that
the source code is executed line by line, and not all at once. Programming
languages such as C++ or Java are not interpreted, and hence need to be
compiled first to run them. There is no need to compile Python because it
is processed at runtime by the interpreter.
6. Portable: Python is portable in the sense that the same code can be used
on different machines. Suppose you write a Python code on a Mac. If you
want to run it on Windows or Linux later, you don’t have to make any
changes to it. As such, there is no need to write a program multiple times
for several platforms.

9
7. Object-Oriented and Procedure-Oriented: A programming language is
object-oriented if it focuses design around data and objects, rather than
functions and logic. On the contrary, a programming language is
procedure-oriented if it focuses more on functions (code that can be
reused). One of the critical Python features is that it supports both object-
oriented and procedure-oriented programming.
8. Extensible: A programming language is said to be extensible if it can be
extended to other languages. Python code can also be written in other
languages like C++, making it a highly extensible language.
9. Expressive: Python needs to use only a few lines of code to perform
complex tasks. For example, to display Hello World, you simply need to
type one line - print(“Hello World”). Other languages like Java or C would
take up multiple lines to execute this.
10.Support for GUI: One of the key aspects of any programming language
is support for GUI or Graphical User Interface. A user can easily interact
with the software using a GUI. Python offers various toolkits, such as
Tkinter, wxPython and JPython, which allows for GUI's easy and fast
development.

HTML
HTML is stands for Hyper Text Markup Language which is used for
creating web pages and web applications. Hyper Text: Hyper Text simply means
"Text within Text." A text has a link within it, is a hypertext. Whenever you click
on a link which brings you to a new webpage, you have clicked on a hypertext.
Hyper Text is a way to link two or more web pages (HTML documents) with
each other.
Markup language: A Markup language is a computer language that is used
to apply layout and formatting conventions to a text document. Markup language

10
makes text more interactive and dynamic. It can turn text into images, tables,
links, etc.
Web Page: A web page is a document which is commonly written in
HTML and translated by a web browser. A web page can be identified by entering
an URL. A Web page can be of the static or dynamic type. With the help of HTML
only, we can create static web pages.

Introduction of html:
The Hyper Text Markup Language or HTML is the standard Markup
language for documents designed to be displayed in a web browser. It is often
assisted by technologies such as Cascading Style Sheets (CSS) and scripting
languages such as JavaScript. Web browsers receive HTML documents from a
web server or from local storage and render the documents into multimedia web.
HTML describes the structure of a web page semantically and originally included
cues for its appearance. HTML elements are the building blocks of HTML pages.
With HTML constructs, images and other objects such as interactive forms may
be embedded into the rendered page. HTML provides a means to create structured
documents by denoting structural semantics for text such as headings, paragraphs,
lists, links, quotes, and other items. HTML elements are delineated by tags,
written using angle brackets. Tags such as <img /> and <input /> directly
introduce content into the page. Other tags such as <p> and </p> surround and
provide information about document text and may include sub -element tags.
Browsers do not display the HTML tags but use them to interpret the content of
the page.

Features of HTML:
• User Friendly & Simple
• Semantic Structure
• SEO – Search Engine Optimisation
• Canvas for Game Development

11
• Platform Independent
• Media Support

CSS
Cascading Style Sheets (CSS) is a style sheet language used for describing
the presentation of a document written in a markup language such as HTML or
XML (including XML dialects such as SVG, MathML or XHTML).CSS is a
cornerstone technology of the World Wide Web, alongside HTML and
JavaScript. CSS is designed to enable the separation of content and presentation,
including layout, colors, and fonts. This separation can improve content
accessibility; provide more flexibility and control in the specification o f
presentation characteristics; enable multiple web pages to share formatting by
specifying the relevant CSS in a separate .css file, which reduces complexity and
repetition in the structural content;

Uses of CSS:
• Add unique styles to our old documents of HTML.
• Change the overall look and feel of our website by following some changes
in the CSS code.
• A cascading style sheet can be used with JavaScript and HTML in most of
the websites to develop user interfaces for a lot of mobile applications and
user interfaces for various web applications.

Features of CSS
• Opportunity in Web designing
• Website Design
• Web Control: CSS has controlling power on the documents of HTML, so
it is easy to learn.
• Other Languages: CSS and HTML supports other associated technologies
like Angular, PHP, and JavaScript are become clearer to understand.

12
PyCharm IDE:
PyCharm is one of the most popular Python IDEs. There is a multitude of
reasons for this, including the fact that it is developed by Jet Brains, the developer
behind the popular IntelliJ IDEA IDE that is one of the big 3 of Java IDEs and
the “smartest JavaScript IDE” Web Storm. Having the support for web
development by leveraging Django is yet another credible reason. There is a
galore of factors that make PyCharm one of the most complete and
comprehensive integrated development environments for working wit h the
Python programming language. Available as a cross-platform application,
PyCharm is compatible with Linux, macOS, and Windows platforms. Sitting
gracefully among the best Python IDEs, PyCharm provides support for both
Python 2 (2.7) and Python 3 (3.5 and above) versions. PyCharm comes with a
plethora of modules, packages, and tools to hasten Python development while
cutting-down the effort required doing the same to a great extent, simultaneously.
The main reason PyCharm for the creation of this IDE was for Python
programming, and to operate across multiple platforms like Windows, Linux, and
macOS. The IDE comprises code analysis tools, debugger, testing tools, and also
version control options. It also assists developers in building Python plugins with
the help of various APIs available. The IDE allows us to work with several
databases directly without getting it integrated with other tools. Although it is
specially designed for Python, HTML, CSS, and Java script files can also be
created with this IDE. It also comes with a beautiful user interface that can be
customized according to the needs using plugins. PyCharm is an extremely
popular Python IDE.

13
4.2 BACK END

MYSQL
MySQL is an Oracle-backed open-source relational database management
system (RDBMS) based on Structured Query Language (SQL). MySQL runs on
virtually all platforms, including Linux, UNIX and Windows. Although it can be
used in a wide range of applications, MySQL is most often associated with web
applications and online publishing.

MySQL is based on a client-server model. The core of MySQL is MySQL


server, which handles all of the database instructions (or commands). MySQL
server is available as a separate program for use in a client -server networked
environment and as a library that can be embedded (or linked) into separate
applications.

MySQL operates along with several utility programs which support the
administration of MySQL databases. Commands are sent to MySQL Server via
the MySQL client, which is installed on a computer. MySQL was originally
developed to handle large databases quickly. Although MySQL is typically
installed on only one machine, it is able to send the database to multiple locations,
as users are able to access it via different MySQL client interfaces. These
interfaces send SQL statements to the server and then display the results.

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—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, Joomla, Word Press,
phpBB, MyBB, Drupal and other software built on the LAMP software stack.

14
Inter images

MySQL is primarily an RDBMS and ships with no GUI tools to administer


MySQL databases or manage data contained within the databases. Users may use
the included command line tools, or use MySQL "front-ends", desktop software
and web applications that create and manage MySQL databases, build database
structures, back up data, inspect status, and work with data records. The official
set of MySQL front-end tools, MySQL Workbench is actively developed by
Oracle, and is freely available for use.

Graphical

The official MySQL Workbench is a free integrated environment


developed by MySQL AB, that enables users to graphically administer MySQL
databases and visually design database structures. MySQL Workbench replaces
the previous package of software, MySQL GUI Tools. Similar to other third-party
packages, but still considered the authoritative MySQL frontend, MySQL
Workbench lets users manage database design & modeling, SQL development
(replacing MySQL Query Browser) and Database administration (replacing
MySQL Administrator).

MySQL Workbench is available in two editions, the regular free and open-
source Community Edition which may be downloaded from the MySQL website,
and the proprietary Standard Edition which extends and improves the feature set
of the Community Edition.

Command line

MySQL ships with some command line tools. Third-parties have also developed
tools to manage a MySQL server, some listed below.

Maatkit - a cross-platform toolkit for MySQL, PostgreSQL and


Memcached, developed in Perl Maatkit can be used to prove replication is

15
working correctly, fix corrupted data, automate repetitive tasks, and speed up
servers. Maatkit is included with several GNU/Linux distributions such as
CentOS and Debian and packages are available for Programming

MySQL works on many different system platforms, including AIX, BSDi,


FreeBSD, HP-UX, eComStation, i5/OS, IRIX, Linux, Mac OS X, Microsoft
Windows, NetBSD, Novell NetWare, OpenBSD, OpenSolaris, OS/2 Warp,
QNX, Solaris, Symbian, SunOS, SCO OpenServer, SCO UnixWare, Sanos and
Tru64. A port of MySQL to OpenVMS also exists.

MySQL is written in C and C++. Its SQL parser is written in yacc, and a
home-brewed lexical analyzer. Many programming languages with language-
specific APIs include libraries for accessing MySQL databases. These include
MySQL Connector/Net for integration with Microsoft's Visual Studio (languages
such as C# and VB are most commonly used) and the JDBC driver for Java. In
addition, an ODBC inter image called My ODBC allows additional programming
languages that support the ODBC inter image to communicate with a MySQL
database, such as ASP or ColdFusion.

Features of MySQL:

• Relational Database Management System (RDBMS)


• Easy to use it is secure
• Client/ server architecture
• Free to download
• High flexibility
• Compatible on many operating systems
• Memory efficiency
• High performance
• High productivity
• Platform independent GUI support
16
WAMP SERVER:

WAMP, also known as WAMP server is a free local host server stack
comprising Apache, MySQL and PHP for Windows. It is ideal for learning,
testing and developing websites without having to use a remote web server. The
larger the website, the more there is to lose. If you don’t like nasty surprises, use
a local host. Wamp stands for "Windows, Apache, MySQL, and PHP." WAMP
is a variation of LAMP for Windows systems and is often installed as a software
bundle (Apache, MySQL, and PHP). It is often used for web development and
internal testing, but may also be used to serve live websites. The most important
part of the WAMP package is Apache (or "Apache HTTP Server") which is used
run the web server within Windows. By running a local Apache web server on a
Windows machine, a web developer can test webpages in a web browser without
publishing them live on the Internet.

WAMP also includes MySQL and PHP, which are two of the most
common technologies used for creating dynamic websites. MySQL is a high -
speed database, while PHP is a scripting language that can be used to access data
from the database. By installing these two components locally, a developer can
build and test a dynamic website before publishing it to a public web server.

While Apache, MySQL, and PHP are open-source components that can be
installed individually, they are usually installed together.

17
5. SYSTEM DESIGN

5.1 MODULE DESCRIPTION

Admin Module:

Login

• The login module incorporates robust authentication methods to verify the


identity of administrators accessing the payment system.
• It serves as a secure gateway for authorized access to the payment
processing system, allowing administrators, or other entities to authenticate
themselves and interact with the payment functionalities.
• This module admin should login the system with authenticated username
and password. Admin is responsibility to maintain all information in
database up to date.

Add product

• Adding a product to a payment processing system typically involves an


administrative interface or module where administrators can input and
manage details about the product.

• This ensures that only authorized personnel have access to product


management functionalities.

• In this module, admin add the product details such product id, product
name, product type, and image, quantity, and price details.

View User Details

• Viewing user details in a payment processing system is a crucial function


for administrators to manage and monitor user accounts.

18
• The administrator logs into the admin module using secure credentials to
ensure authorized access to user details.

• The admin can search for a specific user by entering relevant criteria such
as username, email, or user id. Alternatively, the administrator may browse
a list of users.

• This module admin can view all information of users in the system and all
the user details are stored into the database.

Manage Transactions

• Managing transactions within a payment processing system involves


various administrative tasks to ensure smooth and secure financial
operations.

• The admin is presented with an overview of recent transactions, including


details such as transaction ID, date, amount, user information, and
transaction status.

User Module:

Register

• The user registration process for payment processing involves enabling


individuals to create accounts within a system, providing necessary
information for secure and personalized financial transactions.
• Users choose a unique username and create a secure password for
accessing their accounts.
• This module allows user to enter their User Account Credential Details
likes name, Password, email address, phone no and PIN and then register
their face through camera. New users only allow in this module.

19
Login

• The user login process for payment processing involves secure


authentication to ensure the confidentiality and integrity of financial
transactions.
• Login module allows registered user only. After registration, user can login
the system with registered username and password.

Product Purchase

• It involves a series of steps to present information about the product and


enable the user to make a purchase.
• Products are displayed with relevant information such as product name,
images, price, and a brief description. Users can scroll through the listings
to explore various products.

Face Recognize

• Before payment process, user should verify their face through camera. If
face matches with the database, then make the payment process otherwise
user will not allow the payment process.

Payment Process

• After face verification, user face is matches the database then user will
make the payment process. The payment processing system ensures a
secure and encrypted checkout process to protect sensitive user
information.
• After successful payment, users receive a confirmation message along with
an electronic receipt.
• The receipt may include transaction details, order number, and contact
information for customer support.

20
5.2 DATA FLOW DIAGRAM

A two-dimensional diagram explains how data is processed and transferred


in a system. The graphical depiction identifies each source of data and how it
interacts with other data sources to reach a common output. Individuals seeking
to draft a data flow diagram must identify external inputs and outputs, determine
how the inputs and outputs relate to each other, and explain with graphics how
these connections relate and what they result in. This type of diagram helps
business development and design teams visualize how data is processed and
identify or improve certain aspects.

Data flow Symbols:

Symbol Description

An entity A source of data or


a destination for data.

A process or task that is


performed by the system.

A data store, a place where


data is held between
processes.

A data flow.

21
Level 0:
The Level 0 DFD shows how the system is divided into 'sub -systems'
(processes), each of which deals with one or more of the data flows to or from an
external agent, and which together provide all of the functionality of the system
as a whole. It also identifies internal data stores that must be present in order for
the system to do its job, and shows the flow of data between the various parts of
the system.

Credit card
Admin transaction User
system

Database

Level 1:
The next stage is to create the Level 1 Data Flow Diagram. This highlights
the main functions carried out by the system admin. As a rule, to describe the
system was using between two and seven functions - two being a simple system
and seven being a complicated system. This enables us to keep the model
manageable on screen or paper

22
Login
Store Data

Add products
Store Data
Admin

View User details


Retrieve Data

Manage
Transactions Retrieve Data

Level 2:

The next stage is to create the Level 2 Data Flow Diagram. This highlights
the main functions carried out by the user of the system. As a rule, to describe the
system was using between two and seven functions - two being a simple system
and seven being a complicated system. This enables us to keep the model
manageable on screen or paper.

Register
Store Data

Login
Store Data

User Product
purchase Retrieve Data

Transaction
Process Store Data

Face
Authentication Retrieve Data

23
5.3 USE CASE DIAGRAM

Use-case diagrams describe the high-level functions and scope of a


system. These diagrams also identify the interactions between the system and its
actors. The use cases and actors in use-case diagrams describe what the system
does and how the actors use it, but not how the system operates internally.

24
5.4 SEQUENCE DIAGRAM

A sequence diagram consists of a group of objects that are represented by


lifelines, and the messages that they exchange over time during the interaction. A
sequence diagram shows the sequence of messages passed between objects.
Sequence diagrams can also show the control structures between objects.

25
6. SYSTEM STUDY

6.1 FEASIBILITY STUDY

Feasibility study is a test of the system proposal according to the


workability impact of the organization, ability to meet user’s needs and effective
use of resources.

Technical feasibility

Technical Feasibility is the assessment of the technical view of the system.


The system is developed for Python environment; a platform independent tool is
used to develop the system. Implementing face recognition for credit card
transactions requires robust technical infrastructure. The feasibility study should
assess the availability and reliability of facial recognition algorithms, hardware
compatibility, and data security measures. Ensuring seamless integration with
existing systems and addressing potential technical challenges is essential for
successful implementation. This system is developed according to the standards
and the development software tools are selected in such a way to avoid the
problems cited above. The software used to develop this system is Windows,
Python platform is done efficiently, and the concept of SQL helps to create the
application backend. These components are also helpful in providing interactivity
to Python applications.

Economic feasibility

Economic feasibility or cost benefit is an assessment of the economic


justification for a computer-based system project. Though this system the
administrator can use the tool from anywhere within their concern. The system is
developed using the existing resources. So, the project is economically feasible.
This is the most frequently used method for evaluating the effectiveness of a user
system. More commonly, known as cost analysis the procedure is to determine
the benefits and savings that are expected from a candidate system and compare

26
them with costs. The economic feasibility study evaluates the cost-effectiveness
of implementing face recognition for credit card transactions. It considers
expenses related to technology acquisition, development, maintenance, and
potential savings from reduced fraud.

Operational feasibility

Operational Feasibility deals with the study of prospects of the system.


This system operationally eliminates all the tensions of the administrator and
helps in effectively tracking the project progress. Operational feasibility
examines the practicality of integrating face recognition into credit card
transactions within existing business operations. This includes assessing the
impact on day-to-day processes, Administrator requirements, and user
acceptance. Evaluating the alignment with organizational goals and the ability to
adapt to operational changes is essential to ensure a smooth and effective
implementation.

Schedule feasibility

In this type of feasibility, the skills required for properly applying the new
technology with training in minimum time and the time duration can be checked
out to implement or overrun the new project within minimum time. Schedule
feasibility focuses on the time frame required for the implementation of face
recognition in credit card transactions. It involves setting realistic milestones,
coordinating with stakeholders, and identifying potential bottlenecks. An
accurate timeline ensures timely deployment, minimizes disruptions to ongoing
operations, and helps manage expectations regarding the project's completion.
Regular monitoring and adjustment of the schedule are critical for successful and
timely implementation.

27
7. TESTING AND IMPLEMENTATION

7.1. TESTING

System testing in the context of a Payment Processing System involves


assessing the entire system's functionality, performance, and security to ensure it
operates as intended before it goes live. System testing for a Payment Processing
System involves comprehensive evaluation of the system's various components,
including hardware, software, networks, databases, interfaces, and security
protocols. It aims to validate that all components function harmoniously together
and meet the specified requirements.

Types of Testing

Unit testing

The first test in the development process is the unit test. The source code is
normally divided into modules, which in turn are divided into smaller units called
units. These units have specific behavior. The test done on these units of code is
called unit test. Unit test depends upon the language on which the project is
developed. Unit tests ensure that each unique path of the project performs
accurately to the documented specifications and contains clearly defined inputs
and expected results. Functional and reliability testing in an Engineering
environment. Producing tests for the behaviour of components (nodes and
vertices) of a product to ensure their correct behaviour prior to system integration.

Description: Test if the admin cannot log in with incorrect username or


password.

Input: Incorrect admin username or password.

Expected Output: Login failure.

28
Integration testing

In integration testing modules are combined and tested as a group. Modules


are typically code modules, individual applications, source and destination
applications on a network, etc. Integration Testing follows unit testing and
precedes system testing. Testing after the product is code complete. Betas are
often widely distributed or even distributed to the public at large in hopes that
they will buy the final product when it is released.

Description: Test if a user can successfully register with valid details.

Input: Valid user details (e.g., name, email, password).

Expected Output: User successfully registered and added to the database.

29
Validation testing:

Valid and invalid data should be created and the program should be made to
process this data to catch errors. When the user of each module wants to enter
into the page by the login page using the use rid and password. If the user gives
the wrong password or use rid then the information is provided to the user like
“you must enter user id and password”. Here the inputs given by the user are
validated. That is password validation, format of date are correct, textbox
validation. Changes that need to be done after result of this testing.

Description: Test if the system validates input format during registration.

Input: Invalid input format or missing enter input details (e.g., missing any
field).

Expected Output: Registration failure with a message indicating that the “Please
fill out this field”.

30
7.2 IMPLEMENTATION

The implementation process of credit card transactions using face


recognition in Python with the Haar Cascade algorithm involves several key steps
to ensure a secure and reliable system. This innovative approach combines the
convenience of credit card transactions with the robustness of facial recognition
technology.

Step 1:

To begin with, the implementation requires the integration of Python, a


versatile and widely-used programming language. Python's rich ecosystem of
libraries and frameworks makes it an ideal choice for developing complex
applications, such as those involving image processing and machine learning.

Step 2:

The next crucial step involves the utilization of the Haar Cascade algorithm
for face detection. Haar Cascades are a machine learning-based approach that
identifies objects in images or video by training on positive and negative samples.
In the context of credit card transactions, the algorithm is trained to recognize
human faces, ensuring that only authorized individuals can initiate transactions.

31
Step 3:

The process begins by collecting a diverse dataset of facial images,


including different angles, lighting conditions, and facial expressions. This
dataset is then used to train the Haar Cascade classifier, enabling it to accurately
detect faces in real-time. The trained model is then integrated into the Python
application, allowing it to analyze video streams or images and identify faces with
high precision.

Step 4:

Once facial recognition is successfully implemented, the credit card


transaction process is enhanced with an additional layer of security. Users are
required to present their faces for verification before initiating a transaction. The
system captures the facial features and matches them against the stored data,
ensuring that the person conducting the transaction is the legitimate cardholder.

32
8. CONCLUSION AND FUTURE ENHANCEMENT

8.1 CONCLUSION

This project entitled as “Credit Card Transaction Based on Face Recognition


Technology” has been developed to satisfy all the proposed requirements. The
process of recording details about online shopping is simpler and easier. The
system reduces the possibility of errors to a great extent and maintains the data in
an efficient manner. User friendliness is the unique feature of this system. The
system generates the reports as and when required. The system is highly
interactive and flexible for further enhancement. The coding is done in a
simplified and easy to understandable manner so that other team trying to enhance
the project can do so without facing much difficulty. The documentation will also
assist in the process as it has also been carried out in a simplified and concise way.

8.2 FUTURE WORK

This system is developed such a way that additional enhancement can be done
without much difficulty. The renovation of the project would increase the
flexibility of the system. Also the features are provided in such a way that the
system can also be made better and efficient functionality

• In the future extend the project using android application with the admin
part of online products shopping.
• Add more products in this application.

33
9. APPENDIX

A. SOURCE CODE

from flask import Flask, render_template, flash, request, session,send_file

from flask import render_template, redirect, url_for, request

#from wtforms import Form, TextField, TextAreaField, validators, StringField,


SubmitField

from werkzeug.utils import secure_filename

import datetime

import mysql.connector

from PIL import Image, ImageChops,ImageStat

import mysql.connector

import sys, fsdk, math, ctypes, time

import datetime

from datetime import date

start_date=date.today()

date_1 = datetime.datetime.now().strftime('%d-%b-%Y')

plus_one_hour = datetime.datetime.strptime(date_1,'%d-%b-%Y') +
datetime.timedelta(days=2)

print(plus_one_hour.strftime("%d-%b-%Y"))

import sys

app = Flask(__name__)

34
app.config['DEBUG']

app.config['SECRET_KEY'] = '7d441f27d441f27567d441f2b6176a'

@app.route("/")

def homepage():

return render_template('index.html')

@app.route("/AdminLogin")

def AdminLogin():

return render_template('AdminLogin.html')

@app.route("/UserLogin")

def UserLogin():

return render_template('UserLogin.html')

@app.route("/NewUser1")

def NewUser1():

return render_template('NewUser.html')

@app.route("/AdminHome")

def AdminHome():

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM regtb ")

35
data = cur.fetchall()

return render_template('AdminHome.html', data=data)

@app.route("/UserHome")

def UserHome():

uname=session['uname']

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM regtb where UserName='"+uname+"' ")

data = cur.fetchall()

return render_template('UserHome.html', data=data)

@app.route("/NewProduct")

def NewProduct():

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM protb ")

data = cur.fetchall()

return render_template('NewProduct.html', data=data)

36
@app.route("/AProductInfo")

def AProductInfo():

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM protb ")

data = cur.fetchall()

return render_template('AProductInfo.html', data=data)

@app.route("/adminlogin", methods=['GET', 'POST'])

def adminlogin():

error = None

if request.method == 'POST':

if request.form['uname'] == 'admin' and request.form['password'] == 'admin':

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM regtb ")

data = cur.fetchall()

return render_template('AdminHome.html', data=data)

37
else:

alert = 'Username or Password is wrong'

return render_template('goback.html', data=alert)

@app.route("/newproduct1", methods=['GET', 'POST'])

def newproduct1():

if request.method == 'POST':

#cname = session['Cname']

Cname = request.form['Cname']

Ptype = request.form['Ptype']

Pname = request.form['Pname']

color = request.form['color']

price = request.form['price']

Uvideo = request.form['Uvideo']

spec = request.form['spec']

file = request.files['file']

file.save("static/upload/" + secure_filename(file.filename))

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute(

38
"INSERT INTO protb VALUES ('','"+ Cname +"','" + Ptype + "','" +
Pname + "','" + color + "','" + price + "','" + Uvideo + "','" + spec + "','" +
file.filename + "')")

conn.commit()

conn.close()

alert = 'Product register successfully'

return render_template('goback.html',data=alert )

@app.route("/newproduct", methods=['GET', 'POST'])

def newproduct():

if request.method == 'POST':

if request.form["submit"] == "Submit":

Cname = request.form['Cname']

Ptype = request.form['Ptype']

Pname = request.form['Pname']

color = request.form['color']

price = request.form['price']

Uvideo = request.form['Uvideo']

spec = request.form['spec']

file = request.files['file']

file.save("static/upload/" + file.filename)

39
conn = mysql.connector.connect(user='root', password='',
host='localhost', database='1productrecomdb')

cursor = conn.cursor()

cursor.execute(

"INSERT INTO protb VALUES ('','" + Cname + "','" + Ptype + "','" +


Pname + "','" + color + "','" + price + "','" + Uvideo + "','" + spec + "','" +
file.filename + "')")

conn.commit()

conn.close()

alert = 'Product register successfully'

return render_template('goback.html', data=alert)

elif request.form["submit"] == "Update":

Pid = request.form['Pid']

Cname = request.form['Cname']

Ptype = request.form['Ptype']

Pname = request.form['Pname']

color = request.form['color']

price = request.form['price']

Uvideo = request.form['Uvideo']

spec = request.form['spec']

conn = mysql.connector.connect(user='root', password='',


host='localhost', database='1productrecomdb')
40
cursor = conn.cursor()

cursor.execute(

"update protb set CompanyName ='" + Cname + "',ProductType='" +


Ptype + "',ProductName='" + Pname + "',Color='" + color + "',Price='" + price +
"',VideoUrl='" + Uvideo + "',Specifications='" + spec + "' where id='"+Pid+"' ")

conn.commit()

conn.close()

alert = 'Record Updated!'

return render_template('goback.html', data=alert)

elif request.form["submit"] == "Search":

Pid = request.form['Pid']

conn = mysql.connector.connect(user='root', password='',


host='localhost', database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM protb where id='"+ Pid +"' ")

data = cur.fetchone()

if data:

pid=data[0]

Cname = data[1]

Ptype = data[2]

41
Pname = data[3]

color = data[4]

price = data[5]

Uvideo = data[6]

spec = data[7]

conn = mysql.connector.connect(user='root', password='',


host='localhost', database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM protb ")

data = cur.fetchall()

return render_template('Newproduct.html',
Pid=pid,Cname=Cname,Ptype=Ptype,Pname=Pname,color=color,price=price,U
video=Uvideo,spec=spec)

else:

return 'Incorrect username / password !'

elif request.form["submit"] == "Delete":

Pid = request.form['Pid']

conn = mysql.connector.connect(user='root', password='',


host='localhost', database='1productrecomdb')

cursor = conn.cursor()

cursor.execute(
42
"delete from protb where id='" + Pid + "' ")

conn.commit()

conn.close()

alert = 'Record Deleted!'

return render_template('goback.html', data=alert)

return render_template('goback.html')

@app. route ("/newuser", methods=['GET', 'POST'])

def newuser():

if request.method == 'POST':

uid = request.form['uid']

name1 = request.form['name']

gender1 = request.form['gender']

Age = request.form['age']

email = request.form['email']

pnumber = request.form['phone']

address = request.form['address']

uname = request.form['uname']

password = request.form['psw']

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

43
cursor.execute(

"INSERT INTO regtb VALUES ('"+uid+"','" + name1 + "','" + gender1 +


"','" + Age + "','" + email + "','" + pnumber + "','" + address + "','" + uname + "','"
+ password + "')")

conn.commit()

conn.close()

# return 'file register successfully'

return render_template('UserLogin.html')

@app.route("/userlogin", methods=['GET', 'POST'])

def userlogin():

error = None

if request.method == 'POST':

username = request.form['uname']

password = request.form['password']

session['uname'] = request.form['uname']

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute("SELECT * from regtb where username='" + username + "'


and Password='" + password + "'")

data = cursor.fetchone()

if data is None:
44
alert = 'Username or Password is wrong'

return render_template('goback.html', data=alert)

else:

conn = mysql.connector.connect(user='root', password='',


host='localhost', database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM regtb where username='" + username + "'


and Password='" + password + "'")

data = cur.fetchall()

return render_template('UserHome.html', data=data )

@app.route("/Search")

def Search():

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cur = conn.cursor()

cur.execute("SELECT * FROM protb ")

data = cur.fetchall()

return render_template('Search.html',data=data)

@app.route("/typesearch", methods=['GET', 'POST'])

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')
45
cursor = conn.cursor()

cursor.execute("SELECT * from protb where CompanyName='" + cname + "'


and ProductType='" + ptype + "'")

data = cursor.fetchone()

if data is None:

alert = 'Product Not Found!'

return render_template('goback.html', data=alert)

else:

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cur = conn.cursor()

cur.execute("SELECT * FROM protb where CompanyName='" + cname +


"' and ProductType='" + ptype + "' ")

data = cur.fetchall()

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cur = conn.cursor()

cur.execute("SELECT ProductId,Image,ProductName,Price FROM temptb


where CompanyName='" + cname + "' and ProductType='" + ptype + "' ")

data1 = cur.fetchall()

return render_template('Search.html', data=data, data1=data1)

46
@app.route("/fullInfo")

def fullInfo():

pid = request.args.get('pid')

session['pid'] = pid

rat1 = ''

rat2 = ''

rat3 = ''

rat4 = ''

rat5 = ''

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute(

"SELECT ROUND(AVG(Rate), 1) as numRating FROM reviewtb WHERE


ProductId ='" + pid + "' ")

data2 = cursor.fetchone()

print(data2[0])

if data2 is None:

avgrat = 0

else:

47
if data2[0] == 'None':

avgrat = 0

if (int(avgrat) == 1):

rat1 = 'checked'

if (int(avgrat) == 2):

rat2 = 'checked'

if (int(avgrat) == 3):

rat3 = 'checked'

if (int(avgrat) == 4):

rat4 = 'checked'

if (int(avgrat) == 5):

rat5 = 'checked'

else:

avgrat = data2[0]

if (avgrat == 1):

rat1 = 'checked'

if (avgrat == 2):

rat2 = 'checked'

if (avgrat == 3):

rat3 = 'checked'

48
if (avgrat == 4):

rat4 = 'checked'

if (avgrat == 5):

rat5 = 'checked'

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute(

"SELECT count(Rate) as numRating FROM reviewtb WHERE ProductId


='" + pid + "' ")

data3 = cursor.fetchone()

if data3:

avgrat = data3[0]

else:

return 'Incorrect username / password !'

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute("SELECT sum(Smile1) as count1,sum(Smile2) as count2,


sum(Smile3) as count3, sum(Smile4) as count4, sum(Smile5) as count5,
sum(Smile6) as count6 FROM reviewtb where ProductId='"+ pid +"' ")

data = cursor.fetchone()

49
if data:

smile1 = data[0]

smile2 = data[1]

smile3 = data[2]

smile4 = data[3]

smile5 = data[4]

smile6 = data[5]

else:

return 'Incorrect username / password !'

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cur = conn.cursor()

cur.execute("SELECT UserName,Review FROM reviewtb where ProductId='"


+ pid + "' ")

reviewdata = cur.fetchall()

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cur = conn.cursor()

cur.execute("SELECT * FROM protb where id='" + pid + "' ")

data1 = cur.fetchall()

return render_template('ProductFullInfo.html',data=data1 ,avgrat=avgrat,


rat1=rat1, rat2=rat2, rat3=rat3, rat4=rat4,
50
rat5=rat5,smile1=smile1,smile2=smile2,smile3=smile3, smile4=smile4,
smile5=smile5 ,smile6=smile6, reviewdata=reviewdata )

@app.route("/Book", methods=['GET', 'POST'])

def Book():

if request.method == 'POST':

from uuid import getnode as get_mac

#mac = get_mac()

import LiveRecognition1 as liv1

liv1.examvales()

# liv1.att()

# print(ExamName)

del sys.modules["LiveRecognition1"]

uname = session['uname']

pid = session['pid']

qty = request.form['qty']

ctype = request.form['ctype']

cardno = request.form['cardno']

cvno = request.form['cvno']

Bookingid = ''

ProductName =''

51
UserName= uname

Mobile=''

Email=''

Qty = qty

Amount=''

Mac=get_mac()

CardType= ctype

CardNo=cardno

CvNo=cvno

date = datetime.datetime.now().strftime('%d-%b-%Y')

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute("SELECT * FROM protb where id='" + pid + "'")

data = cursor.fetchone()

if data:

ProductName = data[3]

price = data[5]

Amount= float(price) * float(Qty)

print(Amount)

else:

52
return 'Incorrect username / password !'

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute("SELECT * FROM regtb where UserName='" + uname +


"'")

data = cursor.fetchone()

if data:

Mobile = data[4]

Email= data[3]

else:

return 'Incorrect username / password !'

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute("SELECT count(*) as count FROM booktb ")

data = cursor.fetchone()

if data:

count = data[0]

if count == 0:

count =1;

53
else:

count+=1

else:

return 'Incorrect username / password !'

print(count)

Bookingid="BOOKID00" + str(count)

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cursor = conn.cursor()

cursor.execute(

"INSERT INTO booktb VALUES ('','" + Bookingid + "','"+ pid +"','" +


ProductName + "','" + uname + "','" + Mobile + "','" + Email + "','" + Qty + "','" +
str(Amount) + "','" + str(Mac) + "','"+ CardType +"','"+ CardNo +"','"+ CvNo
+"','"+ date +"','"+end_date+"','0')")

conn.commit()

conn.close()

# return 'file register successfully'

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

cur = conn.cursor()

cur.execute("SELECT * FROM booktb where UserName= '"+ uname +"' ")

data = cur.fetchall()

54
return render_template('UbookInfo.html' , data =data )

@app.route("/UBookInfo")

def UBookInfo():

uname = session['uname']

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1productrecomdb')

# cursor = conn.cursor()

cur = conn.cursor()

cur.execute("SELECT * FROM booktb where UserName='" + uname +"' ")

data = cur.fetchall()

return render_template('UBookInfo.html', data=data)

@app.route("/ABookInfo")

def ABookInfo():

uname = session['uname']

facePen, featurePen, brush = win.Pen(0x60ffffff, 5), win.Pen(0xa060ff60, 1.8),


win.Brush(0x28ffffff)

faceActivePen, faceCapturedPen = win.Pen(0xFF00ff00, 2),


win.Pen(0xFFff0000, 3)

font = win.Font(win.FontFamily("Tahoma"), FONT_SIZE)

text_color, text_shadow = win.Brush(0xffffffff), win.Brush(0xff808080)

trackers = {}

55
#def att():

#pass

sampleNum = 0

while 1:

sampleNum = sampleNum + 1

img = camera.GrabFrame()

for face_id, tracker in trackers.items(): # iterate over current trackers

ss = fsdkTracker.GetName(face_id)

if sampleNum > 100:


#ExamName1,SubjectName1,Date1,Degree1,Department1,Year1=fs.examvales
1()

ts = time.time()

date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')

timeStamp = datetime.datetime.fromtimestamp(ts).strftime('%H:%M:%S')

conn = mysql.connector.connect(user='root', password='', host='localhost',


database='1facefingdb')

cursor = conn.cursor()

cursor.execute("select * from regtb where UserId='" + str(ss) + "'")

data = cursor.fetchone()

if data is None:

print ("Fake Face")

56
else:

print("Amount Transfor Success")

if face_id in faces: tracker.draw(surfGr, gpath, face_id)


#fsdkTracker.GetFacialFeatures(face_id)) # draw existing tracker

else: missed.append(face_id)

for mt in missed: # find and remove trackers that are not active anymore

st = trackers[mt]

if any(st.isIntersect(trackers[tr]) for tr in faces) or not st.draw(surfGr, gpath):


del trackers[mt]

if capturedFace not in trackers:

capturedFace = None

win.ShowWindow(inpBox, win.SW_HIDE)

updateActiveFace()

# surfGr.clipPath(gpath, win.CombineModeExclude).fillRect(brush, 0, 0,
vfmt.Width, vfmt.Height) # clip frames

graphics.drawImage(backsurf, 0, 0) # show backsurface

if sampleNum > 100:

break

msg = win.MSG()

if win.PeekMessage(win.byref(msg), 0, 0, 0, win.PM_REMOVE):

win.TranslateMessage(win.byref(msg))

57
win.DispatchMessage(win.byref(msg))

if msg.message == win.WM_KEYDOWN and msg.wParam ==


win.VK_ESCAPE or need_to_exit: break

print("Please wait while saving Tracker memory... ", end='', flush=True)

fsdkTracker.SaveToFile(trackerMemoryFile)

win.ShowWindow(hwnd, win.SW_HIDE)

img.Free()

fsdkTracker.Free()

camera.Close(

FSDK.FinalizeCapturing()

FSDK.Finalize()

58
B. SCREEN LAYOUT

59
60
61
62
10. BIBLIOGRAPHY

Book Reference

• Van Rossum, Guido, and Fred L. Drake. The python language reference
manual. Network Theory Ltd., 2011.
• Van Rossum, Guido, and Fred L. Drake. The python language reference
manual. Network Theory Ltd., 2011.
• Diesbach, Charles. Introduction to Computer Science using Python: A
Computational Problem-Solving Focus. Wiley Publishing, 2012.
• James, Mike. Programmer's Python: Everything is an Object Something
Completely Different. I/O Press, 2018.
• Reges, Stuart, Marty Stepp, and Allison Obourn. Building Python
Programs. Pearson, 2018.

Web References

• https://www.programiz.com/python-programming
• https://www.learnpython.org/
• https://docs.python.org/3/tutorial/
• https://www.w3schools.com/python/

63

You might also like