File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/app/Views/seller/apply.php
Back
<div class="container py-5"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card border-0 shadow-sm rounded-3"> <div class="card-body p-4 p-md-5"> <h3 class="fw-bold text-primary mb-3"><i class="bi bi-shop me-2"></i>สมัครเป็นร้านค้า (Seller Application)</h3> <p class="text-muted mb-4">ใช้บัญชีผู้ใช้ปัจจุบันเพื่อขยายเป็นบัญชีผู้ขาย เมื่อได้รับอนุมัติแล้ว จะสามารถจัดการสินค้าและรับออเดอร์ได้ทันที</p> <?php $isDeleted = $seller && !empty($seller['deleted_at']); $status = $seller['status'] ?? ''; ?> <?php if ($seller && !$isDeleted): ?> <?php if ($status === 'approved'): ?> <!-- 1. ACTIVE / APPROVED STORE --> <div class="alert alert-success border-0 shadow-sm p-4 rounded-4 text-center mb-4"> <div class="fs-1 text-success mb-2"><i class="bi bi-patch-check-fill"></i></div> <h4 class="fw-bold text-success mb-2">ร้านค้าของคุณได้รับการอนุมัติแล้ว!</h4> <p class="text-success-emphasis mb-1">Your store has been approved!</p> <p class="text-muted small mb-4">You can access your Seller Dashboard to manage products and orders.<br>คุณสามารถเข้าสู่ระบบจัดการร้านค้าเพื่อลงสินค้าและจัดการออเดอร์ได้ทันที</p> <a href="<?= APP_URL ?>/seller/dashboard" class="btn btn-success fw-bold px-4 py-2 rounded-pill shadow-sm"> <i class="bi bi-speedometer2 me-2"></i>ไปยัง Seller Dashboard (Go to Seller Dashboard) </a> </div> <?php elseif ($status === 'suspended'): ?> <!-- 2. SUSPENDED STORE --> <div class="alert alert-warning border-0 shadow-sm p-4 rounded-4 text-center mb-4 bg-warning bg-opacity-10 border-start border-warning border-4"> <div class="fs-1 text-warning mb-2"><i class="bi bi-pause-circle-fill"></i></div> <h4 class="fw-bold text-warning-emphasis mb-2">ร้านค้าของคุณถูกระงับการใช้งานชั่วคราว</h4> <p class="fw-semibold text-warning-emphasis mb-1">Your store has been temporarily suspended.</p> <p class="text-secondary small mb-3"> Your store has been suspended. Please contact the administrator for more information.<br> ร้านค้าของคุณถูกระงับการให้บริการชั่วคราว โปรดติดต่อผู้ดูแลระบบเพื่อขอข้อมูลเพิ่มเติมหรือดำเนินการแก้ไข </p> <?php if (!empty($seller['suspended_reason'])): ?> <div class="badge bg-warning text-dark p-2 px-3 rounded-3 text-wrap small"> <i class="bi bi-info-circle me-1"></i>สาเหตุ: <?= Security::e($seller['suspended_reason']) ?> </div> <?php endif; ?> </div> <?php elseif ($status === 'banned'): ?> <!-- 3. BANNED STORE --> <div class="alert alert-danger border-0 shadow-sm p-4 rounded-4 text-center mb-4 bg-danger bg-opacity-10 border-start border-danger border-4"> <div class="fs-1 text-danger mb-2"><i class="bi bi-slash-circle-fill"></i></div> <h4 class="fw-bold text-danger mb-2">ร้านค้าของคุณถูกแบน</h4> <p class="fw-semibold text-danger mb-1">Your store has been banned.</p> <p class="text-secondary small mb-0"> Your store has been banned because it violated the Marketplace rules. Please contact the administrator if you believe this was a mistake.<br> ร้านค้าของคุณถูกระงับสิทธิ์ถาวรเนื่องจากละเมิดกฎและเงื่อนไขของ Marketplace หากท่านเชื่อว่าเป็นความผิดพลาด กรุณาติดต่อผู้ดูแลระบบ </p> </div> <?php elseif ($status === 'pending'): ?> <!-- PENDING APPROVAL --> <div class="alert alert-info border-0 shadow-sm p-4 rounded-4 text-center mb-4 bg-primary bg-opacity-10 border-start border-primary border-4"> <div class="fs-1 text-primary mb-2"><i class="bi bi-clock-history"></i></div> <h4 class="fw-bold text-primary mb-2">คำขอเปิดร้านค้าอยู่ระหว่างการตรวจสอบ</h4> <p class="text-muted small mb-0">ทีมงานกำลังตรวจสอบเอกสารและข้อมูลร้านค้าของคุณ โปรดรอการอนุมัติจากผู้ดูแลระบบ</p> </div> <?php elseif ($status === 'rejected'): ?> <!-- REJECTED APPLICATION --> <div class="alert alert-danger border-0 shadow-sm p-4 rounded-4 mb-4"> <div class="d-flex align-items-center gap-3"> <div class="fs-1 text-danger"><i class="bi bi-x-circle-fill"></i></div> <div> <h5 class="fw-bold text-danger mb-1">คำขอเปิดร้านค้าถูกปฏิเสธ</h5> <p class="mb-0 text-muted small">เหตุผล: <?= Security::e($seller['rejection_reason'] ?? 'ข้อมูลไม่ครบถ้วนหรือไม่ผ่านเกณฑ์') ?></p> <p class="mb-0 text-primary small mt-1">ท่านสามารถแก้ไขข้อมูลและส่งคำขอสมัครเปิดร้านค้าใหม่ได้จากแบบฟอร์มด้านล่าง</p> </div> </div> </div> <?php else: ?> <!-- 6. UNKNOWN STATUS --> <div class="alert alert-secondary border-0 shadow-sm p-4 rounded-4 text-center mb-4"> <div class="fs-1 text-secondary mb-2"><i class="bi bi-question-circle-fill"></i></div> <h4 class="fw-bold text-dark mb-2">ไม่สามารถตรวจสอบสถานะร้านค้าได้</h4> <p class="text-muted small mb-1">Unable to verify store status.</p> <p class="text-muted small mb-0">Please contact the administrator. / กรุณาติดต่อผู้ดูแลระบบ</p> </div> <?php endif; ?> <?php elseif ($isDeleted): ?> <!-- 4. DELETED STORE --> <div class="alert alert-danger border-0 shadow-sm p-4 rounded-4 text-center mb-4 bg-danger bg-opacity-10 border-start border-danger border-4"> <div class="fs-1 text-danger mb-2"><i class="bi bi-trash3-fill"></i></div> <h4 class="fw-bold text-danger mb-2">ไม่พบร้านค้า (Store Not Found)</h4> <p class="fw-semibold text-danger mb-1">Your store has been deleted from the system or you no longer have permission to access this store.</p> <p class="text-secondary small mb-0"> Please contact the administrator if you believe this is an error.<br> ร้านค้าของคุณถูกลบออกจากระบบหรือคุณไม่มีสิทธิ์เข้าถึงร้านค้านี้อีกต่อไป กรุณาติดต่อผู้ดูแลระบบหากเชื่อว่าเกิดข้อผิดพลาด </p> </div> <?php endif; ?> <?php // Show application form only if no store profile exists, or if previous application was rejected $canShowForm = (!$seller || $seller['status'] === 'rejected'); ?> <?php if ($canShowForm): ?> <form action="<?= APP_URL ?>/seller/apply" method="POST"> <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"> <div class="mb-3"> <label class="form-label font-semibold">ชื่อร้านค้า</label> <input type="text" name="shop_name" class="form-control" value="<?= Security::e($seller['shop_name'] ?? '') ?>" required> </div> <div class="mb-3"> <label class="form-label font-semibold">รายละเอียดร้านค้า</label> <textarea name="description" class="form-control" rows="3"><?= Security::e($seller['description'] ?? '') ?></textarea> </div> <div class="row g-3 mb-3"> <div class="col-md-6"> <label class="form-label font-semibold">เบอร์โทรศัพท์ร้านค้า</label> <input type="text" name="phone" class="form-control" value="<?= Security::e($seller['phone'] ?? $user['phone']) ?>" required> </div> <div class="col-md-6"> <label class="form-label font-semibold">เบอร์ PromptPay (สำหรับรับเงิน)</label> <input type="text" name="promptpay_number" class="form-control" value="<?= Security::e($seller['promptpay_number'] ?? '') ?>"> </div> </div> <div class="mb-3"> <label class="form-label font-semibold">เลขที่บัญชีธนาคาร</label> <input type="text" name="bank_account" class="form-control" placeholder="เช่น KBANK 123-4-56789-0" value="<?= Security::e($seller['bank_account'] ?? '') ?>"> </div> <div class="mb-4"> <label class="form-label font-semibold">ที่อยู่ร้านค้า / สถานที่จัดส่งสินค้า</label> <textarea name="address" id="shopAddress" class="form-control mb-2" rows="2" required><?= Security::e($seller['address'] ?? '') ?></textarea> </div> <!-- Map Pinning Section --> <div class="mb-4"> <label class="form-label font-semibold d-flex justify-content-between align-items-center"> <span>ปักหมุดตำแหน่งร้านค้าบนแผนที่</span> <button type="button" id="searchAddressBtn" class="btn btn-sm btn-outline-secondary">ค้นหาจากที่อยู่ด้านบน</button> </label> <div id="mapApply" style="height: 300px; border-radius: 8px;" class="border"></div> <div class="form-text mt-1 text-muted">คลิกเลือกตำแหน่งร้านค้าของคุณบนแผนที่เพื่อปักหมุด</div> <input type="hidden" name="latitude" id="applyLat" value="<?= Security::e($seller['latitude'] ?? '') ?>"> <input type="hidden" name="longitude" id="applyLng" value="<?= Security::e($seller['longitude'] ?? '') ?>"> </div> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"> <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script> <script> document.addEventListener('DOMContentLoaded', function() { var defaultLat = 13.7563; var defaultLng = 100.5018; var initialLat = parseFloat(document.getElementById('applyLat').value) || defaultLat; var initialLng = parseFloat(document.getElementById('applyLng').value) || defaultLng; var map = L.map('mapApply').setView([initialLat, initialLng], 13); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); var marker; if (document.getElementById('applyLat').value && document.getElementById('applyLng').value) { marker = L.marker([initialLat, initialLng], { draggable: true }).addTo(map); } function updateLatLng(lat, lng) { document.getElementById('applyLat').value = lat.toFixed(8); document.getElementById('applyLng').value = lng.toFixed(8); if (!marker) { marker = L.marker([lat, lng], { draggable: true }).addTo(map); marker.on('dragend', function(e) { var position = marker.getLatLng(); updateLatLng(position.lat, position.lng); }); } else { marker.setLatLng([lat, lng]); } } map.on('click', function(e) { updateLatLng(e.latlng.lat, e.latlng.lng); }); document.getElementById('searchAddressBtn').addEventListener('click', function() { var addr = document.getElementById('shopAddress').value; if (!addr) return alert('กรุณากรอกที่อยู่เพื่อค้นหา'); fetch('https://nominatim.openstreetmap.org/search?format=json&q=' + encodeURIComponent(addr)) .then(res => res.json()) .then(data => { if (data && data.length > 0) { var lat = parseFloat(data[0].lat); var lng = parseFloat(data[0].lon); map.setView([lat, lng], 15); updateLatLng(lat, lng); } else { alert('ไม่พบสถานที่ดังกล่าว กรุณาปักหมุดด้วยตนเอง'); } }); }); }); </script> <button type="submit" class="btn btn-primary px-4 py-2 fw-bold shadow-sm rounded-pill">ยื่นคำขอสมัครร้านค้า</button> </form> <?php endif; ?> </div> </div> </div> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings