-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.html
216 lines (198 loc) · 5.2 KB
/
dashboard.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>Admin Page</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
color: #333;
}
.search-container {
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
.search-container input {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
margin-right: 10px;
width: 200px;
}
.search-container button {
padding: 10px 15px;
background-color: #5cb85c;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
.search-container button:hover {
background-color: #4cae4c;
}
table {
border-collapse: collapse;
width: 100%;
margin-top: 20px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
background-color: white;
}
th, td {
border: 1px solid #ddd;
padding: 12px;
text-align: left;
font-size: 14px;
}
th {
background-color: #5bc0de;
color: white;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
tr:hover {
background-color: #f1f1f1;
}
footer {
margin-top: 325px;
text-align: center;
padding: 0.9px;
background-color: #686565;
color: white;
position: relative;
}
/* Responsive styling */
@media (max-width: 600px) {
.search-container {
flex-direction: column;
align-items: flex-end;
}
.search-container input {
width: 100%;
margin-bottom: 10px;
}
.search-container button {
width: 100%;
}
}
</style>
</head>
<body>
<h1>Admin Dashboard</h1>
<div class="search-container">
<input type="text" id="searchInput" placeholder="Search..." />
<button onclick="searchTable()">Search</button>
</div>
<table id="myTable">
<thead>
<tr>
<th>S.No</th>
<th>Username</th>
<th>Total Capital</th>
<th>Total Investments</th>
<th>Debts</th>
<th>Expenses</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Sudheendra</td>
<td>₹100,000</td>
<td>₹50,000</td>
<td>₹10,000</td>
<td>₹23,043</td>
<td>₹230</td>
</tr>
<tr>
<td>2</td>
<td>Dandu Asrith</td>
<td>₹100,000</td>
<td>₹50,000</td>
<td>₹10,000</td>
<td>₹23,043</td>
<td>₹230</td>
</tr>
<tr>
<td>3</td>
<td>Ashwin</td>
<td>₹100,000</td>
<td>₹50,000</td>
<td>₹10,000</td>
<td>₹23,043</td>
<td>₹230</td>
</tr>
<tr>
<td>4</td>
<td>Shriniketh</td>
<td>₹100,000</td>
<td>₹50,000</td>
<td>₹10,000</td>
<td>₹23,043</td>
<td>₹230</td>
</tr>
<tr>
<td>5</td>
<td>Dheeraj</td>
<td>₹100,000</td>
<td>₹50,000</td>
<td>₹10,000</td>
<td>₹23,043</td>
<td>₹230</td>
</tr>
</tbody>
</table>
<script>
function generateData() {
const tbody = document.querySelector("tbody");
const firstRow = tbody.querySelector("tr");
for (let i = 49; i < 50; i++) {
const row = tbody.insertBefore(
document.createElement("tr"),
firstRow
);
for (let j = 0; j < 7; j++) {
const cell = row.insertCell();
cell.textContent = " ";
}
}
}
function searchTable() {
const input = document.getElementById("searchInput");
const filter = input.value.toUpperCase();
const table = document.getElementById("myTable");
const tr = table.getElementsByTagName("tr");
for (let i = 0; i < tr.length; i++) {
let td = tr[i].getElementsByTagName("td");
let flag = false;
for (let j = 0; j < td.length; j++) {
if (td[j].innerHTML.toUpperCase().indexOf(filter) > -1) {
flag = true;
break;
}
}
if (flag) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
generateData();
</script>
</body>
<footer>
<p>© 2024 All Rights Reserved</p>
</footer>
</html>