<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});

$router->get('/gen_key', function() {
    return \Illuminate\Support\Str::random(32);
});

// route untuk akd_siswa
$router->post('login', 'AkdSiswaController@userLogin');

// route untuk ortu_users
$router->post('wali_login', 'OrtuUsersController@userLogin');
$router->get('laporan_absen_ortu/ortu/{pkOrtu}/bulan/{bulan}/tahun/{tahun}', 'OrtuUsersController@getLaporanSiswa');
$router->post('wali_logout', 'OrtuUsersController@logoutOrtu');
$router->get('sanksi_siswa/{idOrtu}/{tahunAjar}', 'OrtuUsersController@getSanksiSiswa');
$router->get('pembayaran_siswa/{fkSiswa}/{tahunTagihan}', 'OrtuUsersController@getPembayaranSiswa');
$router->get('filter_pembayaran/siswa/{fkSiswa}/tahun/{kodeTahun}/awal/{tglAwal}/akhir/{tglAkhir}', 'OrtuUsersController@getFilterPembayaran');
$router->get('tahun_ajaran', 'OrtuUsersController@getTahunAjaran');


// route untuk siswa_presensi
$router->get('all_absen', 'SiswaPresensiController@getAllAbsenSiswa');
$router->get('laporan_absen/{fkSiswa}', 'SiswaPresensiController@prepareLaporanSiswa');
$router->get('filter_laporan/siswa/{fkSiswa}/bulan/{bulan}/tahun/{tahun}', 'SiswaPresensiController@filterLaporanSiswa');
$router->post('input_absen', 'SiswaPresensiController@inputAbsen');
$router->get('firebase', 'SiswaPresensiController@index'); //test koneksi firebase
$router->get('ortu_notif/{idSiswa}', 'SiswaPresensiController@sendNotifOrtu');
$router->get('check_absen/siswa/{fkSiswa}/tanggal/{tanggalAbsen}', 'SiswaPresensiController@checkPresensi');

// route untuk siswa_presensi_pkl
$router->get('filter_laporan_pkl/siswa/{fkSiswa}/bulan/{bulan}/tahun/{tahun}', 'SiswaPresensiController@filterLaporanPkl');
$router->post('input_absen_pkl', 'SiswaPresensiController@inputAbsenPkl');
$router->get('check_absen_pkl/siswa/{fkSiswa}/tanggal/{tanggalAbsen}', 'SiswaPresensiController@checkPresensiPkl');

// route untuk pgw_user, & pgw_presensi
$router->post('pgw_login', 'PgwController@pgwLogin');
$router->post('input_absen_pgw', 'PgwController@inputAbsenPgw');
$router->get('filter_laporan/pgw/{fkPgw}/bulan/{bulan}/tahun/{tahun}', 'PgwController@filterLaporanPgw');
$router->get('filter_finger/pgw/{fkPgw}/bulan/{bulan}/tahun/{tahun}', 'PgwController@filterLaporanFinger');
$router->get('check_absen_pgw/pgw/{fkPegawai}/tanggal/{tanggalAbsen}', 'PgwController@checkPresensi');
$router->post('test_upload', 'PgwController@uploadFotoAbsen');
$router->post('img_upload', 'PgwController@uploadImage');