<?php
$title =
'Workflow Stage Heatmap';

function wh_h($v)
{
    return htmlspecialchars(
        (string)$v,
        ENT_QUOTES,
        'UTF-8'
    );
}
?>

<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-fire text-danger"></i>

Workflow Stage Heatmap

</h2>

<hr>

<div class="alert alert-info">

Higher bars indicate more conferences currently sitting in that workflow stage.

</div>

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

<?php

$count =
(int)$row['total'];

$width =
max(
    3,
    min(
        100,
        $count * 10
    )
);

?>

<div class="mb-4">

<div class="d-flex justify-content-between">

<strong>

<?= wh_h($row['status']) ?>

</strong>

<span>

<?= $count ?>

Conference(s)

</span>

</div>

<div
class="progress"
style="height:28px;">

<div
class="progress-bar progress-bar-striped progress-bar-animated"
role="progressbar"
style="width: <?= $width ?>%;">

<?= $count ?>

</div>

</div>

</div>

<?php endforeach; ?>

</div>

</div>

</div>
