<?php
// controller.php

$page = isset($_GET['pages']) ? $_GET['pages'] : 'dashboard_total';

// Sanitasi nama halaman supaya aman
$page = preg_replace('/[^a-z0-9_]/i', '', $page);

// Path file di folder pages
$file = "pages/" . $page . ".php";

if (file_exists($file)) {
    include $file;
} else {
    echo "<h2>Halaman tidak ditemukan!</h2>";
}
