<?php
// Direct Live Database Connection
$host = 'localhost';
$db   = 'flightbo_ibvte';
$user = 'flightbo_ibvte';
$pass = 'flightbo_ibvte2';
$charset = 'utf8mb4';

$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
];

try {
    $pdo = new PDO($dsn, $user, $pass, $options);
    
    // Clear old sliders
    $pdo->exec("TRUNCATE TABLE sliders");
    
    // Insert Slide 1
    $stmt1 = $pdo->prepare("INSERT INTO sliders (title, description, image_path, button_text, button_link, status, display_order) VALUES (?, ?, ?, ?, ?, 'active', 1)");
    $stmt1->execute([
        "Empowering India Through Technical Education",
        "IBVTE provides national-level vocational, technical, and skill development programs to build a career-ready generation.",
        "assets/images/slide1.jpg",
        "Apply for Affiliation",
        "affiliation/apply.php"
    ]);

    // Insert Slide 2
    $stmt2 = $pdo->prepare("INSERT INTO sliders (title, description, image_path, button_text, button_link, status, display_order) VALUES (?, ?, ?, ?, ?, 'active', 2)");
    $stmt2->execute([
        "National Skill Development Initiatives",
        "Partnering with colleges and centers across the country to deliver standard, high-quality, practical vocational curricula.",
        "assets/images/slide2.jpg",
        "Explore Departments",
        "all-courses.php"
    ]);

    echo "Live sliders database populated successfully!\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
