<?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('Home');
$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->add('d1','Dashboard::eparkir1');

$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');


//MdWarga 
$routes->match(['get', 'post'], 'warga', 'MdWarga::warga',['filter' => 'role:superadmin,admin,verifikator,pimpinan']);
$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']);
$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', 'PdfMain::warga_cetak');
$routes->match(['get', 'post'], 'armada_cetak', 'PdfMain::armada_cetak');

$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([ 'post'], 'ver_unver', 'MdWarga::ver_unver');
$routes->match([ 'post'], 'ver_all', 'MdWarga::ver_all');


//====


//MdArmada 
$routes->match(['get', 'post'], 'armada', 'MdArmada::armada',['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']);
$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']);
$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');


//====


//swa 
$routes->match(['post'], 'ceknik', 'Swa::ceknik');
$routes->match(['get','post'], 'cekkoded', 'Swa::cekkoded');
$routes->match(['post'], 'swa', 'Swa::index');
$routes->match(['get','post'], 'kirimkan', 'Swa::kirimkan');
$routes->match(['get','post'], 'kirimkandetil', 'Swa::kirimkandetil');
$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'], '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_data', 'MdMaster::wilayah_data');

$routes->match(['get', 'post'], 'wilayaheditdata', 'MdMaster::wilayaheditdata');
$routes->match(['get', 'post'], 'wilayah_status', 'MdMaster::wilayah_status');
$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'], '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(['get', 'post'], 'tunjuk', 'MdMudik::tunjuk');
$routes->match(['get', 'post'], 'aturdetil/(:any)', 'MdMudik::aturdetil/$1');
$routes->match(['get', 'post'], 'hapusdet', 'MdMudik::hapusdet');
$routes->match(['get', 'post'], 'finalisasi', 'MdMudik::finalisasi');
$routes->match(['get', 'post'], 'unfinalisasi', 'MdMudik::unfinalisasi');

//$routes->match(['get','post'], 'qrcode', 'QRBarCode::qrcode');
//$routes->match(['get', 'post'], 'qrcode/(:any)','Swa::qrcode/$1');
$routes->match(['get', 'post'], 'qr','QrBarcode::qr');
$routes->match(['get', 'post'], 'swastatus','Swa::swastatus');
$routes->match(['get', 'post'], 'swadaftar','Swa::swadaftar');
$routes->match(['get', 'post'], 'swadaftardetil/(:any)', 'Swa::swadaftardetil/$1');
$routes->match(['get', 'post'], 'swastatus2/(:any)', 'Swa::swastatus2/$1');
$routes->match(['get', 'post'], 'swastatus3/(:any)', 'Swa::swastatus3/$1');
$routes->match(['get', 'post'], 'cekdata','Swa::cekdata');
$routes->match(['get', 'post'], 'tujuancombo','Swa::tujuancombo');



/*
 * --------------------------------------------------------------------
 * 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';
}
