You are on page 1of 39

VITCOIN MANAGEMENT SYSTEM

A PROJECT REPORT

Submitted for the course: Software Engineering: Principles And Practices


(ITE1005)

By

ANIRBAN MUKHERJEE 16BIT0200


VISHIST VARUGEESE 16BIT0242
ABISHEK SREEDHER 16BIT0446

Under the guidance of Prof. GITANJALI J

(School of Information Technology and Engineering)

November, 2017

1
ACKNOWLEDGEMENTS

We sincerely thank Dr. G. Viswanathan Chancellor, VIT University, for


creating an opportunity to use the facilities available at VIT. We also thank
Prof. GITANJALI J. Department of Information Technology, VIT University,
for giving us the opportunity to do this project, as well as the Dean and the
entire department of School of Information Technology and Engineering, for
giving us this wonderful opportunity.

2
DECLARATION OF THE CANDIDATE

We hereby declare that the project report entitled VITCOIN MANAGEMENT


SYSTEM submitted by us to VIT University Department of Information
Technology, in partial fulfillment of the requirement for the award of the degree
of B.Tech (Information Technology) is a record of J component of project
work carried out by me under the guidance of Prof. Gitanjali J. We further
declare that the work reported in this project has not been submitted and will not
be submitted, either in part or in full, for the award of any other degree or
diploma in this institute or any other institute or university.

Place: Vellore

Date: 7th November, 2017

Anirban Mukherjee

Vishist Varugeese

Abishek Sreedher

3
CERTIFICATE

This is to certify that the project work titled Vitcoin Management System that
is being submitted by Anirban Mukherjee 16bit0200, Vishist Varugeese
16bit0242, Abishek Sreedher 16bit0446 for Software Engineering
(ITE10005) is a record of bonafide work done under my supervision. The
contents of this Project work, in full or in parts, have neither been taken from
any other source nor have been submitted for any other CAL course.

Signature of the Students

Anirban Mukherjee

Vishist Varugeese

Abishek Sreedher

Signature of the Faculty

Gitanjali J

4
TABLE OF CONTENTS

S NO CONTENTS PAGE NO

1 TITLE
INTRODUCTION 6
OBJECTIVE 7
2 PROBLEM STATEMENT
PROBLEM STATEMENT 8
3 DESIGN AND ARCHITECTURE
ARCHITECTURE 9
USE CASE DIAGRAM 10
CLASS DIAGRAM 11
SEQUENCE DESIGN 12
SYSTEM FLOW CHART 13
TIMELINE CHART 14
ER DIAGRAM 15
SYSTEM INTERFACE DESIGN 16
4 SOFTWARE PROCESS MODEL
SOFTWARE PROCESS MODEL 18
5 IMPLEMENTATION OF THE MODULES
LOGIN PAGE 21
REGISTRATION PAGE 23
PAYMENT PAGE 26
ADDING MONEY TO WALLET 30
TRANSACTION HISTORY 32
DATABASE 34
6 TEST CASES
TEST CASES 37
7 CONCLUSION AND FUTURE WORK
CONCLUSION 38
FUTURE WORK 38
8 REFERENCES 39

5
TITLE: VITCOIN MANAGEMENT SYSTEM

INTRODUCTION

In the ongoing internet boom across the world and the mission of Digital India
to simplify every aspect of life, why should we VITians stay behind? All of us
have experienced that whenever we want to buy/pay for something, we either
don't have the money, or we have too much money, i.e. the shopkeepers have no
change to pay us back!
The project uses evolutionary model, more specifically throwaway prototyping
for the development work. It involves the use of programming languages like
JavaScript, HTML, CSS for the front-end i.e. for developing the website and
PHP and SQL for back-end to ensure data gets stored and retrieved from the
database. It then uses XAMMP for compiling and running the complete project.

6
OBJECTIVE

This project aims to develop a fully functional website that will cater the needs
of tech-savvy VITians which will enable the user to pay for every service
available in VIT minus the hassle of buying goods offline with a comfortable
User Interface with a secure database and a proper transaction history that will
make life much more easier, benefitting both the buyers and the sellers.
.

7
1) PROBLEM STATEMENT

.
As we saw in Demonitization, the cash crunch meant you either have to
pay with card or PayTM only. This project therefore looks to create an
online wallet for VITians where one can buy and pay stuff online without
any worry of cash transactions.
Inclusion of all payable services in VIT with an attractive UI which
appeals to VITians and make a significant contribution towards Digital
India.
A secure database for users, products and transactions as well as
transaction receipts for the web application to avoid unwanted situations.

8
DESIGN AND ARCHITECTURE

ARCHITECTURE

A Web Application architecture can vary greatly depending on the application at hand its
needs, its behavior and of course, the means at hand. That are a lot of layers you can stack up
when building a web application, some are "mandatory" like front-end and back-end, we
have be to able to see and interact with something, for this reason front-end is vital. Also a
good working back-end is required to maintain database of users and transactions.

Front-end / Client Side:

The top most visible layer is whats called the Front-end. It is usually written in HTML and
CSS for styling and JavaScript for interactivity and function. The data from this layer has to
make it to the user's browser which then turns all the code into something beautiful and
interactive.

Back-end/ Server Side:

The "Backend" is where we usually use a programming language (unlike HTML & CSS
which are markup languages) such as PHP, Python, Ruby , Java, SQL
Database

In order for most web application to function, we need to be able to store data somewhere.
That somewhere is usually a database of some sort. Some big name brands and household
names are MySQL, PostgreSQL, Oracle, CouchDB, Redis,HBase and the list is pretty
endless.
Each one saves data in a different manner and gives different features. Some save tabled data
(relational databases) while other saved "paged" data, or even simple key-value pairs.
It really depends on what we need to save and how we need to save.

9
USE CASE DIAGRAM

A use case diagram at its simplest is a representation of a user'sinteraction with the system
that shows the relationship between the user and the different use cases in which the user is
involved.

USE CASE DIAGRAM FOR PAYMENT OF SERVICE

10
CLASS DIAGRAM

In software engineering, a class diagram in the Unified Modeling Language (UML) is a type
of static structure diagram that describes the structure of a system by showing the system's
classes, their attributes, operations (or methods), and the relationships among objects.

UML Diagram for VITCoin Transactions

11
SEQUENCE DIAGRAM

A sequence diagram is an interaction diagram that shows how objects operate


with one another and in what order. It is a construct of a message sequence
chart.

Sequence Diagram for Payment through VITCoin

12
SYSTEM FLOW CHART

System flowcharts are a way of displaying how data flows in a system and how decisions are
made to control events. To illustrate this, symbols are used. They are connected together to
show what happens to data and where it goes. The basic ones include: Symbols used in flow
charts.

System flowchart for transaction in VITCoin

13
TIMELINE CHART

Timeline charts are User Items that create a chart where a series of events are arranged on a
bar graph. Each event can be a single point in time or a date range.

We used Gantt chart for developing our project

Gantt Chart for VITCoin Management System

14
ER DIAGRAM

An entity-relationship diagram (ERD) is a data modeling technique that graphically illustrates


an information system's entities and the relationships between those entities. An ERD is a
conceptual and representational model of data used to represent the entity framework
infrastructure.

ER Diagram of VITCoin Management System

15
SYSTEM INTERFACE DESIGN

Landing Page

16
Payment Page

Add Money to VITCoin Page

17
2) SOFTWARE PROCESS MODEL

We chose Evolutionary Model for our project since:

Users get a chance to experiment with a partially developed system: much


before the full working version is released.

Helps finding exact user requirements: much before fully working system is
developed.

Core modules get tested thoroughly: reduces chances of errors in final


product.

Lower risk. Suitable for small to medium sized system.

We have specifically used Throwaway Prototyping where the objective is to understand the
system requirements. We start with poorly understood requirements to clarify what is really
needed and then implement them into the project.

18
Requirements:

For making front-end we will be using HTML with CSS. For developing back-end we will be
using MySQL which we connect through PHP and we compile using XAMMP.

Design:

We are creating a web-application for our VITCoin Management System. In this web
application we can pay for the services in VIT such as cab fares, library fines as well buy
items such as books, food etc. from the shops present in VIT.

Implementation:

In the process of implementation we look into the steps to make our web-application. It
involved activities such as analysis, generating necessary algorithms, verification of the
requirements of algorithms including their correctness and resource consumption and
implementation of algorithms in a target programming language. The source code is then
written in PHP. The purpose of programming is to find a sequence of instructions that will
automate performing a specific task or solving a given problem. The process of programming
thus often requires expertise in many different subjects, including knowledge of the
application domain, specialized algorithms, and formal logic.

Testing:

Software testing involves the execution of a software component or system component to


evaluate one or more properties of interest. In general, these properties indicate the extent to
which the component or system under test:-

a) Meets the requirements that guided its design and development.


b) Responds correctly to all kinds of inputs,
Performs its functions within an acceptable time, is sufficiently usable

19
c) Can be installed and run in its intended environments, and achieves the general result
its stakeholders desire.

Maintenance:

Software maintenance in software engineering is the modification of a software product after


delivery to correct faults, to improve performance or other attributes .A common perception
of maintenance is that it merely involves fixing defects. However, one study indicated that
over 80% of maintenance effort is used for non-corrective actions. This perception is
perpetuated by users submitting problem reports that in reality are functionality
enhancements to the system. More recent studies put the bug-fixing proportion closer to 21%.

20
3) IMPLEMENTATION OF THE MODULES

Login Page

login.php
<?php

//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}


if(session_id() == '' || !isset($_SESSION)){session_start();}

if(isset($_SESSION["username"])){

header("location:index.php");
}
include 'config.php';

?>

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"
/>
<title>Login</title>
<link rel="stylesheet" href="css/foundation.css" />
<style type="text/css">
input[type=email], input[type=password]{
width: 70%;
padding: 12px 20px 8px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=submit],input[type=reset] {
width: 20%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}

input[type=submit]:hover,input[type=reset]:hover {
background-color: #45a049;
}
div {
text-align: center;
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}

21
</style>
<script src="js/vendor/modernizr.js"></script>
</head>
<body>

<nav class="top-bar" data-topbar role="navigation">


<ul class="title-area">
<li class="name">
<?php
if(isset($_SESSION['username'])) {
$user = $_SESSION["username"];
$result = $mysqli->query("SELECT wallet from users where
email='".$user."'");
if($result){
$obj = $result->fetch_object();
echo '<h1 style="color: white; margin-left: 20px;">Wallet:
'.$obj->wallet.'<img src="images/coi1ns.png"
style="width:40px;height:40px;"></h1>';
}
}
else
echo '<h1><a href="index.php">VITCoins</a></h1>';
?>
</li>
<li class="toggle-topbar menu-icon"><a
href="#"><span></span></a></li>
</ul>

<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li><a href="about.php">About</a></li>
<?php
if(isset($_SESSION['username'])){
echo '<li><a href="products.php">Pay</a></li>';
echo '<li><a href="addmoney.php">Add VITCoins</a></li>';
echo '<li><a href="orders.php">My Orders</a></li>';
}
?>
<li><a href="contact.php">Contact</a></li>
<?php

if(isset($_SESSION['username'])){
echo '<li><a href="account.php">My Account</a></li>';
echo '<li><a href="logout.php">Log Out</a></li>';
}
else{
echo '<li class="active"><a href="login.php">Log In</a></li>';
echo '<li><a href="register.php">Register</a></li>';
}
?>
</ul>
</section>
</nav>

<div class="row" style="margin-top:10px;">


<div class="small-12">
<div>
<form method="POST" action="verify.php">
<label style="text-align: left; margin:0 135px; font-weight:
bolder;" for="left-label">Email</label>

22
<input type="email" id="right-label" placeholder=""
name="username">

<label style="text-align: left; margin:0 135px; font-weight:


bolder;" for="left-label">Password</label>
<input type="password" id="right-label" placeholder=""
name="pwd"><br>

<input type="submit" id="right-label" value="Login">

<input type="reset" id="right-label" value="Reset"


style="background-color: red;"><br>
<a href="resetpassword.php">Forgot password?</a>
</form>
</div>
</div>
</div>

<div class="row" style="margin-top:10px;">


<div class="small-12">

<footer>
<p style="text-align:center; font-size:0.8em;">&copy; VITCoins!
All Rights Reserved.</p>
</footer>
</div>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>

Registration Page
registration.php
<?php

//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}


if(session_id() == '' || !isset($_SESSION)){session_start();}

if (isset($_SESSION["username"])) {header ("location:index.php");}


?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"
/>
<title>Register</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<body>

<nav class="top-bar" data-topbar role="navigation">

23
<ul class="title-area">
<li class="name">

</li>
<li class="toggle-topbar menu-icon"><a
href="#"><span></span></a></li>
</ul>

<section class="top-bar-section">
<!-- Right Nav Section -->

<ul class="right">
<li><a href="about.php">About</a></li>
<?php
if(isset($_SESSION['username'])){
echo '<li><a href="products.php">Pay</a></li>';
echo '<li><a href="cart.php">View Cart</a></li>';
echo '<li><a href="orders.php">My Orders</a></li>';
}
?>
<li><a href="contact.php">Contact</a></li>
<?php

if(isset($_SESSION['username'])){
echo '<li><a href="account.php">My Account</a></li>';
echo '<li><a href="logout.php">Log Out</a></li>';
}
else{
echo '<li><a href="login.php">Log In</a></li>';
echo '<li class="active"><a
href="register.php">Register</a></li>';
}
?>
</ul>
</section>
</nav>

<form method="POST" action="insert.php" style="margin-top:30px;">


<div class="row">
<div class="small-8">

<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">First
Name</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" placeholder="Enter first
name" name="fname">
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Last
Name</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" placeholder="Enter last
name" name="lname">
</div>
</div>

24
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Address</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" placeholder="Enter
address" name="address">
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">City</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" placeholder="Enter city"
name="city">
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Pin
Code</label>
</div>
<div class="small-8 columns">
<input type="number" id="right-label" placeholder="Enter
pincode" name="pin">
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">E-Mail</label>
</div>
<div class="small-8 columns">
<input type="email" id="right-label" placeholder="Enter email
id" name="email">
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right
inline">Password</label>
</div>
<div class="small-8 columns">
<input type="password" id="right-label" placeholder="Enter
password" name="pwd">
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Security
question: What is your VIT lab password? (In case you forget your
password)</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" placeholder="Enter
answer" name="answer">
</div>
</div>
<div class="row">
<div class="small-4 columns">

25
</div>
<div class="small-8 columns">
<input type="submit" id="right-label" value="Register"
style="background: #0078A0; border: none; color: #fff; font-family:
'Helvetica Neue', sans-serif; font-size: 1em; padding: 10px;">
<input type="reset" id="right-label" value="Reset"
style="background: #0078A0; border: none; color: #fff; font-family:
'Helvetica Neue', sans-serif; font-size: 1em; padding: 10px;">
<hr>
</div>
</div>
</div>
</div>
</form>

<div class="row" style="margin-top:10px;">


<div class="small-12">

<footer>
<p style="text-align:center; font-size:0.8em;">&copy; VITCoins!
All Rights Reserved.</p>
</footer>

</div>
</div>

<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>

Payment Page
products.php

<?php

//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}


if(session_id() == '' || !isset($_SESSION)){session_start();}
include 'config.php';

?>

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"
/>
<title>Pay</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
<style>
input[type=number], input[type=password], select {
width: 70%;
padding: 12px 20px 8px;

26
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}

input[type=submit] {
width: 70%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}

input[type=submit]:hover {
background-color: #45a049;
}

div {
text-align: center;
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
</style>
</head>
<body>

<nav class="top-bar" data-topbar role="navigation">


<ul class="title-area">
<li class="name">
<?php
if(isset($_SESSION['username'])) {
$user = $_SESSION["username"];
$result = $mysqli->query("SELECT wallet from users where
email='".$user."'");
if($result){
$obj = $result->fetch_object();
echo '<h1 style="color: white; margin-left: 20px;">Wallet:
'.$obj->wallet.'<img src="images/coi1ns.png"
style="width:40px;height:40px;"></h1>';
}
}
?>
</li>
<li class="toggle-topbar menu-icon"><a
href="#"><span></span></a></li>
</ul>

<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li><a href="about.php">About</a></li>
<li class='active'><a href="products.php">Pay</a></li>
<li><a href="addmoney.php">Add VITCoins</a></li>
<li><a href="orders.php">My Orders</a></li>
<li><a href="contact.php">Contact</a></li>

27
<?php

if(isset($_SESSION['username'])){
echo '<li><a href="account.php">My Account</a></li>';
echo '<li><a href="logout.php">Log Out</a></li>';
}
else{
echo '<li><a href="login.php">Log In</a></li>';
echo '<li><a href="register.php">Register</a></li>';
}
?>
</ul>
</section>
</nav>

<div class="row" style="margin-top:10px;">


<div class="small-12">
<div>
<form method="POST" action="pay-wallet.php">
<label style="text-align: left; margin:0 135px; font-
weight: bolder;" for="fname">Enter password</label>
<input type="password" id="fname" name="pwd"
placeholder="Your password..">

<label style="text-align: left; margin:0 135px; font-


weight: bolder;" for="lname">Enter Amount</label>
<input type="number" id="lname" name="amount"
placeholder="Amount">

<label style="text-align: left; margin:0 135px; font-


weight: bolder;" for="country">Payment to</label>
<select id="country" name="shop">
<?php
$result = $mysqli->query('SELECT payment_to FROM orders');
if($result === FALSE){
die(mysql_error());
}
if($result){
while($obj = $result->fetch_object()) {
echo '<option>'.$obj->payment_to.'</option>';
}
}
?>

</select>

<input type="submit" value="Pay">


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

<!-- <?php /*
$i=0;
$product_id = array();
$product_quantity = array();

$result = $mysqli->query('SELECT * FROM products');


if($result === FALSE){

28
die(mysql_error());
}
echo '<label for="country">Shop</label>';
echo '<select id="country" name="country">';
if($result){

while($obj = $result->fetch_object()) {

echo '<div class="large-4 columns">';


echo '<p><h3>'.$obj->product_name.'</h3></p>';
echo '<img src="images/products/'.$obj-
>product_img_name.'"/>';
echo '<p><strong>Product Code</strong>: '.$obj-
>product_code.'</p>';
echo '<p><strong>Description</strong>: '.$obj-
>product_desc.'</p>';
echo '<p><strong>Units Available</strong>: '.$obj-
>qty.'</p>';
echo '<p><strong>Price (Per Unit)</strong>: '.$currency.$obj-
>price.'</p>';

echo '<option
value="australia">Australia</option>';

if($obj->qty > 0){


echo '<p><a href="update-cart.php?action=add&id='.$obj-
>id.'"><input type="submit" value="Add To Cart" style="clear:both;
background: #0078A0; border: none; color: #fff; font-size: 1em; padding:
10px;" /></a></p>';
}
else {
echo 'Out Of Stock!';
}
echo '</div>';

$i++;
}
}
echo '</select>';
echo '<p'
$_SESSION['product_id'] = $product_id;

echo '</div>';
echo '</div>';
*/ ?> //-->

<div class="row" style="margin-top:10px;">


<div class="small-12">
<hr>

<footer style="margin-top:10px;">
<p style="text-align:center; font-size:0.8em;clear:both;">&copy;
VITCoins! All Rights Reserved.</p>
</footer>

</div>
</div>

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

29
<script>
$(document).foundation();
</script>
</body>
</html>

Page for Adding Money to Wallet


addmoney.php

<?php

//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}


if(session_id() == '' || !isset($_SESSION)){session_start();}
include 'config.php';
?>

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"
/>
<title>Pay</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
<style>
input[type=number], input[type=password], select {
width: 70%;
padding: 12px 20px 8px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}

input[type=submit] {
width: 70%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}

input[type=submit]:hover {
background-color: #45a049;
}

div {
text-align: center;
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}

30
</style>
</head>
<body>

<nav class="top-bar" data-topbar role="navigation">


<ul class="title-area">
<li class="name">
<?php
if(isset($_SESSION['username'])) {
$user = $_SESSION["username"];
$result = $mysqli->query("SELECT wallet from users where
email='$user'");
if($result){
$obj = $result->fetch_object();
echo '<h1 style="color: white; margin-left: 20px;">Wallet:
'.$obj->wallet.'<img src="images/coi1ns.png"
style="width:40px;height:40px;"></h1>';
}
}
?>
</li>
<li class="toggle-topbar menu-icon"><a
href="#"><span></span></a></li>
</ul>

<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li><a href="about.php">About</a></li>
<li><a href="products.php">Pay</a></li>
<li class='active'><a href="addmoney.php">Add VITCoins</a></li>
<li><a href="orders.php">My Orders</a></li>
<li><a href="contact.php">Contact</a></li>
<?php

if(isset($_SESSION['username'])){
echo '<li><a href="account.php">My Account</a></li>';
echo '<li><a href="logout.php">Log Out</a></li>';
}
else{
echo '<li><a href="login.php">Log In</a></li>';
echo '<li><a href="register.php">Register</a></li>';
}
?>
</ul>
</section>
</nav>

<div class="row" style="margin-top:10px;">


<div class="small-12">
<div>
<form method="POST" action="addmoney-process.php">
<label style="text-align: left; margin:0 135px; font-
weight: bolder;" for="fname">Enter password: </label>
<input type="password" id="fname" name="pwd"
placeholder="Your password">

<label style="text-align: left; margin:0 135px; font-


weight: bolder;" for="lname">Enter Amount to be added: </label>
<input type="number" id="lname" name="amount"
placeholder="Amount">

31
<input type="submit" value="Add money">
</form>
</div>
</div>
</div>

<div class="row" style="margin-top:10px;">


<div class="small-12">
<hr>

<footer style="margin-top:10px;">
<p style="text-align:center; font-size:0.8em;clear:both;">&copy;
VITCoins! All Rights Reserved.</p>
</footer>

</div>
</div>

Page for Transaction History


myorders.php

<?php

//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}


if(session_id() == '' || !isset($_SESSION)){session_start();}

if(!isset($_SESSION["username"])){
header("location:index.php");
}
include 'config.php';
?>

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"
/>
<title>History</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<body>

<nav class="top-bar" data-topbar role="navigation">


<ul class="title-area">
<li class="name">
<?php
if(isset($_SESSION['username'])) {
$user = $_SESSION["username"];
$result = $mysqli->query("SELECT wallet from users where
email='".$user."'");
if($result){
$obj = $result->fetch_object();

32
echo '<h1 style="color: white; margin-left: 20px;">Wallet:
'.$obj->wallet.'<img src="images/coi1ns.png"
style="width:40px;height:40px;"></h1>';
}
}
?>
</li>
<li class="toggle-topbar menu-icon"><a
href="#"><span></span></a></li>
</ul>

<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li><a href="about.php">About</a></li>
<li><a href="products.php">Pay</a></li>
<li><a href="addmoney.php">Add VITCoins</a></li>
<li class="active"><a href="orders.php">My Orders</a></li>
<li><a href="contact.php">Contact</a></li>
<?php

if(isset($_SESSION['username'])){
echo '<li><a href="account.php">My Account</a></li>';
echo '<li><a href="logout.php">Log Out</a></li>';
}
else{
echo '<li><a href="login.php">Log In</a></li>';
echo '<li><a href="register.php">Register</a></li>';
}
?>
</ul>
</section>
</nav>

<div class="row" style="margin-top:10px;">


<div class="large-12">
<h3>My Transaction History</h3>
<hr>

<?php
$user = $_SESSION["username"];
$result = $mysqli->query("SELECT id, payment_to, current_total,
DATE_FORMAT(date_now,'%d.%m.%Y at %k:%i') as posteddate from user_log where
email='".$user."'");
if($result) {
while($obj = $result->fetch_object()) {
//echo '<div class="large-6">';
echo '<h4>Order ID:'.$obj->id.'</h4>';
echo '<p><strong>Date: </strong> '.$obj->posteddate.'</p>';
echo '<p><strong>Payment To:</strong> '.$obj-
>payment_to.'</p>';
echo '<p><strong>Amount:</strong> '.$currency.$obj-
>current_total.'</p>';
//echo '</div>';
//echo '<div class="large-6">';
//echo '<img src="images/products/sports_band.jpg">';
//echo '</div>';
echo '<p><hr></p>';

}
}

33
?>
</div>
<hr>
</div>

<div class="row" style="margin-top:10px;">


<div class="small-12">

<footer style="margin-top:10px;">
<p style="text-align:center; font-size:0.8em;">&copy; VITCoins!
All Rights Reserved.</p>
</footer>

</div>
</div>

<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>

MySQL Database
bolt.sql

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+05:30";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;


/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `bolt`
--

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

--
-- Table structure for table `orders`
--

CREATE TABLE IF NOT EXISTS `orders` (

34
`id` int(15) NOT NULL auto_increment,
`payment_to` varchar(255) NOT NULL,
`total` int(15) NOT NULL,
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;

-- Dumping data for table `orders`


--

INSERT INTO `orders` (`id`,`payment_to`,`total`) VALUES


(1, 'SJT Ground floor shop', 0),
(2, 'SJT First floor shop',0),
(3, 'Enzo', 0),
(4, 'TT Xerox Shop', 0),
(5, 'Foodcy', 0),
(6, 'Library', 0),
(7, 'Cab', 0);

-- Table structure for table `users`


--

CREATE TABLE IF NOT EXISTS `users` (


`id` int(11) NOT NULL auto_increment,
`fname` varchar(255) NOT NULL,
`lname` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`city` varchar(100) NOT NULL,
`pin` int(6) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(15) NOT NULL,
`wallet` decimal(10,2) default 10,
`type` varchar(20) NOT NULL default 'user',
`total_paid` decimal(20,2),
`answer` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `users`

35
--

INSERT INTO `users` (`id`, `fname`, `lname`, `address`, `city`, `pin`,


`email`, `password`, `type`, `total_paid`, `answer`) VALUES
(1, 'Anirban', 'Mukherjee', 'VIT', 'Vellore', 632014,
'anirban@vitcoin.com', '666666', 'user',0,'sjt200'),
(2, 'Vishist', 'Varugeese', 'VIT', 'Chennai', 666666,
'vishist@vitcoin.com', '111111', 'admin',0,'sjt242');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;


/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

CREATE TABLE IF NOT EXISTS `user_log` (


`id` int(15) NOT NULL auto_increment,
`payment_to` varchar(255) NOT NULL,
`current_total` int(15) NOT NULL,
`date_now` timestamp NOT NULL default CURRENT_TIMESTAMP,
`email` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;

36
TEST CASES

CASE I.D. TEST CASE EXPECTED ACTUAL PASS/FAIL REMARKS


OUTPUT OUTPUT
1 Login Login with proper Success Pass Good
username and
password
2 Sign-Up Sign-Up with all Success Pass Good
details, username,
password and
security question
3 Forgot Password reset Success Pass Good
Password after username and
security question
are verified
4 Add Money Money added to Success Pass Good
wallet after
password
verification
5 Pay Money Pay money after Success Pass Good
password
verification, money
to be paid shouldnt
exceed money
already in wallet

37
CONCLUSIONS AND FUTURE WORK

CONCLUSION

The main objective of this project to develop a web application for VITians which would pay
for shopping, cab fare and fines was achieved which allows VITians to now easily perform
cashless transaction without any hassle and is a great way forward to the mission of Digital
India.

FUTURE WORK

The following section describes the work that will be implemented with future releases of the
software.

Admin Panel: The admin panel will pay all the fees to the shops.
Enhance User Interface: Adding more user interactive features making user
experience better with time.
Payment Options: Add different payment options such as PayPal, Cash, Gift Cards
and wallets.

38
REFERENCES

https://www.w3schools.com/
https://stackoverflow.com/

39

You might also like