<?php
$title =
'Homepage Executive Control Center';

function hec_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 mb-4">

<div class="card-body">

<h2 class="fw-bold">

<i class="fa fa-gauge-high text-primary"></i>

Homepage Executive Control Center

</h2>

<div class="text-muted">

Executive overview of homepage workflow operations.

</div>

</div>

</div>

<div class="row g-4 mb-4">

<?php foreach($summaryCards as $card): ?>

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

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

<div class="card-body text-center">

<div class="text-muted small">

<?= hec_h($card['label']) ?>

</div>

<div class="fs-1 fw-bold">

<?= (int)$card['value'] ?>

</div>

</div>

</div>

</div>

<?php endforeach; ?>

</div>

<div class="row g-4">

<div class="col-lg-6">

<div class="card border-0 shadow-sm rounded-4 h-100">

<div class="card-body">

<h5 class="fw-bold">

Critical Alerts

</h5>

<hr>

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

<div class="alert alert-success">

No active alerts.

</div>

<?php else: ?>

<ul class="list-group">

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

<li class="list-group-item">

<strong>

<?= hec_h($row['short_name']) ?>

</strong>

<br>

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

<br>

<?= hec_h($row['message']) ?>

</li>

<?php endforeach; ?>

</ul>

<?php endif; ?>

</div>

</div>

</div>

<div class="col-lg-6">

<div class="card border-0 shadow-sm rounded-4 h-100">

<div class="card-body">

<h5 class="fw-bold">

Current Workflow Distribution

</h5>

<hr>

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

<div class="mb-3">

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

<span>

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

</span>

<span>

<?= (int)$row['total'] ?>

</span>

</div>

<div class="progress">

<div
class="progress-bar"
style="width: <?= min(100,(int)$row['total']*10) ?>%;">

</div>

</div>

</div>

<?php endforeach; ?>

</div>

</div>

</div>

</div>

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

<div class="card-body">

<h5 class="fw-bold">

Executive Quick Links

</h5>

<hr>

<div class="d-flex flex-wrap gap-2">

<a
class="btn btn-primary"
href="/easychair/admin/conference-home/workflow-kpi">

KPI Center

</a>

<a
class="btn btn-success"
href="/easychair/admin/conference-home/workflow-duration">

Duration Analytics

</a>

<a
class="btn btn-warning"
href="/easychair/admin/conference-home/workflow-heatmap">

Heatmap

</a>

<a
class="btn btn-danger"
href="/easychair/admin/conference-home/sla-center">

SLA Center

</a>

<a
class="btn btn-dark"
href="/easychair/admin/conference-home/automation-runner">

Automation Runner

</a>

</div>

</div>

</div>

</div>
