-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewtracking.php
70 lines (60 loc) · 2.72 KB
/
viewtracking.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
define('APP_RUNNING', 1);
ob_start();
session_start();
require_once 'globals.include.php';
if (empty($_GET["tracknum"])) {
header("Location: tracking.php");
}
$tracknum = $_GET["tracknum"];
$stmt = $dbConn->prepare("SELECT * FROM parcels WHERE code = ?");
$stmt->execute([$tracknum]);
if ($stmt->rowCount() > 0) {
$parcel = $stmt->fetch();
} else {
$parcel = "That parcel could not be found in the system.";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>iParcel</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<?php include 'navbar.include.php'; ?>
<div class="container py-5 h-100">
<div class="row">
<div class="col">
<h2>Tracking Results</h2>
<div class="card">
<div class="card-body">
<h5 class="card-title">Package Status:</h5>
<?php $dt = new DateTime($parcel["expected_delivery_at"]); ?>
<p class="card-text">Your package is currently <?php echo getDeliveryStatus($parcel["status"]); ?> and scheduled for delivery on <?= $dt->format('l, F j, Y'); ?>. <?php if ($parcel["status"] == 4) : ?>
<span class="badge rounded-pill text-bg-danger">Late</span>
<?php endif; ?>
</p>
<?php if ($parcel["type"] == 1) : ?>
<div class="alert alert-warning" role="alert">
Your package is considered heavy because it is more than 10 pounds. Your billing will reflect that.
</div>
<?php endif; ?>
</div>
</div>
</div>
<div class="col">
<img src="img/shipping-stock-photo.jpg" class="rounded-3 shadow-lg">
</div>
</div>
</div>
<?php include 'footer.include.php'; ?>
</body>
</html>