jilo-web/public_html/templates/widget.php

40 lines
1.7 KiB
PHP
Raw Normal View History

2024-07-26 08:55:58 +00:00
2024-07-27 09:29:28 +00:00
<a style="text-decoration: none;" data-toggle="collapse" href="#collapse<?= $widget['name'] ?>" role="button" aria-expanded="true" aria-controls="collapse<?= $widget['name'] ?>">
2024-07-26 08:55:58 +00:00
<div class="card bg-light card-body"><?= $widget['title'] ?></div></a>
2024-07-27 09:29:28 +00:00
<div class="collapse show" id="collapse<?= $widget['name'] ?>">
2024-07-27 09:36:49 +00:00
<?php if ($time_range_specified) { ?>
<p class="m-3">time period: <strong><?= $from_time ?> - <?= $until_time ?></strong></p>
<?php } ?>
2024-07-26 08:55:58 +00:00
<div class="mb-5">
2024-07-27 09:29:28 +00:00
<?php if ($widget['full'] == true) { ?>
2024-07-26 08:55:58 +00:00
<table class="table table-striped table-hover table-bordered">
<thead class="thead-dark">
<tr>
2024-07-27 09:29:28 +00:00
<?php foreach ($widget['table_headers'] as $header) { ?>
2024-07-26 08:55:58 +00:00
<th scope="col"><?= htmlspecialchars($header) ?></th>
2024-07-27 09:29:28 +00:00
<?php } ?>
2024-07-26 08:55:58 +00:00
</tr>
</thead>
<tbody>
2024-07-27 09:29:28 +00:00
<?php foreach ($widget['table_records'] as $row) { ?>
2024-07-26 08:55:58 +00:00
<tr>
2024-07-27 09:29:28 +00:00
<?php foreach ($row as $key => $column) {
if ($key === 'conference ID') { ?>
<td><a href="<?= $app_root ?>?page=conferences&id=<?= htmlspecialchars($column ?? '') ?>"><?= htmlspecialchars($column ?? '') ?></a></td>
<?php } elseif ($key === 'conference name') { ?>
<td><a href="<?= $app_root ?>?page=conferences&name=<?= htmlspecialchars($column ?? '') ?>"><?= htmlspecialchars($column ?? '') ?></a></td>
<?php } else { ?>
<td><?= htmlspecialchars($column ?? '') ?></td>
<?php }
} ?>
2024-07-26 08:55:58 +00:00
</tr>
2024-07-27 09:29:28 +00:00
<?php } ?>
2024-07-26 08:55:58 +00:00
</tbody>
</table>
2024-07-27 09:29:28 +00:00
<?php } else { ?>
<p class="m-3">No matching records found.</p>
<?php } ?>
2024-07-26 08:55:58 +00:00
</div>
</div>