|
1 | 1 | <?php |
| 2 | +include_once 'functions/connection.php'; |
2 | 3 | session_start(); |
3 | 4 | if (!isset($_SESSION['username'])) { |
4 | 5 | header('location:login.php'); |
5 | 6 | } |
6 | | - |
7 | 7 | $id = $_GET['id']; |
8 | 8 | $kilo = $_GET['kilo']; |
9 | 9 | $type = $_GET['type']; |
|
12 | 12 | $total = $_GET['total']; |
13 | 13 | $get_tracking_url = getHostByName(getHostName()) . dirname($_SERVER['PHP_SELF']) . '/tracking.php?id=' . $id; |
14 | 14 |
|
| 15 | +$sql = 'SELECT Transactions.id, customers.fullname AS fullname |
| 16 | +FROM Transactions |
| 17 | +JOIN users ON Transactions.user_id = users.id |
| 18 | +JOIN customers ON Transactions.customer_id = customers.id |
| 19 | +WHERE Transactions.id = :id'; |
| 20 | +$stmt = $db->prepare($sql); |
| 21 | +$stmt->execute(['id' => $id]); |
| 22 | +$result = $stmt->fetch(); |
| 23 | + |
| 24 | + |
15 | 25 | ?> |
16 | 26 | <!DOCTYPE html> |
17 | 27 | <html data-bs-theme="light" lang="en"> |
|
36 | 46 | <div class="card-body text-center p-4"> |
37 | 47 | <span class="badge rounded-pill bg-primary position-absolute top-0 start-50 translate-middle text-uppercase">Reciept</span> |
38 | 48 | <h6 class="text-uppercase text-muted card-subtitle">Total</h6> |
39 | | - <h4 class="display-4 fw-bold card-title">₱<?php echo $total; ?></h4> |
| 49 | + <h4 class="display-4 fw-bold card-title">₱<?php echo number_format($total, 2); ?></h4> |
40 | 50 | <canvas id="qr-code"></canvas> |
41 | 51 | </div> |
42 | 52 | <div class="card-footer p-4"> |
43 | 53 | <div id="receipt"> |
44 | 54 |
|
45 | 55 | <ul class="list-unstyled"> |
46 | 56 | <li class="d-flex mb-2"><span class="bs-icon-xs bs-icon-rounded bs-icon-primary-light bs-icon me-2"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-check2-circle"> |
47 | | - <path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0z"></path> |
48 | | - <path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l7-7z"></path> |
| 57 | + <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path> |
| 58 | + <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"></path> |
| 59 | + </svg></span><span><strong>Customer : <?php echo $result['fullname']; ?></strong></span></li> |
| 60 | + <li class="d-flex mb-2"><span class="bs-icon-xs bs-icon-rounded bs-icon-primary-light bs-icon me-2"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-check2-circle"> |
| 61 | + <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path> |
| 62 | + <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"></path> |
49 | 63 | </svg></span><span><strong>Kg/Kilo : <?php echo $kilo; ?></strong></span></li> |
50 | 64 | <li class="d-flex mb-2"><span class="bs-icon-xs bs-icon-rounded bs-icon-primary-light bs-icon me-2"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-check2-circle"> |
51 | | - <path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0z"></path> |
52 | | - <path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l7-7z"></path> |
53 | | - </svg></span><span><strong>Type : <?php echo $type; ?> - ₱<?php echo $type_price; ?></strong></span></li> |
| 65 | + <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path> |
| 66 | + <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"></path> |
| 67 | + </svg></span><span><strong>Type : <?php echo $type; ?> - ₱<?php echo number_format($type_price, 2); ?></strong></span></li> |
54 | 68 | <li class="d-flex mb-2"><span class="bs-icon-xs bs-icon-rounded bs-icon-primary-light bs-icon me-2"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-check2-circle"> |
55 | | - <path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0z"></path> |
56 | | - <path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l7-7z"></path> |
57 | | - </svg></span><span><strong>Products</strong> : <strong>₱<?php echo $products; ?></strong></span></li> |
| 69 | + <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path> |
| 70 | + <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"></path> |
| 71 | + </svg></span><span><strong>Products</strong> : <strong>₱<?php echo number_format($products, 2); ?></strong></span></li> |
58 | 72 | <li class="d-flex mb-2"><span class="bs-icon-xs bs-icon-rounded bs-icon-primary-light bs-icon me-2"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-check-circle"> |
59 | 73 | <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path> |
60 | 74 | <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"></path> |
61 | | - </svg></span><span><strong>Total : ₱<?php echo $total; ?></strong></span></li> |
| 75 | + </svg></span><span><strong>Total : ₱<?php echo number_format($total, 2); ?></strong></span></li> |
62 | 76 | </ul> |
63 | 77 | </div> |
64 | 78 | <a class="btn btn-primary d-block w-100" role="button" onclick="printReceipt()">Print</a> |
|
0 commit comments