File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/public/assets/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 if ($seller): ?> <?php if ($seller['status'] === 'approved'): ?> <div class="alert alert-success border-0 shadow-sm p-4"> <h5 class="fw-bold mb-2"><i class="bi bi-patch-check-fill me-2"></i>ร้านค้าของคุณได้รับการอนุมัติแล้ว!</h5> <p class="mb-3">คุณสามารถเข้าสู่ระบบจัดการร้านค้าเพื่อลงสินค้าและจัดการออเดอร์ได้ทันที</p> <a href="<?= APP_URL ?>/seller/dashboard" class="btn btn-success fw-bold px-4 rounded-pill">ไปยัง Seller Dashboard</a> </div> <?php elseif ($seller['status'] === 'pending'): ?> <div class="alert alert-warning border-0 shadow-sm p-4"> <h5 class="fw-bold mb-2"><i class="bi bi-clock-history me-2"></i>คำขอสมัครเปิดร้านค้ากำลังรอการอนุมัติ</h5> <p class="m-0">ทีมงานกำลังตรวจสอบเอกสารและข้อมูลร้านค้าของคุณ โปรดรอสักครู่</p> </div> <?php elseif ($seller['status'] === 'rejected'): ?> <div class="alert alert-danger border-0 shadow-sm p-4 mb-4"> <h5 class="fw-bold mb-2"><i class="bi bi-x-circle-fill me-2"></i>คำขอถูกปฏิเสธ</h5> <p class="mb-0">เหตุผล: <?= Security::e($seller['rejection_reason'] ?? 'ข้อมูลไม่ครบถ้วน') ?></p> </div> <?php endif; ?> <?php endif; ?> <?php if (!$seller || $seller['status'] === 'rejected'): ?> <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.25 |
proxy
|
phpinfo
|
Settings