Report - Creditcard
Report - Creditcard
A PROJECT REPORT
Submitted by
ABINAYA G (731220104001)
DHARANISELVI M (731220104007)
ROSHMA I (731220104023)
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING
MAY-2024
ANNA UNIVERSITY: CHENNAI-600 025
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
Dept of Computer Science and Engineering Dept of Computer Science and Engineering
ii
ACKNOWLEDGEMENT
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
3 SYSTEM CONFIGURATION 4
4 SYSTEM DESCRIPTION 5
4.1 Frontend 5
4.2 Backend 11
5 SYSTEM DESIGN 15
6 SYSTEM STUDY 22
v
7 TESTING AND IMPLEMENTATION 23
7.1 Testing 23
7.2 Implementation 26
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
3
2.2 PROPOSED SYSTEM
4
3. SYSTEM CONFIGURATION
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
5
4. SOFTWARE DESCRIPTION
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.
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 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.
14
Inter images
Graphical
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.
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 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:
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
Admin Module:
Login
Add product
• In this module, admin add the product details such product id, product
name, product type, and image, quantity, and price details.
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
User Module:
Register
19
Login
Product Purchase
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
Symbol Description
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
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
24
5.4 SEQUENCE DIAGRAM
25
6. SYSTEM STUDY
Technical feasibility
Economic feasibility
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
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
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.
28
Integration testing
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.
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
Step 1:
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:
Step 4:
32
8. CONCLUSION AND FUTURE ENHANCEMENT
8.1 CONCLUSION
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
import datetime
import mysql.connector
import mysql.connector
import datetime
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():
# cursor = conn.cursor()
cur = conn.cursor()
35
data = cur.fetchall()
@app.route("/UserHome")
def UserHome():
uname=session['uname']
# cursor = conn.cursor()
cur = conn.cursor()
data = cur.fetchall()
@app.route("/NewProduct")
def NewProduct():
# cursor = conn.cursor()
cur = conn.cursor()
data = cur.fetchall()
36
@app.route("/AProductInfo")
def AProductInfo():
# cursor = conn.cursor()
cur = conn.cursor()
data = cur.fetchall()
def adminlogin():
error = None
if request.method == 'POST':
# cursor = conn.cursor()
cur = conn.cursor()
data = cur.fetchall()
37
else:
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))
cursor = conn.cursor()
cursor.execute(
38
"INSERT INTO protb VALUES ('','"+ Cname +"','" + Ptype + "','" +
Pname + "','" + color + "','" + price + "','" + Uvideo + "','" + spec + "','" +
file.filename + "')")
conn.commit()
conn.close()
return render_template('goback.html',data=alert )
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(
conn.commit()
conn.close()
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']
cursor.execute(
conn.commit()
conn.close()
Pid = request.form['Pid']
# cursor = conn.cursor()
cur = conn.cursor()
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]
# cursor = conn.cursor()
cur = conn.cursor()
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:
Pid = request.form['Pid']
cursor = conn.cursor()
cursor.execute(
42
"delete from protb where id='" + Pid + "' ")
conn.commit()
conn.close()
return render_template('goback.html')
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']
cursor = conn.cursor()
43
cursor.execute(
conn.commit()
conn.close()
return render_template('UserLogin.html')
def userlogin():
error = None
if request.method == 'POST':
username = request.form['uname']
password = request.form['password']
session['uname'] = request.form['uname']
cursor = conn.cursor()
data = cursor.fetchone()
if data is None:
44
alert = 'Username or Password is wrong'
else:
# cursor = conn.cursor()
cur = conn.cursor()
data = cur.fetchall()
@app.route("/Search")
def Search():
cur = conn.cursor()
data = cur.fetchall()
return render_template('Search.html',data=data)
data = cursor.fetchone()
if data is None:
else:
cur = conn.cursor()
data = cur.fetchall()
cur = conn.cursor()
data1 = cur.fetchall()
46
@app.route("/fullInfo")
def fullInfo():
pid = request.args.get('pid')
session['pid'] = pid
rat1 = ''
rat2 = ''
rat3 = ''
rat4 = ''
rat5 = ''
cursor = conn.cursor()
cursor.execute(
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'
cursor = conn.cursor()
cursor.execute(
data3 = cursor.fetchone()
if data3:
avgrat = data3[0]
else:
cursor = conn.cursor()
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:
cur = conn.cursor()
reviewdata = cur.fetchall()
cur = conn.cursor()
data1 = cur.fetchall()
def Book():
if request.method == 'POST':
#mac = get_mac()
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')
cursor = conn.cursor()
data = cursor.fetchone()
if data:
ProductName = data[3]
price = data[5]
print(Amount)
else:
52
return 'Incorrect username / password !'
cursor = conn.cursor()
data = cursor.fetchone()
if data:
Mobile = data[4]
Email= data[3]
else:
cursor = conn.cursor()
data = cursor.fetchone()
if data:
count = data[0]
if count == 0:
count =1;
53
else:
count+=1
else:
print(count)
Bookingid="BOOKID00" + str(count)
cursor = conn.cursor()
cursor.execute(
conn.commit()
conn.close()
cur = conn.cursor()
data = cur.fetchall()
54
return render_template('UbookInfo.html' , data =data )
@app.route("/UBookInfo")
def UBookInfo():
uname = session['uname']
# cursor = conn.cursor()
cur = conn.cursor()
data = cur.fetchall()
@app.route("/ABookInfo")
def ABookInfo():
uname = session['uname']
trackers = {}
55
#def att():
#pass
sampleNum = 0
while 1:
sampleNum = sampleNum + 1
img = camera.GrabFrame()
ss = fsdkTracker.GetName(face_id)
ts = time.time()
date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
timeStamp = datetime.datetime.fromtimestamp(ts).strftime('%H:%M:%S')
cursor = conn.cursor()
data = cursor.fetchone()
if data is None:
56
else:
else: missed.append(face_id)
for mt in missed: # find and remove trackers that are not active anymore
st = trackers[mt]
capturedFace = None
win.ShowWindow(inpBox, win.SW_HIDE)
updateActiveFace()
# surfGr.clipPath(gpath, win.CombineModeExclude).fillRect(brush, 0, 0,
vfmt.Width, vfmt.Height) # clip frames
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))
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