File manager - Edit - /home/webapp69.cm.in.th/u69319090028/Shop/views/admin/admins/requests.php
Back
<div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-2 mb-3"> <div> <h4 class="fw-bold mb-1 text-dark">คำขอแต่งตั้งผู้ดูแลระบบ (Admin Creation Requests)</h4> <p class="text-muted small mb-0">คิวคำขอสร้าง Admin จากระบบที่ต้องรอการอนุมัติจาก Super Admin (Two-Man Rule)</p> </div> <div> <a href="<?= url('/admin/admins') ?>" class="btn btn-outline-secondary btn-sm py-1 px-3"> <i class="bi bi-arrow-left me-1"></i>กลับรายชื่อ Admin </a> </div> </div> <div class="admin-table-container"> <div class="admin-table-header"> <div class="d-flex align-items-center gap-2"> <i class="bi bi-person-lines-fill text-primary"></i> <span class="fw-bold text-dark" style="font-size: 0.9rem;">รายการคำขอทั้งหมด</span> <span class="badge bg-light text-muted border ms-1"><?= count($requests ?? []) ?> คำขอ</span> </div> </div> <div class="table-responsive"> <table class="admin-table"> <thead> <tr> <th width="70">ID</th> <th>ผู้ขอแต่งตั้ง (Target User)</th> <th>Role ที่ขอ</th> <th>ผู้ยื่นคำขอ (Requested By)</th> <th>เหตุผลความจำเป็น</th> <th>สถานะ</th> <th>วันที่ยื่น</th> <?php if (AdminMiddleware::isSuperAdmin()): ?> <th class="text-end">การตัดสินใจ</th> <?php endif; ?> </tr> </thead> <tbody> <?php if (empty($requests)): ?> <tr> <td colspan="8" class="text-center text-muted py-4">ไม่พบคำขอแต่งตั้ง Admin ในระบบ</td> </tr> <?php else: foreach ($requests as $r): $isPending = $r['status'] === 'pending'; ?> <tr> <td class="font-monospace small text-muted">#<?= (int)$r['id'] ?></td> <td> <div class="fw-semibold text-dark small"><?= e($r['target_first_name'] ?? '') ?></div> <div class="text-muted small">@<?= e($r['target_username'] ?? '') ?> • <?= e($r['target_email'] ?? '') ?></div> </td> <td> <span class="badge bg-primary bg-opacity-10 text-primary border border-primary border-opacity-25" style="font-size: 0.72rem;"> <?= e($r['proposed_role']) ?> </span> </td> <td> <div class="small fw-medium text-dark">@<?= e($r['requester_username'] ?? '') ?></div> </td> <td> <div class="small text-muted" style="max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> <?= e($r['reason'] ?? '—') ?> </div> </td> <td> <?php if ($r['status'] === 'approved'): ?> <span class="status-pill status-approved">อนุมัติแล้ว (Approved)</span> <?php elseif ($r['status'] === 'rejected'): ?> <span class="status-pill status-danger">ปฏิเสธ (Rejected)</span> <?php else: ?> <span class="status-pill status-pending">รอพิจารณา (Pending)</span> <?php endif; ?> </td> <td class="text-muted small"><?= date('d/m/Y H:i', strtotime($r['created_at'])) ?></td> <?php if (AdminMiddleware::isSuperAdmin()): ?> <td class="text-end"> <?php if ($isPending): ?> <div class="d-inline-flex gap-1"> <form action="<?= url('/admin/admins/requests/' . (int)$r['id'] . '/approve') ?>" method="POST" class="d-inline"> <?= Security::csrfField() ?> <button type="submit" class="btn btn-success btn-sm py-1 px-2" style="font-size: 0.75rem;" onclick="return confirm('ยืนยันอนุมัติคำขอแต่งตั้ง Admin นี้?')"> <i class="bi bi-check-lg me-1"></i>อนุมัติ </button> </form> <form action="<?= url('/admin/admins/requests/' . (int)$r['id'] . '/reject') ?>" method="POST" class="d-inline"> <?= Security::csrfField() ?> <button type="submit" class="btn btn-outline-danger btn-sm py-1 px-2" style="font-size: 0.75rem;" onclick="return confirm('ยืนยันปฏิเสธคำขอนี้?')"> <i class="bi bi-x-lg me-1"></i>ปฏิเสธ </button> </form> </div> <?php else: ?> <span class="text-muted small">—</span> <?php endif; ?> </td> <?php endif; ?> </tr> <?php endforeach; endif; ?> </tbody> </table> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.23 |
proxy
|
phpinfo
|
Settings