<?php
try {
    $pdo = new PDO("mysql:host=localhost;dbname=digital_practice", "root", ""); 
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    // Clear existing samples if any to avoid duplicates if re-run
    $pdo->exec("DELETE FROM blog_posts WHERE slug IN ('renaissance', 'ai-scale')");
    $pdo->exec("DELETE FROM case_studies WHERE slug IN ('fintech-migration', 'supply-chain-ai')");

    $pdo->exec("INSERT INTO blog_posts (author_id, title, slug, category, excerpt, content, is_published, published_at) VALUES 
    (1, 'The 0px Mandate: Architecting Africa’s Digital Renaissance', 'renaissance', 'STRATEGY', 'How a return to architectural precision and high-contrast digital design is reshaping the competitive landscape for African enterprises.', '<p>In the landscape of modern enterprise, the allure of rounded corners and soft gradients is fading. The 0px mandate is not just an aesthetic choice; it is a statement of architectural precision and corporate clarity.</p><p>As we navigate the complexities of the African market, our systems must reflect the stability and transparency our organizations demand. This report explores the psychological and operational advantages of a high-contrast, sharp-edged digital ecosystem.</p>', 1, NOW()),
    (1, 'Synchronized Intelligence: Scaling AI for the Pan-African Enterprise', 'ai-scale', 'TECHNOLOGY', 'Beyond the hype. A strategic blueprint for deploying distributed artificial intelligence across multi-tenant infrastructures in developing markets.', '<p>AI is no longer a luxury. It is the engine of modern scale. However, the deployment of intelligence across a pan-African footprint requires more than just compute power—it requires architectural synchronization.</p><p>We examine the crossroads of local latency and global intelligence, providing a blueprint for sustainable AI integration.</p>', 1, NOW())
    ");

    $pdo->exec("INSERT INTO case_studies (title, slug, client_name, problem, solution, results, stat_label, stat_value, is_published) VALUES 
    ('Pan-African FinTech Cloud Migration', 'fintech-migration', 'Global Financial Group', 'A legacy monolith infrastructure was causing 15% annual churn due to excessive latency in cross-border settlements.', 'Engineered a high-concurrency, distributed micro-ledger system on a synchronized multi-region cloud architecture.', 'We achieved a total elimination of settlement bottlenecks across 12 markets, restoring enterprise trust.', 'INCREASE IN LATENCY EFFICIENCY', '94%', 1),
    ('AI-Driven Supply Chain Orchestration', 'supply-chain-ai', 'Heirs Logistics Ecosystem', 'Inefficient routing and manual predictive analysis were costing the organization $4M in annual logistical leakage.', 'Decommissioned legacy manual protocols and deployed a synchronized AI predictive routing engine.', 'Reclaimed $3.2M in annual operational value within the first fiscal quarter of deployment.', 'RECLAIMED ANNUAL VALUE', '$3.2M', 1)
    ");
    echo "SUCCESS: Injection sequence complete.";
} catch (Exception $e) {
    echo "ERROR: " . $e->getMessage();
}
