55 lines
2.5 KiB
PHP
Executable File
55 lines
2.5 KiB
PHP
Executable File
<?php
|
|
require_once __DIR__ . '/../includes/session_check.php';
|
|
require_once __DIR__ . '/../includes/db.php';
|
|
|
|
// Fetch recurrent messages with commands
|
|
try {
|
|
$stmt = $pdo->query("SELECT name, telegram_command FROM recurrent_messages WHERE telegram_command IS NOT NULL AND telegram_command != '' ORDER BY name ASC");
|
|
$commands = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
} catch (PDOException $e) {
|
|
die("Error: No se pudieron cargar los comandos.");
|
|
}
|
|
|
|
require_once __DIR__ . '/../templates/header.php';
|
|
?>
|
|
|
|
<div class="container-fluid">
|
|
<h1 class="mt-4" data-translate="true">Lista de Comandos de Telegram</h1>
|
|
<p class="text-muted" data-translate="true">Esta es una lista de todos los comandos de plantilla que has configurado. Los usuarios pueden usar estos comandos en Telegram para recibir el mensaje correspondiente.</p>
|
|
|
|
<div class="card card-body p-4">
|
|
<?php if (empty($commands)): ?>
|
|
<div class="alert alert-info text-center" role="alert">
|
|
<i class="bi bi-info-circle-fill me-2"></i>
|
|
<span data-translate="true">No has configurado ningún comando de Telegram todavía.</span>
|
|
<br>
|
|
<span data-translate="true">Puedes asignar comandos a tus plantillas desde la página de</span>
|
|
<a href="recurrentes.php" class="alert-link" data-translate="true">Mensajes Recurrentes</a>.
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th scope="col" data-translate="true">Comando de Telegram</th>
|
|
<th scope="col" data-translate="true">Nombre de la Plantilla</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($commands as $command): ?>
|
|
<tr>
|
|
<td>
|
|
<code class="fs-5">#<?php echo htmlspecialchars($command['telegram_command']); ?></code>
|
|
</td>
|
|
<td><?php echo htmlspecialchars($command['name']); ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php require_once __DIR__ . '/../templates/footer.php'; ?>
|