- Add analytics public URL input with copy button in redirect view - Fix deleteCreativeByRedirectId to handle missing creatives gracefully - Add copyAnalyticsUrl JavaScript function with visual feedback - Improve error handling in redirect deletion process
46 lines
1.7 KiB
PHP
46 lines
1.7 KiB
PHP
<?php
|
|
// Script para verificar tabelas no servidor
|
|
$host = 'localhost';
|
|
$port = 3306;
|
|
$dbname = 'redirects_moneyflix';
|
|
$username = 'redirects_user';
|
|
$password = 'mf_redirect_2025';
|
|
|
|
try {
|
|
$pdo = new PDO("mysql:host=$host;port=$port;dbname=$dbname;charset=utf8mb4", $username, $password);
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
echo "🔍 Verificando tabelas no servidor...\n\n";
|
|
|
|
// Verificar se advertising_creatives existe
|
|
$stmt = $pdo->query("SHOW TABLES LIKE 'advertising_creatives'");
|
|
$exists = $stmt->rowCount() > 0;
|
|
echo "📋 Tabela advertising_creatives: " . ($exists ? "✅ EXISTE" : "❌ NÃO EXISTE") . "\n";
|
|
|
|
if ($exists) {
|
|
// Verificar estrutura da tabela
|
|
$stmt = $pdo->query("DESCRIBE advertising_creatives");
|
|
$columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
echo "📊 Colunas da tabela advertising_creatives:\n";
|
|
foreach ($columns as $column) {
|
|
echo " - {$column['Field']} ({$column['Type']})\n";
|
|
}
|
|
|
|
// Contar registos
|
|
$stmt = $pdo->query("SELECT COUNT(*) as count FROM advertising_creatives");
|
|
$count = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
echo "📈 Total de registos: {$count['count']}\n";
|
|
}
|
|
|
|
// Verificar outras tabelas relacionadas
|
|
$tables = ['redirects', 'redirect_stats', 'redirect_filters'];
|
|
foreach ($tables as $table) {
|
|
$stmt = $pdo->query("SHOW TABLES LIKE '$table'");
|
|
$exists = $stmt->rowCount() > 0;
|
|
echo "📋 Tabela $table: " . ($exists ? "✅ EXISTE" : "❌ NÃO EXISTE") . "\n";
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
echo "❌ Erro: " . $e->getMessage() . "\n";
|
|
}
|