File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/database/app/Views/seller/orders/print.php
Back
<?php /** * Print Shipping Label View * Designed for A4 printing with @media print CSS */ ?> <style> body { background: #f0f0f0; font-family: 'Sarabun', 'Segoe UI', Arial, sans-serif; } .print-toolbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #1a1a2e; padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem; } .print-toolbar a, .print-toolbar button { color: #fff; text-decoration: none; } .print-toolbar button { background: #0d6efd; border: none; padding: .4rem 1.2rem; border-radius: 8px; font-size: .9rem; cursor: pointer; } .print-toolbar a.back-btn { background: rgba(255,255,255,.1); padding: .4rem 1rem; border-radius: 8px; font-size: .9rem; } .print-page { background: white; max-width: 210mm; margin: 80px auto 40px; padding: 16mm; box-shadow: 0 4px 30px rgba(0,0,0,.15); border-radius: 4px; } /* Header */ .label-header { border-bottom: 3px solid #0d6efd; padding-bottom: 12px; margin-bottom: 16px; } .shop-name { font-size: 1.5rem; font-weight: 700; color: #0d6efd; } .order-num { font-size: 1.1rem; color: #6c757d; } /* Tracking section */ .tracking-box { border: 2px solid #0d6efd; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; } .tracking-id { font-size: 1.6rem; font-weight: 800; letter-spacing: .05em; color: #0d6efd; } /* Section boxes */ .section-box { border: 1px solid #dee2e6; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; } .section-box h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #6c757d; font-weight: 700; margin-bottom: 8px; } /* Items table */ .items-table { width: 100%; border-collapse: collapse; font-size: .9rem; } .items-table th { background: #f8f9fa; padding: 6px 10px; text-align: left; font-weight: 700; border-bottom: 2px solid #dee2e6; } .items-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; } .items-table tfoot td { border-top: 2px solid #dee2e6; font-weight: 700; } /* Divider */ .cut-line { border: none; border-top: 2px dashed #dee2e6; margin: 20px 0; } /* Print overrides */ @media print { .print-toolbar { display: none !important; } body { background: white; } .print-page { margin: 0; padding: 10mm; box-shadow: none; max-width: 100%; } .cut-line { border-top: 2px dashed #aaa; } } </style> <!-- Print Toolbar (screen only) --> <div class="print-toolbar no-print"> <a href="<?= APP_URL ?>/seller/orders/detail/<?= $order['id'] ?>" class="back-btn"> ← กลับ </a> <span class="text-white">ใบจัดส่ง #<?= Security::e($order['order_number']) ?></span> <button onclick="window.print()">🖨️ พิมพ์ใบจัดส่ง</button> </div> <!-- Print Label Content --> <div class="print-page"> <!-- Shop Header --> <div class="label-header d-flex justify-content-between align-items-start"> <div> <div class="shop-name">🏪 <?= Security::e($seller['shop_name'] ?? 'Shop 39') ?></div> <div class="order-num">คำสั่งซื้อ #<?= Security::e($order['order_number']) ?></div> <div class="text-muted" style="font-size:.85rem">วันที่สั่งซื้อ: <?= date('d/m/Y H:i', strtotime($order['created_at'])) ?></div> </div> <div class="text-end"> <div class="fw-bold" style="font-size:1rem">Shop 39</div> <div class="text-muted small">marketplace</div> </div> </div> <!-- Tracking + QR --> <div class="tracking-box"> <div> <div style="font-size:.8rem; color:#6c757d; font-weight:600; text-transform:uppercase; letter-spacing:.05em;">Tracking Number</div> <div class="tracking-id"><?= Security::e($order['tracking_number'] ?? 'N/A') ?></div> </div> <?php if ($qrCodeUrl): ?> <div class="text-center"> <img src="<?= Security::e($qrCodeUrl) ?>" alt="QR Code" style="width:100px; height:100px;"> <div style="font-size:.7rem; color:#6c757d; margin-top:4px;">สแกนติดตามพัสดุ</div> </div> <?php endif; ?> </div> <!-- Recipient Info --> <div class="section-box"> <h6>📦 ผู้รับ</h6> <div style="font-size:1.05rem; font-weight:700;"><?= Security::e($order['customer_name']) ?></div> <?php if (!empty($order['customer_phone'])): ?> <div><i>📞</i> <?= Security::e($order['customer_phone']) ?></div> <?php endif; ?> <div style="margin-top:6px; line-height:1.6; white-space:pre-line;"><?= Security::e($order['shipping_address']) ?></div> </div> <hr class="cut-line"> <!-- Order Items --> <div class="section-box"> <h6>🛒 รายการสินค้า</h6> <table class="items-table"> <thead> <tr> <th>สินค้า</th> <th>SKU</th> <th style="text-align:center">จำนวน</th> <th style="text-align:right">ราคา</th> <th style="text-align:right">รวม</th> </tr> </thead> <tbody> <?php foreach ($items as $item): ?> <tr> <td><?= Security::e($item['title']) ?></td> <td style="color:#6c757d; font-size:.8rem;"><?= Security::e($item['sku'] ?? '-') ?></td> <td style="text-align:center"><?= (int)$item['quantity'] ?></td> <td style="text-align:right">฿<?= number_format($item['price'], 2) ?></td> <td style="text-align:right">฿<?= number_format(($item['subtotal'] ?? $item['price'] * $item['quantity']), 2) ?></td> </tr> <?php endforeach; ?> </tbody> <tfoot> <?php if (!empty($order['discount_amount']) && $order['discount_amount'] > 0): ?> <tr> <td colspan="4" style="text-align:right; color:#dc3545;">ส่วนลด</td> <td style="text-align:right; color:#dc3545;">-฿<?= number_format($order['discount_amount'], 2) ?></td> </tr> <?php endif; ?> <tr> <td colspan="4" style="text-align:right">ยอดรวมทั้งสิ้น</td> <td style="text-align:right; color:#0d6efd; font-size:1.1rem;">฿<?= number_format($order['total_amount'], 2) ?></td> </tr> </tfoot> </table> </div> <!-- Footer Notes --> <div style="text-align:center; margin-top:16px; font-size:.8rem; color:#aaa;"> พิมพ์โดย Shop 39 | <?= date('d/m/Y H:i') ?> | ขอบคุณที่ใช้บริการ 🙏 </div> </div> <script> // Auto-print option // window.onload = () => window.print(); </script>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.23 |
proxy
|
phpinfo
|
Settings