certimine/views/dashboard.php
remaster a72656f9d4 CertiMine: aplicación PHP, API DC3 Peñasquito y documentación
- Portal bilingüe (Bootstrap), biblioteca FRM, consulta y perfiles con QR.
- Integración REST penasquito.wotbi.com (Token, búsqueda por passport y polling).
- Webhook de sincronización, esquema MariaDB y semillas FRM/NOM.
- Documentación en docs/ y extracto DatosPdf.txt; ejemplo de config sin secretos locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 17:56:36 -06:00

64 lines
2.5 KiB
PHP

<?php
declare(strict_types=1);
use CertiMine\I18n;
use CertiMine\Util;
/** @var array<string,mixed> $user */
/** @var array<string,mixed>|null $row */
/** @var list<array<string,mixed>> $certs */
/** @var list<array<string,mixed>> $courses */
require __DIR__ . '/partials/header.php';
$isEs = I18n::lang() === 'es';
$name = (string) $user['name'];
$statusLabel = static function (string $s): string {
return I18n::t('status_' . $s);
};
?>
<h1 class="h3 mb-2"><?= Util::h(I18n::t('dashboard_welcome', ['name' => $name])) ?></h1>
<p class="text-muted"><?= Util::h(I18n::t('dashboard_profile')) ?></p>
<div class="row g-4">
<div class="col-lg-6">
<div class="card p-3">
<h2 class="h5"><?= Util::h(I18n::t('profile_certs')) ?></h2>
<ul class="list-group list-group-flush">
<?php foreach ($certs as $c): ?>
<li class="list-group-item d-flex justify-content-between">
<div>
<div class="fw-semibold"><?= Util::h((string) $c['title']) ?></div>
<small class="text-muted">
<?= $c['nom_code'] ? Util::h((string) $c['nom_code']) . ' — ' : '' ?>
<?= Util::h($isEs ? (string) ($c['nom_name_es'] ?? '') : (string) ($c['nom_name_en'] ?? '')) ?>
</small>
</div>
<span class="badge text-bg-secondary align-self-center"><?= Util::h($statusLabel((string) $c['status'])) ?></span>
</li>
<?php endforeach; ?>
<?php if ($certs === []): ?>
<li class="list-group-item text-muted"><?= Util::h(I18n::t('no_results')) ?></li>
<?php endif; ?>
</ul>
</div>
</div>
<div class="col-lg-6">
<div class="card p-3">
<h2 class="h5"><?= Util::h(I18n::t('dashboard_courses')) ?></h2>
<ul class="list-group list-group-flush">
<?php foreach ($courses as $co): ?>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span><?= Util::h($isEs ? (string) $co['title_es'] : (string) $co['title_en']) ?></span>
<a class="btn btn-sm btn-outline-success" target="_blank" rel="noopener" href="<?= Util::h((string) $co['url']) ?>">LMS</a>
</li>
<?php endforeach; ?>
<?php if ($courses === []): ?>
<li class="list-group-item text-muted"><?= Util::h(I18n::t('no_results')) ?></li>
<?php endif; ?>
</ul>
</div>
</div>
</div>
<?php require __DIR__ . '/partials/footer.php'; ?>