-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
285 lines (259 loc) · 11.6 KB
/
profile.php
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
<?php
session_start();
require 'config.php'; // Database connection
// Ensure user is logged in
if (!isset($_SESSION['agent_email'])) {
header("Location: signin.php");
exit();
}
$agent_email = $_SESSION['agent_email'];
$agent_name = $_SESSION['agent_name'];
try {
$pdo = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASS);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Fetch agent details
$stmt = $pdo->prepare("SELECT name, email, agent_code FROM agents WHERE email = ?");
$stmt->execute([$agent_email]);
$agent = $stmt->fetch(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
die("Database error: " . $e->getMessage());
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>S-MART Affiliate Dashboard| Dashboard</title>
<!-- Favicon -->
<link rel="shortcut icon" href="img/logo.png" type="image/x-icon" />
<!-- Custom styles -->
<link rel="stylesheet" href="./css/style.min.css" />
</head>
<style>
.sidebar-head {
display: flex !important;
flex-direction: row !important;
align-items: center !important;
justify-content: space-between !important;
width: 100% !important;
max-width: 100% !important;
/* flex-wrap: nowrap !important; */
}
.logo-wrapper {
display: flex !important;
align-items: center !important;
}
.logo-wrapper img {
max-width: 130px !important;
height: auto !important;
}
.sidebar-toggle {
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex-shrink: 0 !important;
margin-left: 10px !important;
margin-top: 10px !important;
}
.sidebar-user-container {
display: flex;
align-items: center;
white-space: nowrap;
/* Prevents wrapping */
overflow: hidden;
/* Ensures overflow is hidden */
max-width: 200px;
/* Set a max width to control layout */
}
.sidebar-user-icon {
color: white;
flex-shrink: 0;
/* Prevents the icon from shrinking */
margin-right: 8px;
/* Adds some space between the icon and the name */
}
.sidebar-user-info {
flex-grow: 1;
/* Allows the name to take available space */
overflow: hidden;
text-overflow: ellipsis;
/* Adds '...' if the name is too long */
}
</style>
<body>
<div class="layer"></div>
<!-- ! Body -->
<a class="skip-link sr-only" href="#skip-target">Skip to content</a>
<div class="page-flex">
<!-- ! Sidebar -->
<aside class="sidebar">
<div class="sidebar-start">
<div class="sidebar-head">
<a href="/" class="logo-wrapper" title="Home">
<span class="sr-only">Home</span>
<img src="img/logo-white.png" width="100%" aria-hidden="true" alt="Logo" />
</a>
<button class="sidebar-toggle transparent-btn" title="Menu" type="button">
<span class="sr-only">Toggle menu</span>
<span class="icon menu-toggle" aria-hidden="true"></span>
</button>
</div>
<div class="sidebar-body">
<ul class="sidebar-body-menu">
<li>
<a href="index.php"><span class="icon home" aria-hidden="true"></span>Dashboard</a>
</li>
<li>
<a href="clients.php"><i data-feather="users" aria-hidden="true"
class="icon"></i>Clients</a>
</li>
<li>
<a class="show-cat-btn" href="##">
<span class="icon document" aria-hidden="true"></span>Withdrawal
<span class="category__btn transparent-btn" title="Open list">
<span class="sr-only">Open list</span>
<span class="icon arrow-down" aria-hidden="true"></span>
</span>
</a>
<ul class="cat-sub-menu active">
<li>
<a href="withdrawal-request.php" style="font-size: 12px">View Withdrawal Request</a>
</li>
<li>
<a href="request-withdrawal.php" class="active" style="font-size: 12px">Request For
Withdrawal</a>
</li>
</ul>
</li>
<li>
<a class="show-cat-btn" href="##">
<i data-feather="users" aria-hidden="true" class="icon"></i>Community
<span class="category__btn transparent-btn" title="Open list">
<span class="sr-only">Open list</span>
<span class="icon arrow-down" aria-hidden="true"></span>
</span>
</a>
<ul class="cat-sub-menu">
<li>
<a href="https://chat.whatsapp.com/IDH0u43syKp5aZlmvzLCUW " target="_blank"
style="font-size: 12px">Join group</a>
</li>
</ul>
</li>
<li>
<a class="active" href="profile.php"><i data-feather="user" aria-hidden="true"
class="icon"></i>
Profile</a>
</li>
<li>
<a href="logout.php"><i data-feather="log-out" aria-hidden="true" class="icon"></i></i>
Logout</a>
</li>
</ul>
</div>
</div>
<div class="sidebar-footer">
<a href="##" class="sidebar-user" style="padding: 10px;">
<!-- <span class="sidebar-user-img"> -->
<!-- </span> -->
<div class="sidebar-user-container">
<i data-feather="user" aria-hidden="true" class="sidebar-user-icon"></i>
<div class="sidebar-user-info">
<span class="sidebar-user__title">
<?php echo htmlspecialchars($agent_name); ?>
</span>
</div>
</div>
</a>
</div>
</aside>
<div class="main-wrapper">
<!-- ! Main nav -->
<nav class="main-nav--bg">
<div class="container main-nav">
<div class="main-nav-start"></div>
<div class="main-nav-end">
<button class="sidebar-toggle transparent-btn" title="Menu" type="button">
<span class="sr-only">Toggle menu</span>
<span class="icon menu-toggle--gray" aria-hidden="true"></span>
</button>
<button class="theme-switcher gray-circle-btn" type="button" title="Switch theme">
<span class="sr-only">Switch theme</span>
<i class="sun-icon" data-feather="sun" aria-hidden="true"></i>
<i class="moon-icon" data-feather="moon" aria-hidden="true"></i>
</button>
<div class="nav-user-wrapper">
<button href="##" class="nav-user-btn dropdown-btn" title="My profile" type="button">
<span class="sr-only">My profile</span>
<span class="nav-user-img">
<picture>
<source srcset="./img/avatar/avatar-illustrated-02.webp" type="image/webp" />
<img src="./img/avatar/avatar-illustrated-02.png" alt="User name" />
</picture>
</span>
</button>
<ul class="users-item-dropdown nav-user-dropdown dropdown">
<li>
<a href="profile.php">
<i data-feather="user" aria-hidden="true"></i>
<span>Profile</span>
</a>
</li>
<li>
<a class="danger" href="logout.php">
<i data-feather="log-out" aria-hidden="true"></i>
<span>Log out</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
<!-- ! Main -->
<main class="main users chart-page" id="skip-target">
<div class="container">
<h2 class="main-title">Profile Information</h2>
<div class="col-lg-12">
<form class="form">
<label class="form-label-wrapper">
<p class="form-label">Name</p>
<input class="form-input" type="text"
value="<?php echo htmlspecialchars($agent['name']); ?>" readonly>
</label>
<label class="form-label-wrapper">
<p class="form-label">Email</p>
<input class="form-input" type="text"
value="<?php echo htmlspecialchars($agent['email']); ?>" readonly>
</label>
<label class="form-label-wrapper">
<p class="form-label">Agent Code</p>
<input class="form-input" type="text"
value="<?php echo htmlspecialchars($agent['agent_code']); ?>" readonly>
</label>
</form>
</div>
</main>
<!-- ! Footer -->
<footer class="footer">
<div class="container footer--flex">
<div class="footer-start">
<p>
2025 © S-MART Affiliate - Powered by
<a href="" target="_blank" rel="noopener noreferrer">Onatech NGC</a>
</p>
</div>
</div>
</footer>
</div>
</div>
<!-- Chart library -->
<script src="./plugins/chart.min.js"></script>
<!-- Icons library -->
<script src="plugins/feather.min.js"></script>
<!-- Custom scripts -->
<script src="js/script.js"></script>
</body>
</html>