File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/database/app/Views/seller/orders/print_slip.php
Back
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?= Security::e($title ?? 'ใบปะหน้าพัสดุ') ?></title> <!-- Bootstrap 5 CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css"> <!-- JsBarcode Library for rendering scannable barcodes --> <script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js"></script> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f8f9fa; color: #212529; } .shipping-label-card { max-width: 800px; margin: 20px auto; background: #ffffff; border: 2px solid #334155; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } .label-header { background-color: #1e293b; color: #ffffff; padding: 16px 24px; border-bottom: 2px solid #0f172a; } .address-box { border: 1px solid #cbd5e1; border-radius: 6px; padding: 14px 18px; height: 100%; background-color: #fafafa; } .barcode-box { display: flex; flex-direction: column; align-items: center; justify-content: center; } .barcode-box svg { max-width: 220px; height: 55px; } @media print { .no-print { display: none !important; } body { background-color: #ffffff; } .shipping-label-card { border: 2px solid #000000; box-shadow: none; margin: 0 auto; width: 100%; } .label-header { background-color: #000000 !important; color: #ffffff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } } </style> </head> <body> <!-- Control Actions Bar (Hidden on Print) --> <div class="no-print bg-white border-bottom shadow-sm p-3 mb-4 text-center"> <button type="button" onclick="window.print()" class="btn btn-primary btn-lg rounded-pill px-4 fw-bold shadow-sm me-2"> <i class="bi bi-printer-fill me-2"></i>พิมพ์ใบปะหน้าพัสดุ (Print Shipping Label) </button> <button type="button" onclick="window.close()" class="btn btn-outline-secondary btn-lg rounded-pill px-4"> ปิดหน้านี้ </button> </div> <div class="shipping-label-card"> <!-- Label Header --> <div class="label-header d-flex justify-content-between align-items-center"> <div> <h4 class="fw-bold m-0"><i class="bi bi-truck me-2"></i>ใบปะหน้าพัสดุ & รายการสินค้า</h4> <div class="small opacity-75 mt-1">ร้านค้า: <?= Security::e($seller['shop_name'] ?? 'Marketplace Store') ?></div> </div> <div class="text-end"> <div class="fw-bold fs-5">ออเดอร์ #<?= Security::e($order['order_number']) ?></div> <div class="small opacity-75"><?= date('d/m/Y H:i', strtotime($order['created_at'])) ?></div> </div> </div> <div class="p-4"> <!-- Sender & Receiver Address Grid --> <div class="row g-3 mb-4"> <!-- Sender Info --> <div class="col-md-6"> <div class="address-box"> <div class="badge bg-secondary text-white mb-2"><i class="bi bi-shop me-1"></i>ผู้ส่ง (Sender / Shop)</div> <h6 class="fw-bold m-0"><?= Security::e($seller['shop_name']) ?></h6> <div class="small text-muted mt-1"><i class="bi bi-telephone me-1"></i>โทร: <?= Security::e($seller['phone']) ?></div> <div class="small text-secondary mt-1"><i class="bi bi-geo-alt me-1"></i><?= nl2br(Security::e($seller['address'])) ?></div> </div> </div> <!-- Recipient Info --> <div class="col-md-6"> <div class="address-box border-primary bg-light"> <div class="badge bg-primary text-white mb-2"><i class="bi bi-person-fill me-1"></i>ผู้รับ (Recipient / Customer)</div> <h5 class="fw-bold text-primary m-0"><?= Security::e($order['customer_name']) ?></h5> <div class="fw-bold text-dark mt-1"><i class="bi bi-telephone-fill me-1 text-success"></i>โทร: <?= Security::e($order['customer_phone'] ?? '-') ?></div> <div class="small text-dark mt-2 fw-semibold"><i class="bi bi-geo-alt-fill me-1 text-danger"></i>ที่อยู่จัดส่ง:</div> <div class="p-2 bg-white rounded border border-primary-subtle text-dark fw-bold mt-1"> <?= nl2br(Security::e($order['shipping_address'])) ?> </div> </div> </div> </div> <!-- Order Barcode Section --> <div class="text-center p-3 mb-4 bg-light rounded border border-dashed"> <span class="text-muted small fw-bold d-block mb-1">บาร์โค้ดคำสั่งซื้อ (Order Number Barcode)</span> <svg id="orderNumberBarcode"></svg> </div> <!-- Product Items & Barcodes Table --> <h6 class="fw-bold text-dark mb-3"><i class="bi bi-box-seam me-2 text-primary"></i>รายการสินค้าที่ต้องจัดส่ง (Packing Checklist & Barcodes)</h6> <table class="table table-bordered align-middle"> <thead class="table-dark"> <tr> <th style="width: 5%;">#</th> <th style="width: 40%;">ชื่อสินค้า / ตัวเลือกไซส์</th> <th style="width: 15%; text-align: center;">จำนวน</th> <th style="width: 20%;">SKU สินค้า</th> <th style="width: 20%; text-align: center;">บาร์โค้ดสินค้า (Product Barcode)</th> </tr> </thead> <tbody> <?php foreach ($items as $idx => $it): ?> <tr> <td class="fw-bold text-center"><?= $idx + 1 ?></td> <td> <div class="fw-bold"><?= Security::e($it['title']) ?></div> <?php if (!empty($it['variant_info'])): ?> <span class="badge bg-info text-dark mt-1">ตัวเลือก: <?= Security::e($it['variant_info']) ?></span> <?php endif; ?> </td> <td class="text-center fw-bold fs-5 text-primary">x<?= (int)$it['quantity'] ?></td> <td class="font-monospace small fw-bold"><?= Security::e($it['sku']) ?></td> <td class="text-center"> <div class="barcode-box"> <svg class="item-barcode" data-value="<?= Security::e($it['barcode']) ?>"></svg> <div class="font-monospace small fw-bold text-muted mt-1"><?= Security::e($it['barcode']) ?></div> </div> </td> </tr> <?php endforeach; ?> </tbody> </table> <!-- COD / Payment Method Notice on Shipping Slip --> <?php if (($order['payment_method'] ?? 'prepaid') === 'cod'): ?> <div class="alert alert-warning border border-2 border-danger p-3 mb-4 rounded-3 d-flex justify-content-between align-items-center"> <div> <span class="badge bg-danger text-white fs-6 px-3 py-2 text-uppercase mb-1"><i class="bi bi-cash me-1"></i>เก็บเงินปลายทาง (COD)</span> <div class="small fw-bold text-dark mt-1">พนักงานขนส่งโปรดเรียกเก็บเงินสดจากผู้รับก่อนส่งมอบพัสดุ</div> </div> <div class="text-end"> <span class="text-muted small d-block">ยอดเงินที่ต้องเรียกเก็บ:</span> <span class="fs-3 fw-bold text-danger">฿<?= number_format($order['total_amount'], 2) ?></span> </div> </div> <?php else: ?> <div class="alert alert-success border border-success p-2 mb-4 rounded-3 d-flex justify-content-between align-items-center"> <div> <span class="badge bg-success text-white px-2 py-1"><i class="bi bi-check-circle me-1"></i>ชำระเงินต้นทางแล้ว (Prepaid)</span> <span class="small text-muted ms-2">ไม่ต้องเก็บเงินปลายทาง</span> </div> <div class="fw-bold text-success">฿<?= number_format($order['total_amount'], 2) ?></div> </div> <?php endif; ?> <div class="d-flex justify-content-between align-items-center mt-4 pt-3 border-top"> <div class="small text-muted"> พิมพ์เมื่อ: <?= date('d/m/Y H:i:s') ?> | เอกสารกำกับการจัดส่งสินค้า </div> <div class="fw-bold text-dark"> ยอดรวมคำสั่งซื้อ: <span class="text-primary fs-5">฿<?= number_format($order['total_amount'], 2) ?></span> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { // Render Order Number Barcode try { JsBarcode("#orderNumberBarcode", "<?= Security::e($order['order_number']) ?>", { format: "CODE128", width: 2, height: 50, displayValue: true, fontSize: 14 }); } catch(e) { console.error(e); } // Render Item Barcodes document.querySelectorAll('.item-barcode').forEach(function(svgElem) { const val = svgElem.getAttribute('data-value'); if (val) { try { JsBarcode(svgElem, val, { format: "CODE128", width: 1.5, height: 40, displayValue: false }); } catch(e) { console.error(e); } } }); }); </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings