<?php

$title =
'Homepage Decision Board';

function hdb_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-gavel text-primary"></i>

Homepage Decision Board

</h2>

<p class="text-muted">

Manage workflow decisions across all homepage deployments.

</p>

<hr>

<div class="table-responsive">

<table class="table table-hover align-middle">

<thead>

<tr>

<th>Conference</th>
<th>Status</th>
<th>Chair</th>
<th>Last Update</th>
<th>Actions</th>

</tr>

</thead>

<tbody>

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

<tr>

<td>

<strong>

<?= hdb_h($row['conference_name']) ?>

</strong>

</td>

<td>

<span class="badge bg-primary">

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

</span>

</td>

<td>

<?= hdb_h($row['chair_name']) ?>

</td>

<td>

<?= hdb_h($row['updated_at']) ?>

</td>

<td>

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

<?php foreach($row['allowed_actions'] as $action): ?>

<form
method="post"
action="/easychair/admin/conference-home/decision-board/update">

<input
type="hidden"
name="conference_id"
value="<?= (int)$row['conference_id'] ?>">

<input
type="hidden"
name="status"
value="<?= hdb_h($action) ?>">

<button
class="btn btn-sm btn-outline-primary">

<?= ucfirst(
str_replace(
'_',
' ',
$action
)
) ?>

</button>

</form>

<?php endforeach; ?>

</div>

</td>

</tr>

<?php endforeach; ?>

</tbody>

</table>

</div>

</div>

</div>

</div>
