<div class="container-fluid">

<div class="card border-0 shadow-sm mb-4">

<div class="card-body">

<h2 class="fw-bold">
CrossRef Deposit Center
</h2>

<div class="text-muted">
CrossRef deposit preparation and metadata validation.
</div>

</div>

</div>

<div class="card border-0 shadow-sm">

<div class="card-header bg-primary text-white">

CrossRef Readiness

</div>

<div class="card-body">

<div class="table-responsive">

<table class="table table-bordered table-hover">

<thead>

<tr>

<th>ID</th>

<th>Submission</th>

<th>Title</th>

<th>DOI</th>

<th>Issue</th>

<th>Pages</th>

<th>Status</th>

</tr>

</thead>

<tbody>

<?php foreach($rows as $r): ?>

<tr>

<td>
<?= (int)$r['id'] ?>
</td>

<td>
<?= htmlspecialchars($r['submission_no']) ?>
</td>

<td>
<?= htmlspecialchars($r['title']) ?>
</td>

<td>

<?php if(!empty($r['doi'])): ?>

<span class="badge bg-success">
<?= htmlspecialchars($r['doi']) ?>
</span>

<?php else: ?>

<span class="badge bg-danger">
Missing DOI
</span>

<?php endif; ?>

</td>

<td>
<?= (int)$r['issue_id'] ?>
</td>

<td>

<?= htmlspecialchars(
    ($r['page_from'] ?? '-')
    . ' - '
    . ($r['page_to'] ?? '-')
) ?>

</td>

<td>

<?php if($r['deposit_status']=='Ready'): ?>

<span class="badge bg-success">
Ready
</span>

<?php else: ?>

<span class="badge bg-warning text-dark">
<?= htmlspecialchars($r['deposit_status']) ?>
</span>

<?php endif; ?>

</td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>

</div>

</div>
