-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage8.html
147 lines (125 loc) · 5.5 KB
/
page8.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<!-- meta -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous" />
<link rel="stylesheet" href="css/style.css" />
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
crossorigin="anonymous"></script>
</head>
<body class="d-none" onload="getTransactions()">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Hello, Tim Smith</a>
</nav>
<div class="section section-top-banner">
<div class="container-fluid p-0">
<div class="row">
<div class="col p-0">
<div class="hero-banner mr-2">Account</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="title-2">
<img class="profile" width="40px" src="images/profile.png" />
<font id="dvAccountName" color="#D00">PERSONAL ACCOUNT</font>
</div>
<div style="margin-top: 20px">
<div class="title-3">
Account Number
<span id="spnAccountNumber" style="float: right">1234-56-1456</span>
</div>
<div class="title-3" style="font-size: 18px">
Available Balance
<span id="spnAvailableBalance" style="float: right">$7,060.50</span>
<hr />
</div>
<font color="#D00">Transactions</font>
<div id="dvTransactions">
<div class="subtitle-1" style="margin-top: 20px">
Cashback Reward
<span style="color: green; font-weight: 500; float: right;">+$10.00</span>
</div>
<div class="subtitle-2">OCTOBER 23, 2021</div>
<hr />
<div class="subtitle-1">
NABREWCWANNEBKRY
<span style="float: right">($100.00)</span>
</div>
<div class="subtitle-2">OCTOBER 10, 2021</div>
<hr />
<div class="subtitle-1">
NABREWCSHBCK
<span style="float: right">$10.00</span>
</div>
<div class="subtitle-2">OCTOBER 10, 2021</div>
<hr />
</div>
</div>
</div>
<!-- Option 2: jQuery, Popper.js, and Bootstrap JS
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
-->
<script>
const getTransactions = async () => {
const response = await fetch('https://pp-stage-web.azurewebsites.net/v1/nab/user-account-transactions');
const data = await response.json();
var dvAccountName = document.getElementById('dvAccountName');
dvAccountName.innerHTML = data.accountName;
var spnAccountNumber = document.getElementById('spnAccountNumber');
spnAccountNumber.innerHTML = data.accountNumber;
var spnAvailableBalance = document.getElementById('spnAvailableBalance');
spnAvailableBalance.innerHTML = parseFloat(data.availableBalance).toLocaleString("en-US")+" AUD";
var transactionsHtml = `<div class="subtitle-1" style="margin-top: 20px">
Cashback Reward
<span style="color: green; font-weight: 500; float: right;">+10.00 AUD</span>
</div>
<div class="subtitle-2">October 23, 2021</div>
<hr />
<div class="subtitle-1">
Pablo and Rusty Sydney
<span style="float: right">-100.00 AUD</span>
</div>
<div class="subtitle-2">October 23, 2021</div>
<hr />`;
for (let i = 0; i < data.transactions.length; i++) {
transactionsHtml += `
<div class="subtitle-1">
${data.transactions[i].description}
<span style="float: right">${data.transactions[i].amount} AUD</span>
</div>
<div class="subtitle-2">${data.transactions[i].date}</div>
<hr />`;
}
var dvTransactions = document.getElementById('dvTransactions');
dvTransactions.innerHTML = transactionsHtml;
var body = document.getElementsByTagName('body');
$(body).removeClass('d-none');
}
</script>
</body>
</html>