<?php
require_once 'includes/db.php';
$conn->query("CREATE TABLE IF NOT EXISTS important_sites (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    subtitle VARCHAR(255),
    image VARCHAR(255),
    link VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");

$conn->query("TRUNCATE TABLE important_sites");

$dummies = [
    ['title' => 'Ek Bharat', 'subtitle' => 'Shreshtha Bharat', 'image' => 'https://ui-avatars.com/api/?name=Ek+Bharat&background=0D8ABC&color=fff&size=150'],
    ['title' => 'Make in India', 'subtitle' => 'Govt Initiative', 'image' => 'https://ui-avatars.com/api/?name=Make+In+India&background=f39c12&color=fff&size=150'],
    ['title' => 'Fit India', 'subtitle' => 'Stay Healthy', 'image' => 'https://ui-avatars.com/api/?name=Fit+India&background=27ae60&color=fff&size=150'],
    ['title' => 'Election Comm.', 'subtitle' => 'Vote for Future', 'image' => 'https://ui-avatars.com/api/?name=Election+Comm&background=8e44ad&color=fff&size=150'],
    ['title' => 'RTI India', 'subtitle' => 'Right to Info', 'image' => 'https://ui-avatars.com/api/?name=RTI&background=c0392b&color=fff&size=150']
];

foreach($dummies as $d) {
    $conn->query("INSERT INTO important_sites (title, subtitle, image) VALUES ('{$d['title']}', '{$d['subtitle']}', '{$d['image']}')");
}
echo "Done";
?>
