150 lines
7.3 KiB
PHP
150 lines
7.3 KiB
PHP
<?php
|
|
require_once 'db/config.php';
|
|
require_once 'db/setup.php';
|
|
|
|
$equivalences = [];
|
|
try {
|
|
$pdo = db();
|
|
$stmt = $pdo->query("
|
|
SELECT
|
|
eq.EquivalenceID,
|
|
sl.ShippingLineName,
|
|
cc.CustomsDescription,
|
|
n4.N4Description,
|
|
eq.EffectiveDate,
|
|
eq.IsActive
|
|
FROM
|
|
equivalence_catalog eq
|
|
JOIN
|
|
shipping_lines sl ON eq.ShippingLineCode = sl.ShippingLineCode
|
|
JOIN
|
|
customs_container_types cc ON eq.CustomsKeyFK = cc.CustomsKey
|
|
JOIN
|
|
n4_container_types n4 ON eq.N4KeyFK = n4.N4Key
|
|
ORDER BY
|
|
sl.ShippingLineName, eq.EffectiveDate DESC
|
|
");
|
|
$equivalences = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
} catch (PDOException $e) {
|
|
// For now, just show a simple error.
|
|
die("Could not fetch data: " . $e->getMessage());
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Container Equivalence Catalog</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body>
|
|
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white sticky-top">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="#">Container Equivalences</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" aria-current="page" href="#">Equivalence Catalog</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-muted" href="#">Customs Types <small>(soon)</small></a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-muted" href="#">N4 Types <small>(soon)</small></a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-muted" href="#">Shipping Lines <small>(soon)</small></a>
|
|
</li>
|
|
</ul>
|
|
<span class="navbar-text">
|
|
<i class="bi bi-person-circle me-1"></i> Logged in as: <strong>Administrator</strong>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="container mt-4">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<h4 class="mb-0">Shipping Line Equivalence Catalog</h4>
|
|
<button class="btn btn-primary disabled" disabled><i class="bi bi-plus-circle me-1"></i> Add New</button>
|
|
</div>
|
|
<div class="row mt-3">
|
|
<div class="col-md-6">
|
|
<div class="input-group">
|
|
<span class="input-group-text"><i class="bi bi-search"></i></span>
|
|
<input type="text" class="form-control" placeholder="Search by description, line..." disabled>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<select class="form-select" disabled>
|
|
<option selected>Filter by Active Status...</option>
|
|
<option value="1">Active</option>
|
|
<option value="0">Inactive</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th scope="col">Shipping Line</th>
|
|
<th scope="col">Customs Description</th>
|
|
<th scope="col">N4 Description</th>
|
|
<th scope="col">Effective Date</th>
|
|
<th scope="col">Status</th>
|
|
<th scope="col">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (empty($equivalences)): ?>
|
|
<tr>
|
|
<td colspan="6" class="text-center text-muted p-4">No equivalence records found. The database might be empty.</td>
|
|
</tr>
|
|
<?php else: ?>
|
|
<?php foreach ($equivalences as $eq): ?>
|
|
<tr>
|
|
<td><?php echo htmlspecialchars($eq['ShippingLineName']); ?></td>
|
|
<td><?php echo htmlspecialchars($eq['CustomsDescription']); ?></td>
|
|
<td><?php echo htmlspecialchars($eq['N4Description']); ?></td>
|
|
<td><?php echo htmlspecialchars($eq['EffectiveDate']); ?></td>
|
|
<td>
|
|
<?php if ($eq['IsActive']): ?>
|
|
<span class="badge rounded-pill bg-success-subtle text-success-emphasis status-badge">Active</span>
|
|
<?php else: ?>
|
|
<span class="badge rounded-pill bg-danger-subtle text-danger-emphasis status-badge">Inactive</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td>
|
|
<a href="#" class="action-icon disabled" title="Edit"><i class="bi bi-pencil-square"></i></a>
|
|
<a href="#" class="action-icon disabled" title="Delete"><i class="bi bi-trash"></i></a>
|
|
<a href="#" class="action-icon disabled" title="History"><i class="bi bi-clock-history"></i></a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer text-muted">
|
|
Displaying <?php echo count($equivalences); ?> records.
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
</body>
|
|
</html>
|