<?php

namespace Config;

// Create a new instance of our RouteCollection class.
$routes = Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (file_exists(SYSTEMPATH . 'Config/Routes.php'))
{
	require SYSTEMPATH . 'Config/Routes.php';
}

/**
 * --------------------------------------------------------------------
 * Router Setup
 * --------------------------------------------------------------------
 */
$routes->setDefaultNamespace('App\Controllers');

$routes->setDefaultController('Swa');
$routes->setDefaultMethod('index');

$routes->setTranslateURIDashes(false);
$routes->set404Override();
$routes->match(['get', 'post'], 'dashboard/tampil/(:segment)', 'Dashboard::tampil/$1');
$routes->setAutoRoute(true);


/*
 * --------------------------------------------------------------------
 * Route Definitions
 * --------------------------------------------------------------------
 */

// We get a performance increase by specifying the default
// route since we don't have to scan directories.
//$routes->get('/', 'Home::index');
$routes->get('/', 'Swa::index');
$routes->get('/swa', 'Swa::index');


$routes->add('d1','Dashboard::dash');

$routes->match(['get', 'post'], 'cetakp/(:any)', 'PdfMain::toolscetak/$1');
$routes->match(['get','post'], 'cetak', 'PdfMain::cetakpdf',['filter' => 'role:admin,pegawai']);
$routes->match(['get', 'post'], 'etiketcetak/(:any)', 'PdfMain::etiketcetak/$1');

$routes->match(['get', 'post'], 'render/(:any)', 'Dashboard::tampil/$1',['filter' => 'role:asesor,superadmin,admin,pimpinan,kemenpanrb,tpi,pokja']);

$routes->match(['get', 'post'], '/mstukassign/(:any)', 'Master::unitkerja_assign/$1',['filter' => 'role:superadmin,asesor']);

$routes->match(['get', 'post'], 'mstlkedata/(:any)', 'Master::mstlke_data/$1');


$routes->match(['get', 'post'], 'tujuan', 'MdTujuan::tujuan');
$routes->match(['get', 'post'], 'tujuandata', 'MdTujuan::tujuan_data');
$routes->match(['get', 'post'], 'potensitotal', 'MdTujuan::potensitotal');

//Moni
$routes->match(['get', 'post'], 'moni', 'MdMoni::moni',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'moni/0', 'MdMoni::moni/0',['filter'=>'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'moni/(:any)', 'MdMoni::moni/$1');
$routes->match(['get', 'post'], 'moniresume', 'MdMoni::moniresume');
$routes->match(['get', 'post'], 'busmoni', 'MdMoni::busmoni',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'busmoni/(:any)', 'MdMoni::busmoni/$1',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);





$routes->match(['get', 'post'], 'absenubahmoni', 'MdMoni::absenubah');
$routes->match(['get', 'post'], 'monidata', 'MdMoni::moni_data');



//MdWarga 

$routes->match(['get', 'post'], 'warga', 'MdWarga::warga',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'warga/0', 'MdWarga::warga/0',['filter'=>'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'warga/(:any)', 'MdWarga::warga/$1');

$routes->match(['get', 'post'], 'wargaeditdata', 'MdWarga::wargaeditdata');
$routes->match(['get', 'post'], 'absenubah', 'MdWarga::absenubah');

$routes->match(['get', 'post'], 'wargadata', 'MdWarga::warga_data');

$routes->match(['get', 'post'], 'warga_destroy', 'MdWarga::warga_destroy',['filter' => 'role:superadmin,admin,dishub']);
$routes->match(['get', 'post'], 'warga_simpan', 'MdWarga::warga_simpan');
$routes->match(['get', 'post'], 'warga_update', 'MdWarga::warga_update');
//$routes->match(['get', 'post'], 'warga_simpan/(:any)', 'MdWarga::warga_simpan/$1');
//$routes->match(['get', 'post'], 'warga_update/(:any)', 'MdWarga::warga_update/$1');
$routes->match(['get', 'post'], 'warga_cetak/(:any)', 'PdfMain::warga_cetak/$1');
$routes->match(['get', 'post'], 'wargabus_cetak/(:any)', 'PdfMain::wargabus_cetak/$1');
$routes->match(['get', 'post'], 'armada_cetak', 'PdfMain::armada_cetak');
$routes->match(['get', 'post'], 'armada_cetak/(:any)', 'PdfMain::armada_cetak/$1');

$routes->match(['get', 'post'], 'warga_blasting/(:any)', 'PdfMain::warga_blasting/$1');


$routes->match(['get', 'post'], 'tiket', 'MdWarga::tiket');

$routes->match(['get', 'post'], 'statuswupdate', 'MdWarga::statuswupdate',['filter' => 'role:superadmin']);
$routes->match(['get', 'post'], '/tampilkanw/(:any)', 'MdWarga::tampilkanwfile/$1');

$routes->match(['get', 'post'], 'status_combo', 'MdMaster::status_combo');
$routes->match(['get', 'post'], 'wilayah_combo', 'MdMaster::wilayah_combo');
$routes->match(['get', 'post'], 'nobus_combo', 'MdMaster::nobus_combo');

$routes->match([ 'post'], 'ver_unver', 'MdWarga::ver_unver');
$routes->match([ 'post'], 'ver_all', 'MdWarga::ver_all');

$routes->match(['get', 'post'], 'simpanexcel', 'MdWarga::simpanexcel');
$routes->match(['get', 'post'], 'impxls', 'MdWarga::impxls');
$routes->match(['get', 'post'], 'impxls/(:any)', 'MdWarga::impxls/$1');
$routes->match(['get', 'post'], 'simpanxls2', 'MdWarga::simpanxls2');


$routes->match(['get', 'post'], 'simpanexcel2025', 'MdWarga::simpanexcel2025');
$routes->match(['get', 'post'], 'impxls2025', 'MdWarga::impxls2025');
$routes->match(['get', 'post'], 'impxls2025/(:any)', 'MdWarga::impxls2025/$1');
$routes->match(['get', 'post'], 'simpanxls22025', 'MdWarga::simpanxls22025');



$routes->match(['get', 'post'], 'wargadeleted', 'MdWarga::wargadeleted',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'wargadatadeleted', 'MdWarga::wargadeleted_data');


//====


//MdArmada 
$routes->match(['get', 'post'], 'armada', 'MdArmada::armada',['filter' => 'role:superadmin,admin']);
$routes->match(['get', 'post'], 'armada/1', 'MdArmada::armada/1',['filter' => 'role:superadmin,admin,dishub']);
$routes->match(['get', 'post'], 'armada/(:any)', 'MdArmada::armada/$1',['filter' => 'role:superadmin,admin']);


$routes->match(['get', 'post'], 'armadaeditdata', 'MdArmada::armadaeditdata');
$routes->match(['get', 'post'], 'armadadata', 'MdArmada::armada_data');
$routes->match(['get', 'post'], 'armada_status', 'MdArmada::armada_status');
$routes->match(['get', 'post'], 'armada_destroy', 'MdArmada::armada_destroy',['filter' => 'role:superadmin,admin,dishub']);
$routes->match(['get', 'post'], 'armada_simpan', 'MdArmada::armada_simpan');
$routes->match(['get', 'post'], 'armada_update/(:any)', 'MdArmada::armada_update/$1');
$routes->match(['get', 'post'], 'statusaupdate', 'MdArmada::statusaupdate',['filter' => 'role:superadmin,admin,dishub']);
$routes->match(['get', 'post'], 'statusa_combo', 'MdMaster::statusarmada_combo');
$routes->match(['get', 'post'], 'jenisarmada_combo', 'MdMaster::jenisarmada_combo');
$routes->match(['get', 'post'], 'jenisarmada2_combo', 'MdMaster::jenisarmada2_combo');
$routes->match(['get', 'post'], 'armadacombo/(:any)', 'MdArmada::armadacombo/$1');
$routes->match(['get', 'post'], 'armadacombo_all', 'MdArmada::armadacombo_all');


//====


//swa 
$routes->match(['post'], 'ceknik', 'Swa::ceknik');
$routes->match(['get','post'], 'cekkoded', 'Swa::cekkoded');
$routes->match(['get','post'], 'uploaddd', 'Swa::uploaddd');
$routes->match(['get','post'], 'ujipedamateng', 'Swa::ujipedamateng');


$routes->match(['post'], 'swa', 'Swa::index');
$routes->match(['get','post'], 'kirimkan', 'Swa::kirimkan');
$routes->match(['get','post'], 'kirimkandetil', 'Swa::kirimkandetil');

$routes->match(['get','post'], 'kirimkantestpeda', 'Swa::kirimkantestpeda');
$routes->match(['get','post'], 'kirimkandetiltestpeda', 'Swa::kirimkandetiltestpeda');


//$routes->match(['get','post'], 'lengkapi', 'Swa::lengkapi');

$routes->match(['get','post'], 'hitungkuota', 'Swa::hitungkuota');
$routes->match(['get','post'], 'batalpesan', 'Swa::batalpesan');

$routes->match(['get', 'post'], 'buatetiket', 'MdMudik::buatetiket');
$routes->match(['get', 'post'], 'aturarmada', 'MdMudik::aturarmada');
$routes->match(['get', 'post'], 'aturarmada/1', 'MdMudik::aturarmada/1',['filter'=>'role:superadmin,admin,dishub']);	
$routes->match(['get', 'post'], 'aturarmada/(:any)', 'MdMudik::aturarmada/$1',['filter'=>'role:admin,superadmin']);	

$routes->match(['get', 'post'], 'aturarmadadata', 'MdMudik::aturarmada_data');
$routes->match(['get', 'post'], 'aturarmadaeditdata', 'MdMudik::aturarmadaeditdata');
$routes->match(['get', 'post'], 'aturarmada_simpan', 'MdMudik::aturarmada_simpan');
$routes->match(['get', 'post'], 'aturarmada_update/(:any)', 'MdMudik::aturarmada_update/$1');
$routes->match(['get', 'post'], 'pengaturarmadadata', 'MdMudik::pengaturarmada_data');
$routes->match(['get', 'post'], 'tunjukarmada_simpan', 'MdMudik::tunjukarmada_simpan');
$routes->match(['get', 'post'], 'prosesdata', 'MdMudik::proses_data');
$routes->match(['get', 'post'], 'armadatdata', 'MdMudik::armadat_data');
$routes->match(['get', 'post'], 'tujuantdata', 'MdMudik::tujuant_data');
$routes->match(['get', 'post'], 'rekap', 'MdMudik::rekap');

$routes->match(['get', 'post'], 'wilayah', 'MdMaster::wilayah');
$routes->match(['get', 'post'], 'wilayah/(:any)', 'MdMaster::wilayah/$1');
$routes->match(['get', 'post'], 'wilayah_data', 'MdMaster::wilayah_data');
$routes->match(['get', 'post'], 'wilayah_status', 'MdMaster::wilayah_status');
$routes->match(['get', 'post'], 'wilayaheditdata', 'MdMaster::wilayaheditdata');
$routes->match(['get', 'post'], 'wilayah_destroy', 'MdMaster::wilayah_destroy',['filter' => 'role:superadmin,admin']);
$routes->match(['get', 'post'], 'wilayah_simpan', 'MdMaster::wilayah_simpan');
$routes->match(['get', 'post'], 'wilayah_update/(:any)', 'MdMaster::wilayah_update/$1');



$routes->match(['get', 'post'], 'korlap', 'MdMaster::korlap');
$routes->match(['get', 'post'], 'korlap_data', 'MdMaster::korlap_data');
$routes->match(['get', 'post'], 'korlap_status', 'MdMaster::korlap_status');
$routes->match(['get', 'post'], 'korlapeditdata', 'MdMaster::korlapeditdata');
$routes->match(['get', 'post'], 'korlap_destroy', 'MdMaster::korlap_destroy',['filter' => 'role:superadmin,admin']);
$routes->match(['get', 'post'], 'korlap_simpan', 'MdMaster::korlap_simpan');
$routes->match(['get', 'post'], 'korlap_update/(:any)', 'MdMaster::korlap_update/$1');



$routes->match(['get', 'post'], 'statuswupdate', 'MdArmada::statuswupdate',['filter' => 'role:superadmin']);
$routes->match(['get', 'post'], 'statusw_combo', 'MdMaster::statusw_combo');








$routes->match(['get', 'post'], 'prosesaturarmada_simpan/(:any)', 'MdMudik::prosesaturarmada_simpan/$1');

//$routes->match(['post'], 'tunjukar', 'MdMudik::tunjuk');
$routes->add('tunjukar','MdMudik::tunjuk');
$routes->match(['get', 'post'], 'aturdetil/(:any)', 'MdMudik::aturdetil/$1');
$routes->match(['get', 'post'], 'hapusdet', 'MdMudik::hapusdet');

$routes->match(['get', 'post'], 'penempatanpemudik', 'MdMudik::penempatanpemudik');
$routes->match(['get', 'post'], 'unpenempatanpemudik', 'MdMudik::unpenempatanpemudik');

$routes->match(['get', 'post'], 'finalisasi', 'MdMudik::finalisasi');
$routes->match(['get', 'post'], 'finalisasi/(:any)', 'MdMudik::finalisasi/$1');


$routes->match(['get', 'post'], 'finalisasiproses', 'MdMudik::finalisasiproses');
$routes->match(['get', 'post'], 'unfinalisasi', 'MdMudik::unfinalisasiproses');



//$routes->match(['get','post'], 'qrcode', 'QRBarCode::qrcode');
$routes->match(['get', 'post'], 'qrcode/(:any)','MdMudik::qrcode/$1');
$routes->match(['get', 'post'], 'qr','QrBarcode::qr');
$routes->match(['get', 'post'], 'swastatus','Swa::swastatus');
$routes->match(['get', 'post'], 'swastatus/(:any)','Swa::swastatus/$1');
$routes->match(['get', 'post'], 'swastatustest','Swa::swastatustest');
$routes->match(['get', 'post'], 'swadaftar','Swa::swadaftar');
$routes->match(['get', 'post'], 'swadaftar/(:any)','Swa::swadaftar/$1');
$routes->match(['get', 'post'], 'swadaftaruji','Swa::swadaftaruji');
$routes->match(['get', 'post'], 'swadaftartest','Swa::swadaftartest');
$routes->match(['get', 'post'], 'swadaftartest/(:any)','Swa::swadaftartest/$1');

$routes->match(['get', 'post'], 'testpeda','Swa::testpeda');

//$routes->match(['get', 'post'], 'swadaftardetil/(:any)', 'Swa::swadaftardetil/$1');

$routes->match(['get', 'post'], 'swadaftarsukses/(:any)', 'Swa::swadaftarsukses/$1');
$routes->match(['get', 'post'], 'swadaftarsuksestest/(:any)', 'Swa::swadaftarsuksestest/$1');

$routes->match(['get', 'post'], 'swastatus2/(:any)', 'Swa::swastatus2/$1');
$routes->match(['get', 'post'], 'swastatus2test/(:any)', 'Swa::swastatus2test/$1');

$routes->match(['get', 'post'], 'swastatus3/(:any)', 'Swa::swastatus3/$1');
$routes->match(['get', 'post'], 'cekdata','Swa::cekdata');
$routes->match(['get', 'post'], 'tujuancombo','Swa::tujuancombo');
$routes->match(['get', 'post'], 'kelamincombo','Swa::kelamincombo');
$routes->match(['get', 'post'], 'tujuancombo/(:any)', 'Swa::tujuancombo/$1');

$routes->match(['get', 'post'], 'ujitiket/(:any)', 'Swa::ujitiket/$1');

$routes->get('/', 'VisitorController::index');



//paguyuban 
$routes->match([ 'post'], 'ver_unverp', 'MdPaguyuban::ver_unver');
$routes->match([ 'post'], 'ver_allp', 'MdPaguyuban::ver_all');

$routes->match(['get', 'post'], 'paguyuban', 'MdPaguyuban::warga',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'paguyuban/0', 'MdPaguyuban::warga/0',['filter'=>'role:superadmin,admin,verifikator,pimpinan']);
$routes->match(['get', 'post'], 'paguyuban/(:any)', 'MdPaguyuban::warga/$1');

$routes->match(['get', 'post'], 'paguyubaneditdata', 'MdPaguyuban::wargaeditdata');
$routes->match(['get', 'post'], 'absenubah', 'MdPaguyuban::absenubah');

$routes->match(['get', 'post'], 'paguyubandata', 'MdPaguyuban::warga_data');

$routes->match(['get', 'post'], 'paguyuban_destroy', 'MdPaguyuban::warga_destroy',['filter' => 'role:superadmin,admin,dishub']);
$routes->match(['get', 'post'], 'paguyuban_simpan', 'MdPaguyuban::warga_simpan');
$routes->match(['get', 'post'], 'paguyuban_update', 'MdPaguyuban::warga_update');

$routes->match(['get', 'post'], 'paguyuban_cetak/(:any)', 'PdfMain::paguyuban_cetak/$1');



/*
 * --------------------------------------------------------------------
 * Additional Routing
 * --------------------------------------------------------------------
 *
 * There will often be times that you need additional routing and you
 * need it to be able to override any defaults in this file. Environment
 * based routes is one such time. require() additional route files here
 * to make that happen.
 *
 * You will have access to the $routes object within that file without
 * needing to reload it.
 */
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'))
{
	require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
}
