forked from Yug2920/Expense-Tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
81 lines (70 loc) · 3.02 KB
/
index.html
File metadata and controls
81 lines (70 loc) · 3.02 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Expense Tracker Dashboard</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="container">
<header>
<h1>💸 Expense Tracker Dashboard</h1>
<a href="{{ url_for('logout') }}" style="color: #FF6347; text-decoration: none;">Logout</a>
</header>
<div class="wallet-box">
<h3>💳 Wallet Balance</h3>
<p>{{ "{:,.2f}".format(balance) }} {{ base_currency }}</p>
</div>
<div class="input-form">
<h2>➕ Add Transaction</h2>
<form action="{{ url_for('add_transaction') }}" method="POST">
<select name="type" required>
<option value="EXPENSE">Expense</option>
<option value="INCOME">Income</option>
</select>
<input type="text" name="description" placeholder="Description (e.g., Groceries, Salary)" required>
<input type="number" name="amount" step="0.01" min="0.01" placeholder="Amount" required>
<select name="currency" required>
<option value="USD">USD - US Dollar</option>
<option value="EUR">EUR - Euro</option>
<option value="INR">INR - Indian Rupee</option>
</select>
<button type="submit">Add Transaction</button>
</form>
</div>
<hr style="border-color: #333; margin: 30px 0;">
<h2>📊 Transaction History</h2>
<div style="margin-bottom: 20px;">
<a href="{{ url_for('generate_pdf_report') }}"><button style="background-color: #FF9800;">Download PDF Report</button></a>
<a href="{{ url_for('generate_chart') }}"><button style="background-color: #2196F3;">View Chart</button></a>
</div>
<table class="transaction-table">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
<th>Amount</th>
<th>Currency</th>
<th>Date</th>
</tr>
</thead>
<tbody>
{% for t in transactions %}
{% set row_class = 'income-row' if t['type'] == 'INCOME' else 'expense-row' %}
<tr class="{{ row_class }}">
<td>{{ t['type'] }}</td>
<td>{{ t['description'] }}</td>
<td>{{ "{:,.2f}".format(t['amount']) }}</td>
<td>{{ t['currency'] }}</td>
<td>{{ t['date'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if not transactions %}
<p style="text-align: center;">No transactions found. Start adding some!</p>
{% endif %}
</div>
</body>
</html>