<?php
$title = 'Homepage Workflow Timeline';
?>

<div class="container-fluid py-4">

<div class="card border-0 shadow-lg rounded-4">

<div class="card-body">

<h2 class="fw-bold">

<i class="fa fa-timeline text-primary"></i>

Homepage Workflow Timeline

</h2>

<hr>

<?php if(empty($timelineRows)): ?>

<div class="alert alert-info">

No workflow history found.

</div>

<?php else: ?>

<?php
$currentConference = null;
?>

<?php foreach($timelineRows as $row): ?>

<?php if($currentConference !== $row['conference_name']): ?>

<?php
$currentConference = $row['conference_name'];
?>

<div class="mt-5 mb-3">

<h4 class="fw-bold text-primary">

<?= htmlspecialchars($currentConference) ?>

</h4>

</div>

<?php endif; ?>

<div class="card mb-3 border-start border-5 border-primary">

<div class="card-body">

<div class="row">

<div class="col-md-3">

<strong>Status Change</strong>

<br>

<?= htmlspecialchars($row['old_status']) ?>

→

<?= htmlspecialchars($row['new_status']) ?>

</div>

<div class="col-md-3">

<strong>Changed By</strong>

<br>

<?= htmlspecialchars($row['user_name']) ?>

</div>

<div class="col-md-3">

<strong>Date</strong>

<br>

<?= htmlspecialchars($row['created_at']) ?>

</div>

<div class="col-md-3">

<strong>Remarks</strong>

<br>

<?= htmlspecialchars($row['remarks']) ?>

</div>

</div>

</div>

</div>

<?php endforeach; ?>

<?php endif; ?>

</div>

</div>

</div>
