-
Notifications
You must be signed in to change notification settings - Fork 0
/
expenses.html
430 lines (415 loc) · 15.2 KB
/
expenses.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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Finance Buddy</title>
<link rel="icon" href="logo.png" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm"
crossorigin="anonymous"
/>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<nav class="navbar mb-5 navbar-shadow navbar-expand-lg bg-body-tertiary">
<div class="container">
<a class="navbar-brand" href="#"><img src="logo.png" alt="logo" /></a>
<button
class="navbar-toggler btn-close-danger"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item me-5">
<a
class="nav-link active"
aria-current="page"
href="homepage.html"
>Home</a
>
</li>
<li class="nav-item me-5">
<a class="nav-link active" aria-current="page" href="blogs.html"
>Blog</a
>
</li>
<li class="nav-item me-5">
<a class="nav-link active" aria-current="page" href="index.html"
>Investment</a
>
</li>
<li class="nav-item me-5">
<a class="nav-link disabled" aria-current="page" href="#"
>Expenses</a
>
</li>
<li class="nav-item me-5">
<a class="nav-link active" aria-current="page" href="Contact.html"
>Contact</a
>
</li>
<li>
<input
id="logOut"
type="button"
class="btn-success btn"
value="Log Out"
/>
</li>
</ul>
</div>
</div>
</nav>
<div class="chat-icon" onclick="openCustomModal()">
<img
src="https://hostapk.com/wp-content/uploads/2023/03/Ask-Me-Anything-AI-Chatbot.png"
alt="Chatbot Icon"
/>
</div>
<!-- Custom Modal -->
<div id="customModal" class="custom-modal">
<div class="modal-content">
<span class="close" onclick="closeCustomModal()">×</span>
<iframe
id="customChatbotFrame"
width="100%"
height="100%"
allow="microphone;"
src=""
></iframe>
</div>
</div>
<div class="container mb-5">
<div class="row">
<div class="col-lg-6 col-sm-12 expenseDaily">
<h2>Add Daily Expense</h2>
<form id="expenseForm">
<div class="mb-3">
<label for="expenseName" class="form-label">Expense Name</label>
<input
type="text"
class="form-control"
id="expenseName"
required
/>
</div>
<div class="mb-3">
<label for="expenseAmount" class="form-label"
>Expense Amount</label
>
<input
type="number"
class="form-control"
id="expenseAmount"
required
/>
</div>
<div class="mb-3">
<label for="expenseCategory" class="form-label"
>Expense Category</label
>
<select class="form-select" id="expenseCategory" required>
<option value="">Select Category</option>
<option value="food">Food</option>
<option value="entertainment">Entertainment</option>
<option value="health">Health</option>
<option value="others">Others</option>
<option value="savings">Savings</option>
</select>
</div>
<div class="mb-3">
<label for="expenseDate" class="form-label">Expense Date</label>
<input
type="date"
class="form-control"
id="expenseDate"
value="${new Date().toISOString().split('T')[0]}"
required
/>
</div>
<button type="submit" id="addExpense" class="btn btn-success">
Add Expense
</button>
</form>
</div>
<div class="col-lg-6 col-sm-12">
<div class="expenses-section">
<h2>Daily Expense List</h2>
<table class="table table-expenses" id="table-expenses">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Expense Name</th>
<th scope="col">Amount</th>
<th scope="col">Category</th>
<th scope="col">Date</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
<!-- mid-body starts -->
<div class="box">
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="box-part text-center">
<i class="fab fa-connectdevelop fa-4x"></i>
<div class="title">
<h3>Weekly</h3>
</div>
<div class="text">
<div>Total Savings: <span id="totalSavings"></span></div>
<div>Total Expenses: <span id="totalExpenses"></span></div>
</div>
<a href="#" data-bs-toggle="modal" data-bs-target="#weeklyModal"
>See More <i class="fas fa-chevron-circle-right"></i
></a>
</div>
<!-- modal is here -->
<div
class="modal fade"
id="weeklyModal"
tabindex="-1"
aria-labelledby="weeklyModalLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="weeklyModalLabel">
Weekly Track
</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<canvas id="weeklyChart" width="800" height="800"></canvas>
</div>
</div>
</div>
</div>
<!-- modal -->
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="box-part text-center">
<i class="fas fa-clipboard fa-3x mb-3"></i>
<div class="title">
<h3>Monthly</h3>
</div>
<div class="text">
<span>
Highest Category:
<span id="maxCategory"></span>
</span>
<p>Highest Amount: <span id="maxCategoryNumber"></span></p>
</div>
<a href="#" data-bs-toggle="modal" data-bs-target="#monthly"
>See More <i class="fas fa-chevron-circle-right"></i
></a>
</div>
<!-- modal is here -->
<div
class="modal fade"
id="monthly"
tabindex="-1"
aria-labelledby="monthlyLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Monthly Expenses
</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<canvas id="monthlyChart" width="800" height="800"></canvas>
</div>
</div>
</div>
</div>
<!-- modal -->
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="box-part text-center">
<i class="fas fa-users fa-4x"></i>
<div class="title">
<h3>Yearly</h3>
</div>
<div class="text">
<div>Total Savings: <span id="totalSavingsYear"></span></div>
<div>Total Expenses: <span id="totalExpensesYear"></span></div>
</div>
<a href="#" data-bs-toggle="modal" data-bs-target="#yearlyModal"
>See More <i class="fas fa-chevron-circle-right"></i
></a>
</div>
<!-- modal is here -->
<div
class="modal fade"
id="yearlyModal"
tabindex="-1"
aria-labelledby="yearlyModalLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="yearlyModalLabel">
Yearly Track
</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<canvas id="yearlyChart" width="400" height="400"></canvas>
</div>
</div>
</div>
</div>
<!-- modal -->
</div>
</div>
</div>
</div>
<div class="container mb-5">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6 predict-data p-3">
<h2 class="mb-3 text-center">Expense Prediction</h2>
<p class="text-center">This is our ML based expense predictor.</p>
<form id="predictionForm" onsubmit="predictExpense(); return false;">
<label for="date" class="mb-3">Enter the date </label>
<input
type="date"
class="mb-3 form-control"
id="date"
name="date"
required
/>
<label for="category" class="mb-3">Category</label>
<select
id="category"
class="mb-3 form-control"
name="category"
required
>
<option value="" disabled selected>Select a category</option>
</select>
<div class="text-center">
<input type="submit" value="Predict" class="btn btn-primary" />
</div>
</form>
<div id="predictionResult" class="mb-3"></div>
<script src="predict.js" defer></script>
</div>
<div class="col-lg-3"></div>
</div>
</div>
<!-- mid-body ends -->
<footer class="main-footer text-white text-center text-lg-start">
<div class="container p-5">
<div class="row">
<div class="col-lg-6 col-md-12 mb-4 mb-md-0">
<h5 class="text-uppercase">Financial Education</h5>
<p>
Improving financial literacy is crucial for making informed
decisions about money. Understanding concepts like budgeting,
saving, and investing can lead to a more secure financial future.
</p>
</div>
<div class="col-lg-6 col-md-12 mb-4 mb-md-0">
<h5 class="text-uppercase">Finance Awareness</h5>
<p>
Stay updated with the latest financial news and trends. Being
aware of financial opportunities and risks can help you make
better financial choices and achieve your goals.
</p>
</div>
</div>
</div>
<hr style="color: aliceblue" />
<div class="text-center p-3 footer-text">
© 2024 Copyright:
<a class="text-body" href="#">Scorpions</a>
</div>
</footer>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script>
<script>
const firebaseConfig = {
apiKey: "AIzaSyBAyJw-EzvrH4O1Il43sA-ceJoCkUxvUUE",
authDomain: "financeapp-29fd7.firebaseapp.com",
databaseURL: "https://financeapp-29fd7-default-rtdb.firebaseio.com",
projectId: "financeapp-29fd7",
storageBucket: "financeapp-29fd7.appspot.com",
messagingSenderId: "36688183901",
appId: "1:36688183901:web:9a11959af52cf8911403b4",
};
firebase.initializeApp(firebaseConfig);
</script>
<script>
const categoryCodes = {
Food: 0,
Other: 1,
Transportation: 2,
Apparel: 3,
Household: 4,
"Social Life": 5,
Education: 6,
"Self-development": 7,
Beauty: 8,
Gift: 9,
};
const selectElement = document.getElementById("category");
for (const category in categoryCodes) {
if (categoryCodes.hasOwnProperty(category)) {
const option = document.createElement("option");
option.value = categoryCodes[category];
option.textContent = category;
selectElement.appendChild(option);
}
}
</script>
<script src="js/chatbot.js"></script>
<script src="js/predict.js"></script>
<script type="module" src="js/expenses.js"></script>
<script src="js/weeklyChart.js"></script>
<!-- <script type="module" src="js/monthlyChart.js"></script> -->
<script src="js/yearlyChart.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
<script type="module" src="app.js"></script>
</body>
</html>