<?php

namespace PHPMaker2021\rdigital21;

use Slim\App;
use Slim\Routing\RouteCollectorProxy;

// Handle Routes
return function (App $app) {
    // peserta_didik
    $app->any('/PesertaDidikList[/{pd_id}]', PesertaDidikController::class . ':list')->add(PermissionMiddleware::class)->setName('PesertaDidikList-peserta_didik-list'); // list
    $app->any('/PesertaDidikAdd[/{pd_id}]', PesertaDidikController::class . ':add')->add(PermissionMiddleware::class)->setName('PesertaDidikAdd-peserta_didik-add'); // add
    $app->any('/PesertaDidikEdit[/{pd_id}]', PesertaDidikController::class . ':edit')->add(PermissionMiddleware::class)->setName('PesertaDidikEdit-peserta_didik-edit'); // edit
    $app->any('/PesertaDidikDelete[/{pd_id}]', PesertaDidikController::class . ':delete')->add(PermissionMiddleware::class)->setName('PesertaDidikDelete-peserta_didik-delete'); // delete
    $app->group(
        '/peserta_didik',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{pd_id}]', PesertaDidikController::class . ':list')->add(PermissionMiddleware::class)->setName('peserta_didik/list-peserta_didik-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{pd_id}]', PesertaDidikController::class . ':add')->add(PermissionMiddleware::class)->setName('peserta_didik/add-peserta_didik-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{pd_id}]', PesertaDidikController::class . ':edit')->add(PermissionMiddleware::class)->setName('peserta_didik/edit-peserta_didik-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{pd_id}]', PesertaDidikController::class . ':delete')->add(PermissionMiddleware::class)->setName('peserta_didik/delete-peserta_didik-delete-2'); // delete
        }
    );

    // guru
    $app->any('/GuruList[/{guru_id}]', GuruController::class . ':list')->add(PermissionMiddleware::class)->setName('GuruList-guru-list'); // list
    $app->any('/GuruAdd[/{guru_id}]', GuruController::class . ':add')->add(PermissionMiddleware::class)->setName('GuruAdd-guru-add'); // add
    $app->any('/GuruEdit[/{guru_id}]', GuruController::class . ':edit')->add(PermissionMiddleware::class)->setName('GuruEdit-guru-edit'); // edit
    $app->any('/GuruDelete[/{guru_id}]', GuruController::class . ':delete')->add(PermissionMiddleware::class)->setName('GuruDelete-guru-delete'); // delete
    $app->group(
        '/guru',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{guru_id}]', GuruController::class . ':list')->add(PermissionMiddleware::class)->setName('guru/list-guru-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{guru_id}]', GuruController::class . ':add')->add(PermissionMiddleware::class)->setName('guru/add-guru-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{guru_id}]', GuruController::class . ':edit')->add(PermissionMiddleware::class)->setName('guru/edit-guru-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{guru_id}]', GuruController::class . ':delete')->add(PermissionMiddleware::class)->setName('guru/delete-guru-delete-2'); // delete
        }
    );

    // mata_pelajaran
    $app->any('/MataPelajaranList[/{mapel_id}]', MataPelajaranController::class . ':list')->add(PermissionMiddleware::class)->setName('MataPelajaranList-mata_pelajaran-list'); // list
    $app->any('/MataPelajaranEdit[/{mapel_id}]', MataPelajaranController::class . ':edit')->add(PermissionMiddleware::class)->setName('MataPelajaranEdit-mata_pelajaran-edit'); // edit
    $app->group(
        '/mata_pelajaran',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{mapel_id}]', MataPelajaranController::class . ':list')->add(PermissionMiddleware::class)->setName('mata_pelajaran/list-mata_pelajaran-list-2'); // list
            $group->any('/' . Config("EDIT_ACTION") . '[/{mapel_id}]', MataPelajaranController::class . ':edit')->add(PermissionMiddleware::class)->setName('mata_pelajaran/edit-mata_pelajaran-edit-2'); // edit
        }
    );

    // nilai_p5
    $app->any('/NilaiP5List[/{nilai_p5}]', NilaiP5Controller::class . ':list')->add(PermissionMiddleware::class)->setName('NilaiP5List-nilai_p5-list'); // list
    $app->any('/NilaiP5Delete[/{nilai_p5}]', NilaiP5Controller::class . ':delete')->add(PermissionMiddleware::class)->setName('NilaiP5Delete-nilai_p5-delete'); // delete
    $app->group(
        '/nilai_p5',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{nilai_p5}]', NilaiP5Controller::class . ':list')->add(PermissionMiddleware::class)->setName('nilai_p5/list-nilai_p5-list-2'); // list
            $group->any('/' . Config("DELETE_ACTION") . '[/{nilai_p5}]', NilaiP5Controller::class . ':delete')->add(PermissionMiddleware::class)->setName('nilai_p5/delete-nilai_p5-delete-2'); // delete
        }
    );

    // tujuan_pembelajaran
    $app->any('/TujuanPembelajaranList[/{tp_id}]', TujuanPembelajaranController::class . ':list')->add(PermissionMiddleware::class)->setName('TujuanPembelajaranList-tujuan_pembelajaran-list'); // list
    $app->any('/TujuanPembelajaranAdd[/{tp_id}]', TujuanPembelajaranController::class . ':add')->add(PermissionMiddleware::class)->setName('TujuanPembelajaranAdd-tujuan_pembelajaran-add'); // add
    $app->any('/TujuanPembelajaranEdit[/{tp_id}]', TujuanPembelajaranController::class . ':edit')->add(PermissionMiddleware::class)->setName('TujuanPembelajaranEdit-tujuan_pembelajaran-edit'); // edit
    $app->group(
        '/tujuan_pembelajaran',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{tp_id}]', TujuanPembelajaranController::class . ':list')->add(PermissionMiddleware::class)->setName('tujuan_pembelajaran/list-tujuan_pembelajaran-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{tp_id}]', TujuanPembelajaranController::class . ':add')->add(PermissionMiddleware::class)->setName('tujuan_pembelajaran/add-tujuan_pembelajaran-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{tp_id}]', TujuanPembelajaranController::class . ':edit')->add(PermissionMiddleware::class)->setName('tujuan_pembelajaran/edit-tujuan_pembelajaran-edit-2'); // edit
        }
    );

    // wali_kelas
    $app->any('/WaliKelasList[/{walas_id}]', WaliKelasController::class . ':list')->add(PermissionMiddleware::class)->setName('WaliKelasList-wali_kelas-list'); // list
    $app->any('/WaliKelasAdd[/{walas_id}]', WaliKelasController::class . ':add')->add(PermissionMiddleware::class)->setName('WaliKelasAdd-wali_kelas-add'); // add
    $app->any('/WaliKelasEdit[/{walas_id}]', WaliKelasController::class . ':edit')->add(PermissionMiddleware::class)->setName('WaliKelasEdit-wali_kelas-edit'); // edit
    $app->any('/WaliKelasDelete[/{walas_id}]', WaliKelasController::class . ':delete')->add(PermissionMiddleware::class)->setName('WaliKelasDelete-wali_kelas-delete'); // delete
    $app->group(
        '/wali_kelas',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{walas_id}]', WaliKelasController::class . ':list')->add(PermissionMiddleware::class)->setName('wali_kelas/list-wali_kelas-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{walas_id}]', WaliKelasController::class . ':add')->add(PermissionMiddleware::class)->setName('wali_kelas/add-wali_kelas-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{walas_id}]', WaliKelasController::class . ':edit')->add(PermissionMiddleware::class)->setName('wali_kelas/edit-wali_kelas-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{walas_id}]', WaliKelasController::class . ':delete')->add(PermissionMiddleware::class)->setName('wali_kelas/delete-wali_kelas-delete-2'); // delete
        }
    );

    // tahun_pelajaran
    $app->any('/TahunPelajaranList[/{tapel_id}]', TahunPelajaranController::class . ':list')->add(PermissionMiddleware::class)->setName('TahunPelajaranList-tahun_pelajaran-list'); // list
    $app->any('/TahunPelajaranAdd[/{tapel_id}]', TahunPelajaranController::class . ':add')->add(PermissionMiddleware::class)->setName('TahunPelajaranAdd-tahun_pelajaran-add'); // add
    $app->any('/TahunPelajaranEdit[/{tapel_id}]', TahunPelajaranController::class . ':edit')->add(PermissionMiddleware::class)->setName('TahunPelajaranEdit-tahun_pelajaran-edit'); // edit
    $app->any('/TahunPelajaranDelete[/{tapel_id}]', TahunPelajaranController::class . ':delete')->add(PermissionMiddleware::class)->setName('TahunPelajaranDelete-tahun_pelajaran-delete'); // delete
    $app->group(
        '/tahun_pelajaran',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{tapel_id}]', TahunPelajaranController::class . ':list')->add(PermissionMiddleware::class)->setName('tahun_pelajaran/list-tahun_pelajaran-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{tapel_id}]', TahunPelajaranController::class . ':add')->add(PermissionMiddleware::class)->setName('tahun_pelajaran/add-tahun_pelajaran-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{tapel_id}]', TahunPelajaranController::class . ':edit')->add(PermissionMiddleware::class)->setName('tahun_pelajaran/edit-tahun_pelajaran-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{tapel_id}]', TahunPelajaranController::class . ':delete')->add(PermissionMiddleware::class)->setName('tahun_pelajaran/delete-tahun_pelajaran-delete-2'); // delete
        }
    );

    // penilaian
    $app->any('/PenilaianList[/{penilaian_id}]', PenilaianController::class . ':list')->add(PermissionMiddleware::class)->setName('PenilaianList-penilaian-list'); // list
    $app->any('/PenilaianAdd[/{penilaian_id}]', PenilaianController::class . ':add')->add(PermissionMiddleware::class)->setName('PenilaianAdd-penilaian-add'); // add
    $app->any('/PenilaianEdit[/{penilaian_id}]', PenilaianController::class . ':edit')->add(PermissionMiddleware::class)->setName('PenilaianEdit-penilaian-edit'); // edit
    $app->any('/PenilaianDelete[/{penilaian_id}]', PenilaianController::class . ':delete')->add(PermissionMiddleware::class)->setName('PenilaianDelete-penilaian-delete'); // delete
    $app->group(
        '/penilaian',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{penilaian_id}]', PenilaianController::class . ':list')->add(PermissionMiddleware::class)->setName('penilaian/list-penilaian-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{penilaian_id}]', PenilaianController::class . ':add')->add(PermissionMiddleware::class)->setName('penilaian/add-penilaian-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{penilaian_id}]', PenilaianController::class . ':edit')->add(PermissionMiddleware::class)->setName('penilaian/edit-penilaian-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{penilaian_id}]', PenilaianController::class . ':delete')->add(PermissionMiddleware::class)->setName('penilaian/delete-penilaian-delete-2'); // delete
        }
    );

    // nilai_formatif
    $app->any('/NilaiFormatifList[/{nilai_f_id}]', NilaiFormatifController::class . ':list')->add(PermissionMiddleware::class)->setName('NilaiFormatifList-nilai_formatif-list'); // list
    $app->any('/NilaiFormatifAdd[/{nilai_f_id}]', NilaiFormatifController::class . ':add')->add(PermissionMiddleware::class)->setName('NilaiFormatifAdd-nilai_formatif-add'); // add
    $app->any('/NilaiFormatifEdit[/{nilai_f_id}]', NilaiFormatifController::class . ':edit')->add(PermissionMiddleware::class)->setName('NilaiFormatifEdit-nilai_formatif-edit'); // edit
    $app->any('/NilaiFormatifDelete[/{nilai_f_id}]', NilaiFormatifController::class . ':delete')->add(PermissionMiddleware::class)->setName('NilaiFormatifDelete-nilai_formatif-delete'); // delete
    $app->group(
        '/nilai_formatif',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{nilai_f_id}]', NilaiFormatifController::class . ':list')->add(PermissionMiddleware::class)->setName('nilai_formatif/list-nilai_formatif-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{nilai_f_id}]', NilaiFormatifController::class . ':add')->add(PermissionMiddleware::class)->setName('nilai_formatif/add-nilai_formatif-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{nilai_f_id}]', NilaiFormatifController::class . ':edit')->add(PermissionMiddleware::class)->setName('nilai_formatif/edit-nilai_formatif-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{nilai_f_id}]', NilaiFormatifController::class . ':delete')->add(PermissionMiddleware::class)->setName('nilai_formatif/delete-nilai_formatif-delete-2'); // delete
        }
    );

    // nilai_sumatif
    $app->any('/NilaiSumatifList[/{nilai_s_id}]', NilaiSumatifController::class . ':list')->add(PermissionMiddleware::class)->setName('NilaiSumatifList-nilai_sumatif-list'); // list
    $app->any('/NilaiSumatifAdd[/{nilai_s_id}]', NilaiSumatifController::class . ':add')->add(PermissionMiddleware::class)->setName('NilaiSumatifAdd-nilai_sumatif-add'); // add
    $app->any('/NilaiSumatifEdit[/{nilai_s_id}]', NilaiSumatifController::class . ':edit')->add(PermissionMiddleware::class)->setName('NilaiSumatifEdit-nilai_sumatif-edit'); // edit
    $app->any('/NilaiSumatifDelete[/{nilai_s_id}]', NilaiSumatifController::class . ':delete')->add(PermissionMiddleware::class)->setName('NilaiSumatifDelete-nilai_sumatif-delete'); // delete
    $app->group(
        '/nilai_sumatif',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{nilai_s_id}]', NilaiSumatifController::class . ':list')->add(PermissionMiddleware::class)->setName('nilai_sumatif/list-nilai_sumatif-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{nilai_s_id}]', NilaiSumatifController::class . ':add')->add(PermissionMiddleware::class)->setName('nilai_sumatif/add-nilai_sumatif-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{nilai_s_id}]', NilaiSumatifController::class . ':edit')->add(PermissionMiddleware::class)->setName('nilai_sumatif/edit-nilai_sumatif-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{nilai_s_id}]', NilaiSumatifController::class . ':delete')->add(PermissionMiddleware::class)->setName('nilai_sumatif/delete-nilai_sumatif-delete-2'); // delete
        }
    );

    // materi
    $app->any('/MateriList[/{materi_id}]', MateriController::class . ':list')->add(PermissionMiddleware::class)->setName('MateriList-materi-list'); // list
    $app->any('/MateriAdd[/{materi_id}]', MateriController::class . ':add')->add(PermissionMiddleware::class)->setName('MateriAdd-materi-add'); // add
    $app->any('/MateriEdit[/{materi_id}]', MateriController::class . ':edit')->add(PermissionMiddleware::class)->setName('MateriEdit-materi-edit'); // edit
    $app->group(
        '/materi',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{materi_id}]', MateriController::class . ':list')->add(PermissionMiddleware::class)->setName('materi/list-materi-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{materi_id}]', MateriController::class . ':add')->add(PermissionMiddleware::class)->setName('materi/add-materi-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{materi_id}]', MateriController::class . ':edit')->add(PermissionMiddleware::class)->setName('materi/edit-materi-edit-2'); // edit
        }
    );

    // dash
    $app->any('/Dash[/{params:.*}]', DashController::class)->add(PermissionMiddleware::class)->setName('Dash-dash-custom'); // custom

    // c_rapor
    $app->any('/CRapor[/{params:.*}]', CRaporController::class)->add(PermissionMiddleware::class)->setName('CRapor-c_rapor-custom'); // custom

    // sekolah
    $app->any('/SekolahList[/{sekolah_id}]', SekolahController::class . ':list')->add(PermissionMiddleware::class)->setName('SekolahList-sekolah-list'); // list
    $app->any('/SekolahView[/{sekolah_id}]', SekolahController::class . ':view')->add(PermissionMiddleware::class)->setName('SekolahView-sekolah-view'); // view
    $app->any('/SekolahEdit[/{sekolah_id}]', SekolahController::class . ':edit')->add(PermissionMiddleware::class)->setName('SekolahEdit-sekolah-edit'); // edit
    $app->group(
        '/sekolah',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{sekolah_id}]', SekolahController::class . ':list')->add(PermissionMiddleware::class)->setName('sekolah/list-sekolah-list-2'); // list
            $group->any('/' . Config("VIEW_ACTION") . '[/{sekolah_id}]', SekolahController::class . ':view')->add(PermissionMiddleware::class)->setName('sekolah/view-sekolah-view-2'); // view
            $group->any('/' . Config("EDIT_ACTION") . '[/{sekolah_id}]', SekolahController::class . ':edit')->add(PermissionMiddleware::class)->setName('sekolah/edit-sekolah-edit-2'); // edit
        }
    );

    // extra_absensi
    $app->any('/ExtraAbsensiList[/{absen_id}]', ExtraAbsensiController::class . ':list')->add(PermissionMiddleware::class)->setName('ExtraAbsensiList-extra_absensi-list'); // list
    $app->any('/ExtraAbsensiEdit[/{absen_id}]', ExtraAbsensiController::class . ':edit')->add(PermissionMiddleware::class)->setName('ExtraAbsensiEdit-extra_absensi-edit'); // edit
    $app->any('/ExtraAbsensiDelete[/{absen_id}]', ExtraAbsensiController::class . ':delete')->add(PermissionMiddleware::class)->setName('ExtraAbsensiDelete-extra_absensi-delete'); // delete
    $app->group(
        '/extra_absensi',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{absen_id}]', ExtraAbsensiController::class . ':list')->add(PermissionMiddleware::class)->setName('extra_absensi/list-extra_absensi-list-2'); // list
            $group->any('/' . Config("EDIT_ACTION") . '[/{absen_id}]', ExtraAbsensiController::class . ':edit')->add(PermissionMiddleware::class)->setName('extra_absensi/edit-extra_absensi-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{absen_id}]', ExtraAbsensiController::class . ':delete')->add(PermissionMiddleware::class)->setName('extra_absensi/delete-extra_absensi-delete-2'); // delete
        }
    );

    // dimensi
    $app->any('/DimensiList[/{dimensi_id}]', DimensiController::class . ':list')->add(PermissionMiddleware::class)->setName('DimensiList-dimensi-list'); // list
    $app->any('/DimensiAdd[/{dimensi_id}]', DimensiController::class . ':add')->add(PermissionMiddleware::class)->setName('DimensiAdd-dimensi-add'); // add
    $app->any('/DimensiView[/{dimensi_id}]', DimensiController::class . ':view')->add(PermissionMiddleware::class)->setName('DimensiView-dimensi-view'); // view
    $app->any('/DimensiEdit[/{dimensi_id}]', DimensiController::class . ':edit')->add(PermissionMiddleware::class)->setName('DimensiEdit-dimensi-edit'); // edit
    $app->any('/DimensiDelete[/{dimensi_id}]', DimensiController::class . ':delete')->add(PermissionMiddleware::class)->setName('DimensiDelete-dimensi-delete'); // delete
    $app->group(
        '/dimensi',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{dimensi_id}]', DimensiController::class . ':list')->add(PermissionMiddleware::class)->setName('dimensi/list-dimensi-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{dimensi_id}]', DimensiController::class . ':add')->add(PermissionMiddleware::class)->setName('dimensi/add-dimensi-add-2'); // add
            $group->any('/' . Config("VIEW_ACTION") . '[/{dimensi_id}]', DimensiController::class . ':view')->add(PermissionMiddleware::class)->setName('dimensi/view-dimensi-view-2'); // view
            $group->any('/' . Config("EDIT_ACTION") . '[/{dimensi_id}]', DimensiController::class . ':edit')->add(PermissionMiddleware::class)->setName('dimensi/edit-dimensi-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{dimensi_id}]', DimensiController::class . ':delete')->add(PermissionMiddleware::class)->setName('dimensi/delete-dimensi-delete-2'); // delete
        }
    );

    // proyek
    $app->any('/ProyekList[/{project_id}]', ProyekController::class . ':list')->add(PermissionMiddleware::class)->setName('ProyekList-proyek-list'); // list
    $app->any('/ProyekAdd[/{project_id}]', ProyekController::class . ':add')->add(PermissionMiddleware::class)->setName('ProyekAdd-proyek-add'); // add
    $app->any('/ProyekEdit[/{project_id}]', ProyekController::class . ':edit')->add(PermissionMiddleware::class)->setName('ProyekEdit-proyek-edit'); // edit
    $app->any('/ProyekDelete[/{project_id}]', ProyekController::class . ':delete')->add(PermissionMiddleware::class)->setName('ProyekDelete-proyek-delete'); // delete
    $app->group(
        '/proyek',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{project_id}]', ProyekController::class . ':list')->add(PermissionMiddleware::class)->setName('proyek/list-proyek-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{project_id}]', ProyekController::class . ':add')->add(PermissionMiddleware::class)->setName('proyek/add-proyek-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{project_id}]', ProyekController::class . ':edit')->add(PermissionMiddleware::class)->setName('proyek/edit-proyek-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{project_id}]', ProyekController::class . ':delete')->add(PermissionMiddleware::class)->setName('proyek/delete-proyek-delete-2'); // delete
        }
    );

    // tema
    $app->any('/TemaList[/{tema_id}]', TemaController::class . ':list')->add(PermissionMiddleware::class)->setName('TemaList-tema-list'); // list
    $app->any('/TemaAdd[/{tema_id}]', TemaController::class . ':add')->add(PermissionMiddleware::class)->setName('TemaAdd-tema-add'); // add
    $app->any('/TemaEdit[/{tema_id}]', TemaController::class . ':edit')->add(PermissionMiddleware::class)->setName('TemaEdit-tema-edit'); // edit
    $app->any('/TemaDelete[/{tema_id}]', TemaController::class . ':delete')->add(PermissionMiddleware::class)->setName('TemaDelete-tema-delete'); // delete
    $app->group(
        '/tema',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{tema_id}]', TemaController::class . ':list')->add(PermissionMiddleware::class)->setName('tema/list-tema-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{tema_id}]', TemaController::class . ':add')->add(PermissionMiddleware::class)->setName('tema/add-tema-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{tema_id}]', TemaController::class . ':edit')->add(PermissionMiddleware::class)->setName('tema/edit-tema-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{tema_id}]', TemaController::class . ':delete')->add(PermissionMiddleware::class)->setName('tema/delete-tema-delete-2'); // delete
        }
    );

    // ektrakurikuler
    $app->any('/EktrakurikulerList[/{ekstra_id}]', EktrakurikulerController::class . ':list')->add(PermissionMiddleware::class)->setName('EktrakurikulerList-ektrakurikuler-list'); // list
    $app->any('/EktrakurikulerAdd[/{ekstra_id}]', EktrakurikulerController::class . ':add')->add(PermissionMiddleware::class)->setName('EktrakurikulerAdd-ektrakurikuler-add'); // add
    $app->any('/EktrakurikulerEdit[/{ekstra_id}]', EktrakurikulerController::class . ':edit')->add(PermissionMiddleware::class)->setName('EktrakurikulerEdit-ektrakurikuler-edit'); // edit
    $app->any('/EktrakurikulerDelete[/{ekstra_id}]', EktrakurikulerController::class . ':delete')->add(PermissionMiddleware::class)->setName('EktrakurikulerDelete-ektrakurikuler-delete'); // delete
    $app->group(
        '/ektrakurikuler',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{ekstra_id}]', EktrakurikulerController::class . ':list')->add(PermissionMiddleware::class)->setName('ektrakurikuler/list-ektrakurikuler-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{ekstra_id}]', EktrakurikulerController::class . ':add')->add(PermissionMiddleware::class)->setName('ektrakurikuler/add-ektrakurikuler-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{ekstra_id}]', EktrakurikulerController::class . ':edit')->add(PermissionMiddleware::class)->setName('ektrakurikuler/edit-ektrakurikuler-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{ekstra_id}]', EktrakurikulerController::class . ':delete')->add(PermissionMiddleware::class)->setName('ektrakurikuler/delete-ektrakurikuler-delete-2'); // delete
        }
    );

    // penilaian_p5
    $app->any('/PenilaianP5List', PenilaianP5Controller::class . ':list')->add(PermissionMiddleware::class)->setName('PenilaianP5List-penilaian_p5-list'); // list
    $app->group(
        '/penilaian_p5',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '', PenilaianP5Controller::class . ':list')->add(PermissionMiddleware::class)->setName('penilaian_p5/list-penilaian_p5-list-2'); // list
        }
    );

    // userlevelpermissions
    $app->any('/UserlevelpermissionsList[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':list')->add(PermissionMiddleware::class)->setName('UserlevelpermissionsList-userlevelpermissions-list'); // list
    $app->any('/UserlevelpermissionsAdd[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':add')->add(PermissionMiddleware::class)->setName('UserlevelpermissionsAdd-userlevelpermissions-add'); // add
    $app->any('/UserlevelpermissionsView[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':view')->add(PermissionMiddleware::class)->setName('UserlevelpermissionsView-userlevelpermissions-view'); // view
    $app->any('/UserlevelpermissionsEdit[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':edit')->add(PermissionMiddleware::class)->setName('UserlevelpermissionsEdit-userlevelpermissions-edit'); // edit
    $app->any('/UserlevelpermissionsDelete[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':delete')->add(PermissionMiddleware::class)->setName('UserlevelpermissionsDelete-userlevelpermissions-delete'); // delete
    $app->group(
        '/userlevelpermissions',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':list')->add(PermissionMiddleware::class)->setName('userlevelpermissions/list-userlevelpermissions-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':add')->add(PermissionMiddleware::class)->setName('userlevelpermissions/add-userlevelpermissions-add-2'); // add
            $group->any('/' . Config("VIEW_ACTION") . '[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':view')->add(PermissionMiddleware::class)->setName('userlevelpermissions/view-userlevelpermissions-view-2'); // view
            $group->any('/' . Config("EDIT_ACTION") . '[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':edit')->add(PermissionMiddleware::class)->setName('userlevelpermissions/edit-userlevelpermissions-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{userlevelid}/{_tablename}]', UserlevelpermissionsController::class . ':delete')->add(PermissionMiddleware::class)->setName('userlevelpermissions/delete-userlevelpermissions-delete-2'); // delete
        }
    );

    // userlevels
    $app->any('/UserlevelsList[/{userlevelid}]', UserlevelsController::class . ':list')->add(PermissionMiddleware::class)->setName('UserlevelsList-userlevels-list'); // list
    $app->any('/UserlevelsAdd[/{userlevelid}]', UserlevelsController::class . ':add')->add(PermissionMiddleware::class)->setName('UserlevelsAdd-userlevels-add'); // add
    $app->any('/UserlevelsEdit[/{userlevelid}]', UserlevelsController::class . ':edit')->add(PermissionMiddleware::class)->setName('UserlevelsEdit-userlevels-edit'); // edit
    $app->any('/UserlevelsDelete[/{userlevelid}]', UserlevelsController::class . ':delete')->add(PermissionMiddleware::class)->setName('UserlevelsDelete-userlevels-delete'); // delete
    $app->group(
        '/userlevels',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{userlevelid}]', UserlevelsController::class . ':list')->add(PermissionMiddleware::class)->setName('userlevels/list-userlevels-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{userlevelid}]', UserlevelsController::class . ':add')->add(PermissionMiddleware::class)->setName('userlevels/add-userlevels-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{userlevelid}]', UserlevelsController::class . ':edit')->add(PermissionMiddleware::class)->setName('userlevels/edit-userlevels-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{userlevelid}]', UserlevelsController::class . ':delete')->add(PermissionMiddleware::class)->setName('userlevels/delete-userlevels-delete-2'); // delete
        }
    );

    // kktp_sumatif
    $app->any('/KktpSumatifList[/{desk_id}]', KktpSumatifController::class . ':list')->add(PermissionMiddleware::class)->setName('KktpSumatifList-kktp_sumatif-list'); // list
    $app->any('/KktpSumatifAdd[/{desk_id}]', KktpSumatifController::class . ':add')->add(PermissionMiddleware::class)->setName('KktpSumatifAdd-kktp_sumatif-add'); // add
    $app->any('/KktpSumatifEdit[/{desk_id}]', KktpSumatifController::class . ':edit')->add(PermissionMiddleware::class)->setName('KktpSumatifEdit-kktp_sumatif-edit'); // edit
    $app->any('/KktpSumatifDelete[/{desk_id}]', KktpSumatifController::class . ':delete')->add(PermissionMiddleware::class)->setName('KktpSumatifDelete-kktp_sumatif-delete'); // delete
    $app->group(
        '/kktp_sumatif',
        function (RouteCollectorProxy $group) {
            $group->any('/' . Config("LIST_ACTION") . '[/{desk_id}]', KktpSumatifController::class . ':list')->add(PermissionMiddleware::class)->setName('kktp_sumatif/list-kktp_sumatif-list-2'); // list
            $group->any('/' . Config("ADD_ACTION") . '[/{desk_id}]', KktpSumatifController::class . ':add')->add(PermissionMiddleware::class)->setName('kktp_sumatif/add-kktp_sumatif-add-2'); // add
            $group->any('/' . Config("EDIT_ACTION") . '[/{desk_id}]', KktpSumatifController::class . ':edit')->add(PermissionMiddleware::class)->setName('kktp_sumatif/edit-kktp_sumatif-edit-2'); // edit
            $group->any('/' . Config("DELETE_ACTION") . '[/{desk_id}]', KktpSumatifController::class . ':delete')->add(PermissionMiddleware::class)->setName('kktp_sumatif/delete-kktp_sumatif-delete-2'); // delete
        }
    );

    // error
    $app->any('/error', OthersController::class . ':error')->add(PermissionMiddleware::class)->setName('error');

    // login
    $app->any('/login', OthersController::class . ':login')->add(PermissionMiddleware::class)->setName('login');

    // logout
    $app->any('/logout', OthersController::class . ':logout')->add(PermissionMiddleware::class)->setName('logout');

    // Swagger
    $app->get('/' . Config("SWAGGER_ACTION"), OthersController::class . ':swagger')->setName(Config("SWAGGER_ACTION")); // Swagger

    // Index
    $app->any('/[index]', OthersController::class . ':index')->add(PermissionMiddleware::class)->setName('index');

    // Route Action event
    if (function_exists(PROJECT_NAMESPACE . "Route_Action")) {
        Route_Action($app);
    }

    /**
     * Catch-all route to serve a 404 Not Found page if none of the routes match
     * NOTE: Make sure this route is defined last.
     */
    $app->map(
        ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
        '/{routes:.+}',
        function ($request, $response, $params) {
            $error = [
                "statusCode" => "404",
                "error" => [
                    "class" => "text-warning",
                    "type" => Container("language")->phrase("Error"),
                    "description" => str_replace("%p", $params["routes"], Container("language")->phrase("PageNotFound")),
                ],
            ];
            Container("flash")->addMessage("error", $error);
            return $response->withStatus(302)->withHeader("Location", GetUrl("error")); // Redirect to error page
        }
    );
};
