| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/book.gyaniguru.org/admin/ |
Upload File : |
<?php
include 'includes/header.php';
$users = get_all("SELECT *, (SELECT COUNT(*) FROM orders WHERE user_id = users.id) as order_count FROM users ORDER BY created_at DESC");
?>
<div class="admin-card">
<div class="table-responsive">
<table class="table table-custom">
<thead>
<tr>
<th>User ID</th>
<th>Name</th>
<th>Email / Phone</th>
<th>Location</th>
<th>Orders</th>
<th>Joined Date</th>
</tr>
</thead>
<tbody>
<?php foreach($users as $user): ?>
<tr>
<td>#USR-<?php echo $user['id']; ?></td>
<td>
<div class="d-flex align-items-center gap-3">
<div style="width:35px;height:35px;border-radius:50%;background:rgba(212,175,55,0.1);color:var(--gold);display:flex;align-items:center;justify-content:center;font-weight:bold">
<?php echo substr($user['name'], 0, 1); ?>
</div>
<div style="font-weight:600"><?php echo $user['name']; ?></div>
</div>
</td>
<td>
<div><?php echo $user['email']; ?></div>
<div class="text-muted small"><?php echo $user['phone'] ?: 'No phone'; ?></div>
</td>
<td>
<div style="font-size:0.85rem"><?php echo $user['city'] ?: 'N/A'; ?></div>
<div class="text-muted small"><?php echo $user['pincode']; ?></div>
</td>
<td>
<span class="badge bg-dark border border-secondary"><?php echo $user['order_count']; ?> Orders</span>
</td>
<td style="font-size:0.85rem; color:rgba(255,255,255,0.5)">
<?php echo date('d M Y', strtotime($user['created_at'])); ?>
</td>
</tr>
<?php endforeach; if(empty($users)) echo '<tr><td colspan="6" class="text-center py-5">No registered users yet.</td></tr>'; ?>
</tbody>
</table>
</div>
</div>
<?php include 'includes/footer.php'; ?>