-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.html
115 lines (107 loc) · 3.4 KB
/
admin.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap">
<style>
body {
font-family: 'Roboto', sans-serif;
margin: 0;
padding: 0;
background: url('bg_image.png') no-repeat right;
background-size: 900px auto;
}
header, footer {
background-color: #e21b70;
color: white;
text-align: center;
}
header {
padding: 10px;
}
header img {
height: 80px;
vertical-align: middle;
}
header span {
font-size: 24px;
margin-left: 20px;
}
main {
padding: 20px;
margin-right: 100px;
}
footer {
padding: 10px;
position: fixed;
bottom: 0;
width: 100%;
}
.request-card {
border: 1px solid #ddd;
padding: 10px;
margin-bottom: 10px;
}
.request-card button {
padding: 5px 10px;
border: none;
cursor: pointer;
}
.approve-btn {
background-color: green;
color: white;
}
.delete-btn {
background-color: red;
color: white;
}
</style>
</head>
<body>
<header>
<img src="eatwithease.png" alt="Logo">
<span>Eat with Ease - Admin Dashboard</span>
</header>
<main>
<h1>Account Requests</h1>
<div id="requests"></div>
</main>
<footer>
© 2024 Zaryab Hussain
</footer>
<script>
const requests = [
{ type: 'Restaurant', name: 'Burger King', email: 'bk@gmail.com' },
{ type: 'Restaurant', name: 'Pizza Hut', email: 'ph@outlook.com' },
{ type: 'Customer', name: 'Ali Khan', email: 'Alikhan@hotmail.com' },
{ type: 'Customer', name: 'Glassworker', email: 'gw@microsoft.com' }
];
function loadRequests() {
const requestsContainer = document.getElementById('requests');
requestsContainer.innerHTML = '';
requests.forEach((request, index) => {
const requestDiv = document.createElement('div');
requestDiv.className = 'request-card';
requestDiv.innerHTML = `
<p><strong>Type:</strong> ${request.type}</p>
<p><strong>Name:</strong> ${request.name}</p>
<p><strong>Email:</strong> ${request.email}</p>
<button class="approve-btn" onclick="approveRequest(${index})">Approve</button>
<button class="delete-btn" onclick="deleteRequest(${index})">Delete</button>
`;
requestsContainer.appendChild(requestDiv);
});
}
function approveRequest(index) {
requests.splice(index, 1);
loadRequests();
}
function deleteRequest(index) {
requests.splice(index, 1);
loadRequests();
}
window.onload = loadRequests;
</script>
</body>
</html>