<?php

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

switch ($page) {

    case 'dashboard':
        include __DIR__ . '/../pages/master/dashboard.php';
        break;

    case 'login':
        include __DIR__ . '/../pages/master/login.php';
        break;

    case 'register':
        include __DIR__ . '/../pages/master/register.php';
        break;

    case 'tabel':
        include __DIR__ . '/../pages/master/tabel.php';
        break;

    // DIPERBAIKI: Pengecekan aksi tambah, edit, delete untuk user_admin
  case 'admin':
        if ($aksi == 'tambah') {
            include __DIR__ . '/../user_admin/tambah.php';
        } elseif ($aksi == 'edit') {
            include __DIR__ . '/../user_admin/edit.php';
        } elseif ($aksi == 'delete') {
            include __DIR__ . '/../user_admin/delete.php'; // Ganti hapus.php jadi delete.php
        } else {
            include __DIR__ . '/../user_admin/tampil.php';
        }
        break;

    case 'form':
        include __DIR__ . '/../pages/master/form.php';
        break;

    case 'form_edit':
        include __DIR__ . '/../pages/master/form_edit.php';
        break;

    case 'invoice':
        include __DIR__ . '/../pages/master/invoice.php';
        break;

    case 'tambah':
        include __DIR__ . '/../pages/master/form.php';
        break;

    case 'edit':
        include __DIR__ . '/../pages/master/edit.php';
        break;

    default:
        include __DIR__ . '/../pages/master/dashboard.php';
        break;
}

?>