-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.php
282 lines (278 loc) · 12.9 KB
/
Main.php
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?php
require('db_fetch.php');
?>
<html>
<!-- Main page -->
<head>
<title>Main page</title>
<!-- CSS stylesheet -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
</head>
<body>
<!-- The top UI component that displays a welcome message and the MY ACCOUNT link. -->
<header class="top-bar">
<div class="container">
<div class="clearfix">
<div class="col-left float_left">
<ul class="top-bar-info">
<li>
<h3>Good morning </h3>
</li>
<li><?php echo $name?></li>
</ul>
</div>
<div class="col-right float_right">
<div class="link">
<!-- Page redirection -->
<a href="Account.php" class="thm-btn">My account</a>
</div>
</div>
</div>
</div>
</header>
<!-- The section that diplays the logo under the top bar. -->
<section class="theme_menu stricky slideIn animated">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="main-logo">
<a href="Main.php"><img src="image/logo_small.PNG" alt=""></a>
</div>
</div>
</div>
</div>
</section>
<!-- The container that contains the main content of the page. -->
<div class="container">
<br>
<div>
<!-- Page title -->
<section>
<h2>Budget overview</h2>
<caption class="accessible">General view of all your accounts</caption>
</section>
<br>
<br>
<div>
</section>
<!-- Credit cards section; displays all cards. -->
<section id="creditCards">
<div class="accTableHeader">
<h3> Credit Cards </h3>
</div>
<!-- Displays all credit cards in a table. -->
<table class="table">
<caption class="accessible">Your credit card accounts</caption>
<tbody>
<tr class="accessible">
<th scope="col">Account Name</th>
<th scope="col">Balance</th>
</tr>
<!--
Fetch data from DB to display card info.
Variables refer to db_fetch.php
-->
<?php
for ($i=0; $i<sizeof($summary); $i++)
{
if($summary[$i]['type']=='Credit'){
echo '
<tr>
<th scope="row">
<a href="Detail.php?card='.$summary[$i]['id'] .'">
'.$summary[$i]['name'].'</span></a>
<br>
<span> '. $summary[$i]['number'].' </span>
</th>
<td>
<ul>
<li> <span class=""> $'. $summary[$i]['balance']. ' </span> </li>
</ul>
</td>
</tr>';
}
}
?>
<!-- The total balance for all the credit cards. -->
<tr class="totalRow">
<td>
</td>
<td><span class="total">Total:</span>
<ul> <span>$<?php echo $credit_total ?></span> </ul>
</td>
</tr>
</tbody>
</table>
</section>
<!-- Saving accounts; displays all accounts. -->
<section id="creditCards">
<div class="accTableHeader">
<h3> Savings </h3>
</div>
<!-- Displays all saving accounts in a table. -->
<table class="table">
<caption class="accessible">Your saving accounts</caption>
<tbody>
<tr class="accessible">
<th scope="col">Account Name</th>
<th scope="col">Balance</th>
</tr>
<!--
Fetch data from DB to display card info.
Variables refer to db_fetch.php
-->
<?php
for ($i=0; $i<sizeof($summary); $i++)
{
if($summary[$i]['type']=='Savings'){
echo '
<tr>
<th scope="row">
<a href="Detail.php?card='.$summary[$i]['id'] .'">
'.$summary[$i]['name'].'</span></a>
<br>
<span> '. $summary[$i]['number'].' </span>
</th>
<td>
<ul>
<li> <span class=""> $'. $summary[$i]['balance']. ' </span> </li>
</ul>
</td>
</tr>';
}
}
?>
<!-- The total balance for all the saving accounts. -->
<tr class="totalRow">
<td>
</td>
<td><span class="total">Total:</span>
<ul> <span>$<?php echo $savings_total ?></span> </ul>
</td>
</tr>
</tbody>
</table>
</section>
<!-- Cash; displays all accounts. -->
<section id="creditCards">
<div class="accTableHeader">
<h3> Cash </h3>
</div>
<!-- Displays all cash accounts in a table. -->
<table class="table">
<caption class="accessible">Your cash accounts</caption>
<tbody>
<tr class="accessible">
<th scope="col">Account Name</th>
<th scope="col">Balance</th>
</tr>
<!--
Fetch data from DB to display account info.
Variables refer to db_fetch.php
-->
<?php
for ($i=0; $i<sizeof($summary); $i++)
{
if($summary[$i]['type']=='Cash'){
echo '
<tr>
<th scope="row">
<a href="Detail.php?card='.$summary[$i]['id'] .'">
'.$summary[$i]['name'].'</span></a>
<br>
<span> '. $summary[$i]['number'].' </span>
</th>
<td>
<ul>
<li> <span class=""> $'. $summary[$i]['balance']. ' </span> </li>
</ul>
</td>
</tr>';
}
}
?>
<!-- The total balance for all the cash accounts. -->
<tr class="totalRow">
<td>
</td>
<td><span class="total">Total:</span>
<ul> <span>$<?php echo $cash_total ?></span> </ul>
</td>
</tr>
</tbody>
</table>
</section>
<!-- Loan; displays all accounts. -->
<section id="creditCards">
<div class="accTableHeader">
<h3> Loan </h3>
</div>
<!-- Displays all loan accounts in a table. -->
<table class="table">
<caption class="accessible">Your loan accounts</caption>
<tbody>
<tr class="accessible">
<th scope="col">Account Name</th>
<th scope="col">Balance</th>
</tr>
<!--
Fetch data from DB to display account info.
Variables refer to db_fetch.php
-->
<?php
for ($i=0; $i<sizeof($summary); $i++)
{
if($summary[$i]['type']=='Loan'){
echo '
<tr>
<th scope="row">
<a href="Detail.php?card='.$summary[$i]['id'] .'">
'.$summary[$i]['name'].'</span></a>
<br>
<span> '. $summary[$i]['number'].' </span>
</th>
<td>
<ul>
<li> <span class=""> $'. $summary[$i]['balance']. ' </span> </li>
</ul>
</td>
</tr>';
}
}
?>
<!-- The total balance for all the loan accounts. -->
<tr class="totalRow">
<td>
</td>
<td><span class="total">Total:</span>
<ul> <span>$<?php echo $loan_total ?></span> </ul>
</td>
</tr>
</tbody>
</table>
</section>
</div>
</div>
</div>
<!-- The bottom UI section that contains copyright and other info. -->
<section class="footer-bottom">
<div class="container">
<!-- Left section -->
<div class="pull-left copy-text">
<!-- Copyright -->
<p>Copyright © 20XX. Some Company name All rights reserved.</p>
</div>
<!-- Right section -->
<div class="pull-right get-text">
<!-- Support, privacy, terms -->
<ul>
<li><a href="#" onclick="alert('Work in progress')">Support | </a></li>
<li><a href="#" onclick="alert('Work in progress')">Privacy & Policy |</a></li>
<li><a href="#" onclick="alert('Work in progress')"> Terms & Conditions</a></li>
</ul>
</div>
</div>
</section>
</body>
</html>