File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/app/Views/admin/payouts/index.php
Back
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2"> <div> <h4 class="fw-bold m-0"><i class="bi bi-cash-coin text-danger me-2"></i>จัดการการจ่ายเงินร้านค้า (Admin Seller Payouts)</h4> <p class="text-muted small mb-0">ตรวจสอบคำขอถอนเงินของร้านค้า อนุมัติการโอน และบันทึกเลขอ้างอิงการจ่ายเงิน</p> </div> </div> <!-- Financial Summary Cards --> <div class="row g-3 mb-4"> <div class="col-md-3"> <div class="card border-0 shadow-sm rounded-4 p-3 bg-warning text-dark"> <div class="d-flex justify-content-between align-items-center"> <div> <div class="text-dark-50 small fw-bold">ยอดรอโอนเงิน (Pending)</div> <div class="fs-4 fw-bold mt-1">฿<?= number_format($summary['pending_amount'] ?? 0, 2) ?></div> </div> <div class="fs-1 opacity-50"><i class="bi bi-hourglass-split"></i></div> </div> <div class="small mt-2 text-dark-50"><?= number_format($summary['pending_count'] ?? 0) ?> รายการที่รออนุมัติ</div> </div> </div> <div class="col-md-3"> <div class="card border-0 shadow-sm rounded-4 p-3 bg-success text-white"> <div class="d-flex justify-content-between align-items-center"> <div> <div class="text-white-50 small fw-bold">ยอดโอนสำเร็จแล้ว (Completed)</div> <div class="fs-4 fw-bold mt-1">฿<?= number_format($summary['completed_amount'] ?? 0, 2) ?></div> </div> <div class="fs-1 opacity-50"><i class="bi bi-check-circle-fill"></i></div> </div> <div class="small mt-2 text-white-50"><?= number_format($summary['completed_count'] ?? 0) ?> รายการที่โอนแล้ว</div> </div> </div> </div> <!-- Filter --> <div class="card border-0 shadow-sm rounded-4 mb-4"> <div class="card-body p-3"> <div class="d-flex gap-2 align-items-center flex-wrap"> <span class="fw-bold small text-muted me-2">กรองตามสถานะ:</span> <a href="?status=all" class="btn btn-sm rounded-pill <?= ($statusFilter === 'all' || empty($statusFilter)) ? 'btn-primary' : 'btn-outline-secondary' ?>">ทั้งหมด</a> <a href="?status=pending" class="btn btn-sm rounded-pill <?= ($statusFilter === 'pending') ? 'btn-warning text-dark' : 'btn-outline-secondary' ?>">รออนุมัติ (Pending)</a> <a href="?status=processing" class="btn btn-sm rounded-pill <?= ($statusFilter === 'processing') ? 'btn-primary' : 'btn-outline-secondary' ?>">กำลังโอน (Processing)</a> <a href="?status=completed" class="btn btn-sm rounded-pill <?= ($statusFilter === 'completed') ? 'btn-success' : 'btn-outline-secondary' ?>">สำเร็จแล้ว (Completed)</a> <a href="?status=rejected" class="btn btn-sm rounded-pill <?= ($statusFilter === 'rejected') ? 'btn-danger' : 'btn-outline-secondary' ?>">ปฏิเสธ (Rejected)</a> </div> </div> </div> <!-- Table --> <div class="card border-0 shadow-sm rounded-4"> <div class="card-body p-0"> <?php if (empty($payouts)): ?> <div class="text-center py-5 text-muted"> <i class="bi bi-inbox fs-1 d-block mb-2 text-secondary opacity-50"></i> <p class="mb-0">ไม่พบรายการคำขอถอนเงิน</p> </div> <?php else: ?> <div class="table-responsive"> <table class="table table-hover align-middle mb-0"> <thead class="table-light border-bottom"> <tr> <th class="ps-4">ร้านค้า</th> <th>จำนวนเงิน</th> <th>บัญชีปลายทาง</th> <th>สถานะ</th> <th>วันที่ขอถอน</th> <th class="text-end pe-4">การจัดการ</th> </tr> </thead> <tbody> <?php foreach ($payouts as $p): ?> <tr> <td class="ps-4"> <div class="fw-bold text-dark"><?= Security::e($p['shop_name']) ?></div> <div class="small text-muted"><?= Security::e($p['owner_name']) ?> (<?= Security::e($p['shop_phone']) ?>)</div> </td> <td class="fw-bold text-success fs-6">฿<?= number_format($p['amount'], 2) ?></td> <td> <div class="small fw-semibold"><?= Security::e($p['bank_name'] ?? 'Bank') ?>: <?= Security::e($p['bank_account'] ?? '-') ?></div> <?php if (!empty($p['promptpay_number'])): ?> <div class="small text-muted">PromptPay: <?= Security::e($p['promptpay_number']) ?></div> <?php endif; ?> </td> <td> <?php if ($p['status'] === 'completed'): ?> <span class="badge bg-success rounded-pill px-3 py-1">โอนสำเร็จ</span> <?php elseif ($p['status'] === 'processing'): ?> <span class="badge bg-primary rounded-pill px-3 py-1">กำลังโอน</span> <?php elseif ($p['status'] === 'rejected'): ?> <span class="badge bg-danger rounded-pill px-3 py-1">ปฏิเสธ</span> <?php else: ?> <span class="badge bg-warning text-dark rounded-pill px-3 py-1">รออนุมัติ</span> <?php endif; ?> </td> <td class="small text-muted"><?= date('d/m/Y H:i', strtotime($p['created_at'])) ?></td> <td class="text-end pe-4"> <button type="button" class="btn btn-sm btn-outline-primary rounded-pill px-3" data-bs-toggle="modal" data-bs-target="#modalPayout<?= $p['id'] ?>"> <i class="bi bi-pencil-square me-1"></i>จัดการ </button> </td> </tr> <!-- Modal Update Payout --> <div class="modal fade" id="modalPayout<?= $p['id'] ?>" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content border-0 shadow-lg rounded-4"> <div class="modal-header bg-dark text-white py-3"> <h5 class="modal-title fw-bold">จัดการการจ่ายเงิน #<?= $p['id'] ?> (<?= Security::e($p['shop_name']) ?>)</h5> <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button> </div> <form action="<?= APP_URL ?>/admin/payouts/update-status/<?= $p['id'] ?>" method="POST"> <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"> <div class="modal-body p-4 text-start"> <div class="alert alert-light border rounded-3 p-3 mb-3"> <div>ยอดเงินที่ขอถอน: <strong class="text-success fs-5">฿<?= number_format($p['amount'], 2) ?></strong></div> <div>บัญชี: <strong><?= Security::e($p['bank_name'] ?? '') ?> - <?= Security::e($p['bank_account'] ?? '') ?></strong></div> <?php if (!empty($p['promptpay_number'])): ?> <div>PromptPay: <strong><?= Security::e($p['promptpay_number']) ?></strong></div> <?php endif; ?> <?php if (!empty($p['qr_code'])): ?> <div class="mt-2 text-center"> <img src="<?= APP_URL ?>/public/<?= Security::e(ltrim($p['qr_code'], '/')) ?>" class="img-fluid rounded border p-1" style="max-height:160px;"> </div> <?php endif; ?> </div> <div class="mb-3"> <label class="form-label fw-bold">สถานะการจ่ายเงิน</label> <select name="status" class="form-select rounded-3"> <option value="pending" <?= $p['status'] === 'pending' ? 'selected' : '' ?>>รออนุมัติ (Pending)</option> <option value="processing" <?= $p['status'] === 'processing' ? 'selected' : '' ?>>กำลังโอนเงิน (Processing)</option> <option value="completed" <?= $p['status'] === 'completed' ? 'selected' : '' ?>>โอนเงินสำเร็จแล้ว (Completed)</option> <option value="rejected" <?= $p['status'] === 'rejected' ? 'selected' : '' ?>>ปฏิเสธคำขอ (Rejected)</option> </select> </div> <div class="mb-3"> <label class="form-label fw-bold">เลขอ้างอิงการโอนเงิน (Transaction Reference)</label> <input type="text" name="transaction_reference" class="form-control rounded-3" placeholder="เช่น TXN-123456789 หรือ เลข Slip ธนาคาร" value="<?= Security::e($p['transaction_reference'] ?? '') ?>"> </div> <div class="mb-3"> <label class="form-label fw-bold">หมายเหตุถึงร้านค้า (Admin Note)</label> <textarea name="admin_note" class="form-control rounded-3" rows="2" placeholder="เช่น โอนเงินเข้าบัญชีเรียบร้อยแล้ว"><?= Security::e($p['admin_note'] ?? '') ?></textarea> </div> </div> <div class="modal-footer border-0 p-3 pt-0"> <button type="button" class="btn btn-outline-secondary rounded-pill px-4" data-bs-dismiss="modal">ปิด</button> <button type="submit" class="btn btn-primary rounded-pill px-4 fw-bold">บันทึก</button> </div> </form> </div> </div> </div> <?php endforeach; ?> </tbody> </table> </div> <?php endif; ?> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.23 |
proxy
|
phpinfo
|
Settings