<?php
/**
 * Generator for SmartThink Academy programme pages.
 * Run from project root: php scripts/generate_academy_programme_pages.php
 */

$baseDir = __DIR__ . '/../website';

$programmes = [
    ['slug' => 'programme-ai', 'name' => 'Artificial Intelligence', 'description' => 'Practical AI skills for business, from machine learning fundamentals to AI governance and deployment.'],
    ['slug' => 'programme-cybersecurity', 'name' => 'Cybersecurity', 'description' => 'Build defensive and offensive cybersecurity capabilities aligned to industry frameworks and certifications.'],
    ['slug' => 'programme-digital-transformation', 'name' => 'Digital Transformation', 'description' => 'Learn how to lead and execute enterprise digital transformation initiatives end to end.'],
    ['slug' => 'programme-grc', 'name' => 'GRC', 'description' => 'Governance, risk, and compliance programmes designed for enterprise and government environments.'],
    ['slug' => 'programme-cloud-security', 'name' => 'Cloud Security', 'description' => 'Secure cloud infrastructure across AWS, Azure, and Google Cloud with practical, hands-on training.'],
    ['slug' => 'programme-data-analytics', 'name' => 'Data Analytics', 'description' => 'Turn data into insight through analytics, visualization, and data-driven decision-making skills.'],
    ['slug' => 'programme-tech-leadership', 'name' => 'Technology Leadership', 'description' => 'Lead technology teams and initiatives with the strategic, operational, and communication skills CIOs need.'],
];

$template = <<<'HTML'
<?php
require_once __DIR__ . '/_site_content.php';
$activePage = 'academy';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{NAME}} Programme — SmartThink Academy</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="../assets/css/smartthink-global.css">
</head>
<body>
<?php include __DIR__ . '/includes/header.php'; ?>

    <section class="st-hero" style="min-height: 55vh; padding: 8rem 0 5rem;">
        <div class="container">
            <nav aria-label="breadcrumb" class="mb-3"><ol class="breadcrumb" style="--bs-breadcrumb-divider: '>';"><li class="breadcrumb-item"><a href="academy.php" style="color: rgba(255,255,255,.7);">SmartThink Academy</a></li><li class="breadcrumb-item active" aria-current="page" style="color: #fff;">{{NAME}}</li></ol></nav>
            <div class="st-hero-badge" style="background: var(--teal-accent); color: #fff; padding: .25rem .75rem; border-radius: 4px; display: inline-block;"><span>SmartThink Academy</span></div>
            <h1 class="mt-3">{{NAME}} Programme</h1>
            <p>{{DESCRIPTION}}</p>
            <div class="st-hero-actions">
                <a class="st-btn st-btn-teal" href="contact.php?type=academy">Apply to Academy</a>
                <a class="st-btn st-btn-ghost-white" href="contact.php?type=academy">Download Programme Guide</a>
            </div>
        </div>
    </section>

    <section class="st-section">
        <div class="container">
            <h2>What You Will Learn</h2>
            <p>This programme is designed by practitioners and aligned to the skills employers and government agencies demand. It combines theory, hands-on labs, and real-world case studies.</p>
            <ul class="list-group list-group-flush">
                <li class="list-group-item">Core concepts and frameworks for {{NAME}}</li>
                <li class="list-group-item">Practical labs and applied exercises</li>
                <li class="list-group-item">Industry case studies and best practices</li>
                <li class="list-group-item">Assessment and certification preparation</li>
                <li class="list-group-item">Career pathways and employer connections</li>
            </ul>
        </div>
    </section>

    <section class="st-section st-section-cloud">
        <div class="container">
            <h2>Programme Format</h2>
            <div class="row">
                <div class="col-md-4 mb-4"><div class="p-4 bg-white border rounded-3 h-100 text-center"><h4>Online</h4><p>Self-paced and live sessions available globally.</p></div></div>
                <div class="col-md-4 mb-4"><div class="p-4 bg-white border rounded-3 h-100 text-center"><h4>In-Person</h4><p>Cohort-based delivery in select locations.</p></div></div>
                <div class="col-md-4 mb-4"><div class="p-4 bg-white border rounded-3 h-100 text-center"><h4>Hybrid</h4><p>Combine online learning with intensive in-person workshops.</p></div></div>
            </div>
        </div>
    </section>

    <section class="st-section-navy final-cta">
        <div class="container">
            <h2>Ready to Enrol in the {{NAME}} Programme?</h2>
            <div class="final-cta-actions">
                <a class="st-btn st-btn-teal" href="contact.php?type=academy">Apply to Academy</a>
                <a class="st-btn st-btn-ghost-white" href="academy.php">View All Programmes</a>
            </div>
        </div>
    </section>

<?php include __DIR__ . '/includes/footer.php'; ?>
HTML;

foreach ($programmes as $programme) {
    $output = str_replace(
        ['{{NAME}}', '{{DESCRIPTION}}'],
        [$programme['name'], $programme['description']],
        $template
    );
    $file = $baseDir . '/' . $programme['slug'] . '.php';
    file_put_contents($file, $output);
    echo "Generated: {$programme['slug']}.php\n";
}

echo "Done. Generated " . count($programmes) . " academy programme pages.\n";
