-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreports.html
216 lines (190 loc) · 4.98 KB
/
reports.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reports</title>
<link rel="stylesheet" href="styles.css">
<style>
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(45deg, #ff6b81, #ffd93d);
margin: 0;
padding: 0;
color: #333;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ff6b81;
padding: 20px 40px;
border-bottom: 4px solid #ffd93d;
}
.logo h1 {
font-size: 2.5rem;
margin: 0;
color: white;
font-family: 'Comic Sans MS', cursive, sans-serif;
}
nav ul {
list-style: none;
display: flex;
gap: 25px;
margin: 0;
}
nav ul li a {
text-decoration: none;
color: white;
font-size: 1.2rem;
font-weight: bold;
transition: color 0.3s;
}
nav ul li a:hover {
color: #ffd93d;
}
.user-info {
display: flex;
align-items: center;
gap: 10px;
}
.user-info span {
font-size: 1.2rem;
color: white;
}
.user-info button {
padding: 12px 18px;
background-color: #ffd93d;
border: none;
border-radius: 50px;
color: white;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s;
}
.user-info button:hover {
background-color: #ff6b81;
}
main {
display: flex;
justify-content: center;
padding: 40px;
}
.reports {
background-color: white;
border-radius: 20px;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
padding: 35px;
width: 80%;
max-width: 1200px;
position: relative;
overflow: hidden;
}
.reports h2 {
text-align: center;
margin-bottom: 25px;
font-size: 2.5rem;
color: #ff6b81;
font-family: 'Comic Sans MS', cursive, sans-serif;
}
button {
padding: 12px 24px;
background-color: #ff6b81;
color: white;
border: none;
border-radius: 50px;
font-size: 1.2rem;
cursor: pointer;
transition: background-color 0.3s;
margin: 20px 0;
}
button:hover {
background-color: #ffd93d;
}
#report-content {
background-color: #f8f8f8;
padding: 20px;
border-radius: 15px;
margin-top: 20px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.report-item {
margin-bottom: 15px;
font-size: 1.1rem;
color: #333;
}
.report-item strong {
color: #ff6b81;
}
@media (max-width: 768px) {
header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
nav ul {
flex-direction: column;
gap: 15px;
}
.reports {
width: 100%;
padding: 20px;
}
}
</style>
</head>
<body>
<header>
<div class="logo">
<h1>TrackMySpend</h1>
</div>
<nav>
<ul>
<li><a href="home.html">Dashboard</a></li>
<li><a href="expenses.html">List of Expenses</a></li>
<li><a href="graph.html">Expense Graph</a></li>
<li><a href="budget.html">Budget Tracker</a></li>
<li><a href="reports.html">Reports</a></li>
</ul>
</nav>
<div class="user-info">
<span>Welcome, User!</span>
<button onclick="logout()">Logout</button>
</div>
</header>
<main>
<div class="reports">
<h2>Reports</h2>
<button onclick="generateReport()">Generate Report</button>
<div id="report-content">
</div>
</div>
</main>
<script src="script.js"></script>
<script src="script.js"></script>
<script>
function logout() {
alert("You have logged out successfully.");
window.location.href = "login.html";
}
function generateReport() {
const totalExpenses = parseFloat(localStorage.getItem("totalExpenses")) || 0;
const totalIncome = parseFloat(localStorage.getItem("totalIncome")) || 0;
const remainingBudget = parseFloat(localStorage.getItem("remainingBudget")) || 0;
const foodExpense = (4 * 8000).toFixed(2);
const transportExpense = (4 * 1500).toFixed(2);
const personalExpense = (4 * 5000).toFixed(2);
const reportContent = `
<h3>Expense Report</h3>
<div class="report-item"><strong>Food:</strong> ₹${foodExpense}</div>
<div class="report-item"><strong>Transport:</strong> ₹${transportExpense}</div>
<div class="report-item"><strong>Entertainment:</strong> ₹${personalExpense}</div>
<div class="report-item"><strong>Total Expenses:</strong> ₹${totalExpenses}</div>
<div class="report-item"><strong>Total Income:</strong> ₹${totalIncome}</div>
<div class="report-item"><strong>Remaining Budget:</strong> ₹${remainingBudget}</div>
`;
document.getElementById('report-content').innerHTML = reportContent;
}
</script>
</body>
</html>