Professional Documents
Culture Documents
DETENTION SYSTEM
[A CASE STUDY OF FIRST BANK NIGERIA PLC.]
BY
PAPER PRESENTATION TO
FINTECH ASSOCIATION OF NIGERIA
MARCH, 2023.
1
ABSTRACT
All over the world, the most accepted payment mode is via credit card for both
online and offline payments in today’s world, it helps implement the cashless
policy for shopping at every shop across the country. It is the most convenient
method to do shopping on the internet, and also for paying utility bills etc. Hence,
increasing the risks of credit card fraud transaction. In the existing manual credit
card fraud detection business processing system, fraudulent transaction will be
detected after transaction is done. It has become very difficult to find out
fraudulent and regarding loses will be barred by issuing authorities. In this
research, the researcher has proposed to design and implement a credit card fraud
detection system developed using HTML, CSS and PHP.
2
1.1 Background of the Study
In our day-to-day life, online transactions are increased to purchase goods and
services. According to Nielsen study conducted in 2007-2008, 28 of the world’s
total population has been using internet.85 of these people has used internet to
make online shopping and the rate of making online purchasing has increased by
40 from 2005 to 2008. The most common method of payment for online purchase
is credit card. in developed countries and also in developing countries to some
extent, credit card is most acceptable payment mode for online and offline
transaction. It can give financial loses to issuing authorities. In the second method
purchasing i.e., online, these transactions generally happen on telephone or internet
and to make this kind of transaction, the user will need some important information
about a credit card (such as credit card number, validity, CVV number, name of
card holder).
In our daily lives, credit cards are used for purchasing goods and services with the
help of virtual card for online transaction or physical card for offline transaction. In
a physical-card based purchase, the cardholder presents his card physically to a
merchant for making a payment. To carry out fraudulent transactions in this kind
of purchase, an attacker has to steal the credit card. If the cardholder does not
realize the loss of card, it can lead to a substantial financial loss to the credit card
company. In online payment mode, attackers need only little information for doing
fraudulent transaction (secure code, card number, expiration date etc.). In this
purchase method, mainly transactions will be done through Internet or telephone.
To commit fraud in these types of purchases, a fraudster simply needs to know the
card details. Most of the time, the genuine cardholder is not aware that someone
else has seen or stolen his card information. The only way to detect this kind of
fraud is to analyze the spending patterns on every card and to figure out any
inconsistency with respect to the “usual” spending patterns. Fraud detection based
3
on the analysis of existing purchase data of cardholder is a promising way to
reduce the rate of successful credit card frauds. Since humans tend to exhibit
specific behaviorist profiles, every Card holder can be represented by a set of
patterns containing information about the typical purchase category, the time since
the last purchase, the amount of money spent, etc.
Deviation from such patterns is a potential threat to the system
These are the point that limit the case of this study
5
First Bank of Nigeria Limited [ First Bank], is the premier bank in West Africa
with its impart woven into the fabric of the society. The bank has been sustaining
its development-oriented society for over 128 years as the regions foremost
financial institution service provider. First Bank offers a comprehensive range of
retails and co-operative financial services through more than 800 branches and
over 19,000 Agent Banking location branches for over 46 million accounts.
As a National Icon and International player, First Bank is one of the most
enduring financial institution brands in Africa with International footprints
extending through its subsidiaries, FBN Bank [UK] limited in London and Paris.
FBN Bank in Republic of Congo, Ghana, Gambia, Guniea, Sierra Leone and
Senegal as well as representative office in Beijing
OPERATING MANAGER
CONTROLLERS
ACCOUBTANT
MARKETERS TELLERS
SECURITIES
MESSENGERS
CLEANERS
6
- Credit Card - A credit card is a thin rectangular slab of plastic issued by a
financial company, that lets cardholders borrow funds with which to pay for
goods and services.
- Fraudulent - Obtained, done by, or involving deception, especially criminal
deception.
- Verification - The process of establishing the truth, accuracy, or validity of
something.
- Consumer- A person who purchases goods and services for personal use.
- Transaction- An instance of buying or selling something.
- Purchase- Acquire (something) by paying for it; buy.
7
LITERATURE REVIEW
This chapter details the information found in the literature. It starts with a reference
to the different fraud types of credit industry. Then a discussion on the existing
techniques for detecting and preventing credit fraud is made. There is also a brief
discussion on the technologies which were used during this project. Finally, other
fraud types and crimes are discussed.
2.1 Credit Fraud
There are three main types of credit fraud in the literature. These are credit card
fraud, bankruptcy fraud and credit application fraud. A detailed explanation of
each fraud type follows.
2.1.1 Credit Card Fraud
This is the most common fraud type that occurs in credit industry. A fraudster uses
a legitimate card to undertake illegitimate transactions. The cardholder is not aware
of the fact that their card is being used without their permission. The fraudster
takes advantage of cardholder’s ignorance by undertaking as much transactions as
possible before the cardholder realizes and reports the fraud to their bank.
According to Laleh et al. (2009) credit card fraud can be committed either offline
or online. These two ways are discussed below.
Offline Credit Card Fraud
Offline fraud occurs when a fraudster steals the physical card and uses it at the
actual stores. Although offline fraud is still popular nowadays; it is less common
because there is a higher probability to fail. More precisely, the cardholders tend to
realize the loss of the physical card and report that to their bank before the
fraudster manages to undertake any illegitimate transactions with it. As soon as the
stolen card is reported to the bank, the latter will lock the card so as it cannot be
8
used anymore. It is particularly useful to notice that if the cardholder does not
realize the loss of their card, a significant financial loss can occur. As mentioned in
the introduction chapter, the policies of some banks enforce cardholders to pay for
the losses which occur due to an unreported credit card theft. Notice that most of
the UK banks tend to send the newly created cards via the post office. This is
extremely dangerous because the cards may be stolen while they are on the way to
cardholder’s destination address.
Skimming
Patidar et al. (2011) define skimming as the “process where the actual data on a
card’s magnetic stripe is electronically copied onto another”. Fraudsters use
special-purpose devices – also known as skimmers – to capture the information of
credit cards that are encapsulated inside their magnetic stripes. They can use the
stolen card information to create counterfeit physical cards in order to use them at
actual shops or simply supply the card information at online shops. Skimming can
9
be committed by an unfaithful employee, who may swipe customer’s card using
the skimmer device, while the customer is at the point of sale. In the past, skimmer
devices have also been introduced on ATM cash machines. In addition to that,
micro-cameras have been used to record the PIN code of a cardholder during ATM
transactions.
Site Cloning
Fraudsters clone a legitimate website to deceive customers into placing an order
with them. Since the fraudulent website seems identical to the legitimate one, the
unsuspecting customers provide their credit card information to complete their
order. Consequently, fraudsters who obtained the customer’s credit card
information can commit credit card fraud whenever they wish to.
False Merchant Sites According to Patidar et al. (2011) there are various websites
that ask for credit card information in order to confirm customer’s age. These
websites will never charge the credit cards directly but they may sell their
information to fraudsters who will commit credit card fraud.
Phishing
Refers to the spam emails that are sent by fraudsters in order to deceive their
victims and obtain their personal information. Fraudsters can impersonate a service
provider or institute that victims collaborate with. In their email, fraudsters can
make use of a convincing excuse to ask for victim’s personal information including
10
credit card details. The spam emails may also include links to fraudulent websites
which again can deceive victims into revealing their personal information. Taking
into account the enormous amount of spam emails that we receive at a daily basis,
anyone can conclude that this type of fraud is still popular nowadays; although it
has been out for many years.
11
2.1.3 Credit Application Fraud
Credit application fraud occurs when a fraudster applies for a credit card using
false information. The credit application fraud is associated with another serious
fraud, the identity fraud.
Identity Fraud Identity fraud occurs when a fraudster uses a false identity with
intension to commit another fraud. Identity fraud can be perpetrated by inventing
an identity which does not belong to a real person or by stealing the actual identity
of a real person – also known as identity theft. Inventing an identity is easy
because there is no need for fraudsters to look for valid information of a real
person. Nevertheless, this type of identity fraud is very difficult to succeed
nowadays because financial institutions tend to check whether the applicant’s
information corresponds to a physical person or not.
13
Artificial Neural Networks (ANNs)
An artificial neural network imitates the way that human brain works. It consists of
a number of nodes – which are called neurons – and edges which interconnect
those neurons. Neurons are computational units which process some input
information and produce some output. The output of one neuron is passed as input
to another. A neuron of human brain is activated if and only if the received signal
is sufficiently strong. Likewise an artificial neuron receives not only some input
signals but also a weight which determines whether the input signals are
sufficiently strong or not. If the signals are strong enough, an activation function
will start executing to produce the output.
16
3.1 Research Methodology
In the existing credit card fraud detection business processing system, fraudulent
transaction will be detected after transaction is done. It is difficult to find out
fraudulent and regarding loses will be barred by issuing authorities. Hidden
Markov Model is the statistical tools for engineer and scientists to solve various
problems. In this paper, it is shown that credit card fraud can be detected using
Hidden Markov Model during transactions. Hidden Markov Model helps to obtain
a high fraud coverage combined with a low false alarm rate.
There are two main sources of data collection in carrying out this study,
information was basically obtained from the two sources which are:
(a) Primary source and
(b) Secondary source
17
The need for the secondary sources of data for this kind of project cannot be
over emphasized. The secondary data were obtained by me from magazines,
Journal, newspapers, library source and most of the information from the library
research has been covered in my literature review in the previous chapter of this
project.
3.2.3 Application
The detection of the fraud use of the card is found much faster than the
existing system.
The Transactions of the account holder never stopped as this system allows
the user to use the virtual card Using the virtual ID and password, until he
gets the new card.
The user can easily block the card by him when he finds that the card is
being stolen.
In this system we have used the ONE TIME PASSWORD for the security to
get the virtual ID and Password securely.
We can find the most accurate detection using this technique.
18
3.3 System Investigation
The system investigation is the transaction limit and card information Form. It
contains detail information of the cards. This form shows the input to the system
and what it contains:
Update
Withdraw
19
financial institutions have developed sophisticated fraud detection systems that use
machine learning algorithms and other techniques to identify and prevent fraud.
System Architecture: The credit/debit fraud detection system consists of several
components that work together to detect and prevent fraud. These components
include:
1. Data Collection: This component collects data from various sources such as
bank transactions, point-of-sale systems, and online purchases. The data is
collected in real-time to detect fraudulent activity as soon as possible.
2. Data Processing: This component processes the collected data using various
algorithms and techniques to identify patterns and anomalies that may indicate
fraudulent activity. The processing includes data cleaning, feature engineering, and
modeling.
3. Machine Learning Models: These models use various algorithms such as
logistic regression, decision trees, and neural networks to analyze the processed
data and predict whether a transaction is fraudulent or not.
4. Rules Engine: This component applies predefined rules to the transaction data
to identify suspicious activity. For example, if a transaction is made from a
location that is far from the cardholder's usual location, the system may flag it as
suspicious.
5. Alert Generation: When the system detects a fraudulent transaction, it generates
an alert that is sent to the bank's fraud department. The alert includes details about
the suspicious transaction, such as the transaction amount, location, and time.
6. Fraud Investigation: The fraud department reviews the alerts generated by the
system and investigates the suspicious transactions. If the transaction is confirmed
to be fraudulent, the bank may block the card and initiate a chargeback.
System Performance: The performance of the credit/debit fraud detection system is
measured by its accuracy, precision, and recall. The accuracy measures how often
the system correctly identifies fraudulent transactions. The precision measures how
often the system flags a transaction as fraudulent when it is actually fraudulent.
The recall measures how often the system flags a fraudulent transaction when it is
present in the data.
To improve the performance of the system, financial institutions continuously
collect and analyze data to identify new patterns and trends in fraudulent activity.
20
They also update the machine learning models and rules engine to improve their
accuracy and reduce false positives.
Conclusion: The credit/debit fraud detection system is a critical component of
financial institutions' efforts to combat fraud. By collecting and analyzing
transaction data in real-time, the system can identify and prevent fraudulent
activity before it causes significant financial harm. However, the system is not
foolproof, and fraudsters are continually developing new tactics to evade detection.
Therefore, financial institutions must continuously update and improve their fraud
detection systems to stay one step ahead of the fraudsters.
21
make it more difficult to detect fraudulent activity that occurs outside of traditional
banking channels.
5. Complex and Expensive: Developing and maintaining a fraud detection system
can be complex and expensive. Financial institutions may need to invest significant
resources in data infrastructure, machine learning algorithms, and skilled personnel
to design and operate a robust fraud detection system.
In conclusion, while credit/debit fraud detection systems have come a long way in
recent years, they still face several challenges that need to be addressed. Financial
institutions need to continuously improve their systems to stay ahead of fraudsters
and provide better protection to their customers.
Of course, the exact step and components of a credit/ debit fraud detection
system will vary depending on the specific system and the organization using it,
but an information flow chart can help provide a clear overview of how data
and information move through the system which can be useful for
22
understanding the systems over all functionality and identifying areas for
improvement.
Classification Adaptive
Credit card Identify Machine Evaluation Comparative
Supervised
23
4.1 System Design
The design of a credit/ debit fraud detection system involves different steps and
component. Here is a high level over view of the system design;
1. Data Collection; The system needs to collect data from various sources
such as transaction history, User profiles, behavior pattern, etc.
2. Data Processing; The collected data needs to be cleaned. transformed and
processed to remove any inconsistences or errors.
3. Feature Extraction; Relevant features such as time, location, transaction
amount and user behavior needs to be extracted from the preprocessed data
4. Model Department; Various machines learning algorithms such as logistics
regression, decision tree, and random forest are used to develop model
based on historical data
5. Model Evaluation; The developed model need to be tested and evaluated
based on accuracy, precision, recall, and f1 score
6. Threshold Setting; Appropriate thresholds need to be set to determine the
likelihood of fraud based on the output of the model.
7. User Notification; Based on the determined likelihood of fraud, appropriate
actions need to be taken to notify users or fraud prevention team.
The system needs to be continuously updated and improved based on new data and
trends to increase its accuracy and effectiveness in detecting and preventing credit/
debit fraud
24
4.2 Scope of Design
1. Data Collection; Collect and store data related transaction, account number
information, and other relevant data points.
2. Machine Learning and Artificial Intelligence; Use machine learning
algorithms and artificial intelligence to analyze data patterns, identify fraud
patterns and improve the systems ability to detect fraud
3. Real-Time Alerts; Set up real-time alerts, so that any fraudulent activity can
be detected and prevented from being processed.
4. Fraud Detection Rules; Establish rules and procedures to detect and prevent
credit card from fraudulent transactions.
5. Security Measures; Ensure that the system is secured and sensitive account
information is protected from unauthorized access.
6. Reporting; Provide clear and concise reporting of fraudulent activity to
relevant stakeholders such as financial institutions. Merchants and
customers.
The input design of a credit/debit fraud detection system will depend on the
specific requirement of the system, but generally, it would involve collecting
various types of information related to a cardholder’s account activity including
25
transaction history, purchased amounts, locations and overall spending patterns.
This data can then be analyzed using machine learning algorithms and other
advanced techniques
The output design of such a system will typically involve generating alerts or
notifications whenever potentially fraudulent transactions are identified. This could
include notifying the cardholder themselves or flagging the transaction for review
by a fraud detection team, who can then take appropriate action to investigate and
address any suspicious activity
Overall, the system should be designed with security and scalability in mind, as it
will likely need to process large volume of data and quickly adapt to new types of
fraud over time.
The system requirement for a credit/debit fraud detection system may vary
depending on the specific needs of the organization or business, some general
system requirements for this type of system could include;
26
1. Data Collection and Management; The system should be able to collect and
analyze data from various sources such as credit/debit card transaction,
online shopping patterns and customer behavior.
2. Machine Learning and Data Analytics; The system would have machine
learning algorithms and data analytics tools to detect patterns and identify
potential fraudulent activities in customers data.
3. Real-Time Alert System; The system should be ale to detect fraud in real-
time and send alerts to appropriate parties such as customers, banks and
regulatory authorities
4. Integration with Exiting System; The system should be able to integrate with
existing banking and financial systems such as payments gateways,
scorecards and loan management system.
5. Security Features; The system should have strong security features such as
encrypt[on and access controls to ensure customer privacy and prevent
unauthorized access.
6. Scalability; The system should be scalable to handle large volumes of data
and growing customer bases.
7. Regulatory Compliance; The system should comply with relevant laws and
regulations related to privacy, data protection and fraud detection.
27
1. Collect Data; First, you need to collect data on credit/debit card transactions.
This data may include the transactions amount, time of the transaction,
location of the transaction and other relevant details
2. Preprocessed and Clean Data; Next, you need to preprocess the data and
clean it, removing any any irrelevant or duplicated data points. This is an
important step to ensure that the data is accurate and can be used for
analysis.
3. Feature Extraction; In this step, you extract features [transaction frequency,
transaction amount, location, etc.] from each transaction.
4. Apply Machine Learning Algorithms; Once the features have been
extracted, you can app[y various machine learning algorithms such as
decision trees, random forests, or neutral networks to detect fraudulent
transactions,
5. Train and Validate the Model; After selecting an appropriate algorithms; you
need to train and retrain the model for improved accuracy.
6. Integration; Once the model is refined, it can be deployed as part of a
credit/debit card payment infrastructure, where it can continuously monitor
transactions and flag any suspicious activity.
28
1. Data Collection; Collection data from various payment system including
card issues, card network and merchants.
2. Data Preprocessing; Preprocessing the data by cleaning, transforming the
data by integrating it in a usable format.
3. Feature Extraction; Extracting relevant features from the preprocessed data
set, which could include transaction amounts, transaction frequency,
geographical location, timing and more.
4. Model Selection; Selecting appropriate machine learning, deep learning or
statistical model to analyze the data and identify potential fraudulent
transactions.
5. Model Training; Training the selected model using labeled data, which
contains information on whether a transaction is fraudulent or not.
6. Fraud Investigation; Once a transaction has been flagged as potential
fraudulent, the system will initiate an investigation which may include
additional verification steps and alert the relevant authorizes.
In conclusion, the program design of a credit/debit fraud detection system involves
a complex combination of data collection, cleansing, analysis and monitoring
which requires a large level of technical expertise and a thorough understanding of
fraud detection system and prevention.
29
Log
Credit card
transaction
Check account
balance
View statement
of account
Change credit
card pin
Log out
31
8. Performance Metrics; This section provides details on the system
performance metrics, such as detection rate, false positive rate and false
negative rate.
9. Deployment and Maintenance; This section explains how the system is
deployed and maintained, including software updates, version control and
monitoring.
10. Conclusion; This section summarizes the key takeaway and highlights the
benefit of using a credit/debit fraud detection system.
32
4.10 Training Staff
The training staff of a credit/debit fraud detection system typically consists of
experienced fraud analyst, who have knowledge and expertise in identifying
and preventing fraudulent activity.
These staff members are responsible for training new members of the team on
the systems detection methods, fraud patterns and the latest techniques used
by fraudsters. They may also provide ongoing training to the entire team on
new fraud trends, system updates, and emerging technologies to ensure that
the team stays current and effective in their roles. The training staff plays a
critical role in the success of the fraud detection by ensuring that the team has
the knowledge and skill required to quickly and accurately identify and
prevent fraud. The staff that will be responsible for operating and maintaining
the system will need to receive adequate training.
33
3. Parallel Operation; During this stage, the new fraud detection system
is run alongside the old system to ensure its accuracy and efficiency.
4. Implementation; Once the new system have been tested and refined,
the implementation phase involves switching over to the new system.
This may involve a phased approach where different segments of the
system are brought online at different times.
5. Follow-up and Maintenance; After the changeover has been
completed, the new system must be monitored to ensure that it is
running properly and to make any necessary notification and updates.
This is an ongoing process that ensures the system remains effective in
detecting and preventing fraudulent transactions.
4.12 Documentation
The documentation of a credit/debit fraud detection system typically includes the
following;
1. Functional Requirement; This document descries the systems functions and
features, including how the system will detect fraud, what data it needs and
how it will be used.
2. Technical Requirement Document; This document descries the technical
infrastructure required to support the fraud detection system, including
software, hardware and network components.
3. Operational Procedure Document; This document outlines the procedures
for operating the fraud detection system, including how to monitor it for
potential fraud and how to respond to detected fraud.
4. User Manuals; This provides information on how to use the system,
including step-by-step instructions for performing specific tasks.
34
5. Testing and Validation Documentation; This includes the test plan, scripts
and test reports used to validate the system’s performance and functionality.
6. Maintaining and Support Document; This includes instructions on how to
maintain and support the system, including troubleshooting guides and
contact information for technical support.
35
5.1 Summary
In summary, this Academic Work project has done a great deal of giving a broad
knowledge of what credit card fraud detection system is all about. It went as far as
highlighting the uses of credit card fraud detection system. This study shows how
to improve the security of credit/debit fraud. In summary, this work shows how to
detect and prevent credit\debit fraud.
5.2 Conclusion
From this Academic Work, I have been able to show the application of database
management system (credit card fraud detection system) and how it can be used, it
has achieved the full aim of letting the public know what computer system is all
about.
5.3 Recommendation
I hereby recommend this Academic work to be used by staff and management and
indeed any other Institution with similar structure and organizational framework
for the following reasons:
1. The academic work has been able to solve the problem related to easy access
of credit card information.
2. It has helped the user on how to login and view report, enter credit card for
detection.
36
REFERENCES
Ghosh, S., and Reilly, D.L., [1994]. Credit Card Fraud Detection with a
Neural-Network, 27th Hawaii International l Conference on Information
Systems, vol. 3 (2003), pp. 621- 630.
Syeda, M., Zhang, Y. Q., and Pan, Y. [2002] Parallel Granular Networks for Fast
Credit Card Fraud Detection, Proceedings of IEE International Conference
on Fuzzy Systems, pp. 572-577.
Stolfo, S. J., Fan, D. W., Lee, W., Prodromidis, A., and Chan, P. K., [2000]. Cost-
Based Modeling for Fraud and Intrusion Detection: Results from the JAM
Project, Proceedings of DARPA Information Survivability Conference and
Exposition, vol. 2 (2000), pp. 130-144.
Aleskerov, E., Freisleben, B., and Rao, B., [1997]. CARDWATCH: A Neural
Network Based Database Mining System for Credit Card Fraud Detection,
Proceedings of IEEE/IAFE: Computational Intelligence for Financial Eng.
(1997), pp. 220-226.
M.J. Kim and T.S. Kim, [2002]. “A Neural Classifier with Fraud Density Map for
Effective Credit Card Fraud Detection,” Proc. Int’l Conf. Intelligent Data
Eng. and Automated Learning, pp.378-383,
37
APPENDICES
APPENDIX - A
Front End
38
APPENDIX – B
39
APPENDIX - C
40
APPENDIX H
SOURCE CODE
1. Transaction.php
if(isset($_SESSION['account'])) {
// Do something if anything special you need.
}else{
header("Location: index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Credit Card Faurd Detecting System</title>
</head>
<body class="container">
<!-- Navbar included -->
<?php include 'helper/navbar.html' ?>
<!-- Config included -->
<?php include 'helper/config.php' ?>
}else {
// show error message (when maximum
limit)
echo '<p class="error-message">Sorry!!
Maximum limit reached. Try Again!!</p>';
}
}else {
// show error message (When insufficient funds)
echo '<p class="error-message">Not Enough
Fund!!</p>';
}
42
}
?>
</div>
$blocked_last_row = $conn->query($blocked_sql);
if($blocked_last_row->num_rows> 0) {
$blocked_row = $blocked_last_row->fetch_row();
$blocked_timestamp = $blocked_row[2];
$blocked_branch_name = $blocked_row[4];
// Show Warning
echo '<p class="warning-message">You account
was tryng to access from <strong>'.$blocked_branch_name.'</strong> at <strong>'.
$blocked_timestamp.'</strong></p>';
}
$ac_number = $_SESSION['account'];
$account_id = $_SESSION['account_id'];
if($result->num_rows == 1) {
$row = $result->fetch_row();
echo '
43
<div class="col-sm-12 col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3>Transaction</h3>
</div>
<div class="panel-body">
<form method="POST"
action="" class="form-group">
<p>Available
Balance: '.$row[4].'</p>
<label>Enter
Amount</label>
<input
type="number" name="amount" class="form-control" required/>
<input
type="hidden" name="total_balance" value="'.$row[4].'"/>
<input
type="hidden" name="trans_limit" value="'.$row[5].'"/>
<input
type="hidden" name="id" value="'.$row[0].'"/>
<br/>
<input
class="btnbtn-primary btn-block" type="submit" name="submit"
value="Withdraw"/>
</form>
</div>
</div>
</div>
';
}
}
?>
<!-- The clock / time limit will be here -->
<div class="col-sm-12 col-md-4 jumbotron pull-right m-r-15">
<h2 class="alert-message-color">You are running out of
time.</h2>
<div id="s_timer"></div>
<p class="p-t-sm f-16 alert-message-color">
<strong>Note:</strong> You just have 60 seconds to
finish this transaction.
44
If you missed to finish you have re-enter your AC
number and PIN.
</p>
</div>
</div>
</body>
<footer>
<!-- All the Javascript will be load here... -->
<script type="text/javascript" src="assets/JS/jquery-3.1.1.min.js"></script>
<script type="text/javascript"
src="assets/JS/jquery.countdownTimer.min.js"></script>
<script type="text/javascript" src="assets/JS/main.js"></script>
<script type="text/javascript" src="assets/JS/timer.js"></script>
<script type="text/javascript" src="assets/BS/js/bootstrap.min.js"></script>
</footer>
</html>
2. Settings.php
<?php
include 'helper/config.php';
session_start();
if (isset($_SESSION['username'])) {
// logged in
// Something will happen here....
} else {
// not logged in
header('Location: login.php');
}
?>
45
<input type="password" id="inputPassword" name="password" class="form-
control" placeholder="Password" required>
<button class="btnbtn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</body>
<footer>
<!-- All the Javascript will be load here... -->
<script type="text/javascript" src="assets/JS/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="assets/JS/main.js"></script>
<script type="text/javascript" src="assets/BS/js/bootstrap.min.js"></script>
</footer>
</html>
3. Index.php
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Credit Card Faurd Detecting System</title>
4. History.php
<?php
include 'helper/config.php';
session_start();
if (isset($_SESSION['username'])) {
// logged in
// Something will happen here....
} else {
// not logged in
header('Location: login.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>History | Credit Card</title>
$transaction_data = $conn->query($sql);
if($transaction_data->num_rows> 0) {
echo '
<thead>
<tr>
<th>User Name</th>
<th>Branch Name</th>
<th>Amount</th>
<th>Transaction Date & Time</th>
</tr>
</thead>
';
while($row = $transaction_data->fetch_assoc()){
echo '
48
<tbody>
<tr>
<td>'.$row["user_name"].'</td>
<td>'.$row["branch_name"].'</td>
<td>'.$row["amount"].'</td>
<td>'.$row["created_at"].'</td>
</tr>
</tbody>
';
}
}else{
echo '<p class="text-center">No data to show</p>';
}
?>
</table>
</div>
</div>
</div>
</div>
$blocking_history = $conn->query($sql);
if($blocking_history->num_rows> 0) {
echo '
<thead>
<tr>
<th>Branch Name</th>
<th>Account User Name</th>
<th>Date & Time</th>
</tr>
</thead>
';
while($row = $blocking_history->fetch_assoc()){
echo '
<tbody>
<tr>
<td>'.$row["branch_name"].'</td>
<td>'.$row["user_name"].'</td>
<td>'.$row["created_at"].'</td>
</tr>
</tbody>
';
}
}else{
echo '<p class="text-center">No data to show</p>';
}
?>
</table>
50
</div>
</div>
</div>
</div>
</body>
<footer>
<!-- All the Javascript will be load here... -->
<script type="text/javascript" src="assets/JS/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="assets/JS/main.js"></script>
<script type="text/javascript" src="assets/BS/js/bootstrap.min.js"></script>
</footer>
</html>
5. Dashboard.php
<!-- After submiting the form -->
<?php
// Initialize the session
session_start();
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$card_number = $_POST['card_number'];
$pin = $_POST['pin'];
$branch_id = $_POST['branch_id'];
// Get all the the pins with card number then I'll match with inputed
data
$query = "SELECT * FROM credit_card";
$credit_cards = $conn->query($query);
if ($credit_cards->num_rows> 0) {
// Declare some helper arrays
$card_number_array = array();
while($row = $credit_cards->fetch_assoc()) {
array_push($card_number_array, $row["ac_number"]);
}
}
$matched = False;
// Match with the inputed data
for($i=0; $i<count($card_number_array); $i++){
if($card_number == $card_number_array[$i]){
51
$matched = True;
break;
}
}
// After matching
if($matched) {
// Again call db for specific response
$card_data_sql = "SELECT * FROM credit_card WHERE
ac_number=".$card_number." AND pin=".$pin;
$card_data = $conn->query($card_data_sql);
if($card_data->num_rows == 0){
echo '<p class="error-message">You are not authorised!!
</p>';
}
if($card_data->num_rows == 1){
$row = $card_data->fetch_row();
$allowed_branches = $row[1];
$ac_status = $row[5];
if($ac_status == 1){
if(strpos($allowed_branches, $branch_id)) {
// set AC num and pin to session
$_SESSION['account'] = $card_number;
$_SESSION['account_id'] = $row[4];
$_SESSION['branch_pk'] = $branch_id;
header("Location: transaction.php");
}else {
echo '<p class="error-message">SORRY!
This Branch is not Allowed!!</p>';
// Account will be locked now.
/*
0 = Block
1 = Active
*/
$update_block_sql = "UPDATE credit_card
SET status=0 WHERE ac_number=".$card_number;
$updated_block_status = $conn-
>query($update_block_sql);
52
if($updated_block_status) {
echo '<p class="error-
message">Account will be blocked!!</p>';
$block_history_sql = "INSERT INTO
block_history (account_id, branch_id) VALUES(".$row[4].", ".$branch_id.")";
$conn->query($block_history_sql);
}
}
}else {
echo '<p class="error-message">Your account has
blocked!!</p>';
}
}else {
echo '<p class="error-message">You are not authorised!!</p>';
}
}
?>
<div class="row">
<h2 class="text-center">Dashboard</h2>
<p class="text-center">Authorized Card Number: 5531886652142950, Pin
code: 3310</p>
<p class="text-center">Login Email: tester@gmail.com, Password:
12345</p>
<?php
// Get branches data from database
$sql = "SELECT * FROM branch";
$result = $conn->query($sql);
if ($result->num_rows> 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$name = $row["name"];
echo '
53
<div class="col-xs-6 col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3>'.$name.' Branch</h3>
</div>
<div class="panel-body">
<form method="POST" action=""
class="form-group">
<label>Your Card
Number</label>
<input type="text"
name="card_number" class="form-control" required/>
<br/>
<label>Your PIN</label>
<input type="password"
name="pin" class="form-control" required/>
<input type="hidden"
name="branch_id" value="'.$row["id"].'"/>
<br/>
<input class="btnbtn-success
btn-block" type="submit" name="submit" value="Withdraw"/>
</form>
</div>
</div>
</div>
';
}
} else {
echo "0 results";
}
// $conn->close();
?>
</div>
54