funcional

This commit is contained in:
lizandrogd
2026-01-12 15:54:04 -05:00
parent 4b7bcb6924
commit 50fc690b1b
17 changed files with 2089 additions and 130 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* Ver estructura de la tabla message_templates
*/
require_once 'config/config.php';
header('Content-Type: text/plain; charset=utf-8');
try {
$db = Database::getInstance();
echo "=== ESTRUCTURA DE TABLA message_templates ===\n\n";
// Describir la tabla
$stmt = $db->query("DESCRIBE message_templates");
$columns = $stmt->fetchAll();
echo "Columnas disponibles:\n";
foreach ($columns as $column) {
echo "{$column['Field']} ({$column['Type']}) - {$column['Null']} - {$column['Default']}\n";
}
echo "\n=== INTENTAR INSERCIÓN SIMPLE ===\n";
// Intentar inserción con campos mínimos
$stmt = $db->query(
"INSERT INTO message_templates (template_name, language_code, status) VALUES (?, ?, ?)",
['hello_world', 'en_US', 'approved']
);
if ($stmt) {
echo "✅ Plantilla 'hello_world' agregada exitosamente\n";
}
// Verificar que se agregó
echo "\n📋 Plantillas en la BD:\n";
$stmt = $db->query("SELECT * FROM message_templates");
$templates = $stmt->fetchAll();
foreach ($templates as $template) {
echo "{$template['template_name']} ({$template['language_code']}) - {$template['status']}\n";
}
} catch (Exception $e) {
echo "❌ Error: " . $e->getMessage() . "\n";
}
?>