<?php
$host = 'localhost:3306';
$dbname = 'gqdcvggs_managements';
$username = 'gqdcvggs';
$password = 'imaors_management.346980*#@-onlyforcpanel;forchange';

try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password, [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        PDO::ATTR_EMULATE_PREPARES => false
    ]);

    $pdo->exec("CREATE TABLE IF NOT EXISTS `imators-systems-billboard` (
        id INT AUTO_INCREMENT PRIMARY KEY,
        serial VARCHAR(50) NOT NULL UNIQUE,
        config TEXT NOT NULL,
        status ENUM('active', 'stopped') NOT NULL DEFAULT 'active',
        stop_message TEXT NULL,
        last_seen DATETIME NOT NULL,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    )");
} catch (PDOException $e) {
    die("Erreur de connexion à la base de données: " . $e->getMessage());
}