init backend presensi

This commit is contained in:
mwpn
2026-03-05 14:37:36 +07:00
commit b4fda6b9c9
319 changed files with 27261 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Modules\Discipline\Controllers;
use App\Core\BaseApiController;
use App\Modules\Discipline\Models\DisciplineLevelModel;
use CodeIgniter\HTTP\ResponseInterface;
/**
* API untuk config level disiplin (rentang poin -> tindakan sekolah).
*/
class DisciplineLevelController extends BaseApiController
{
/**
* GET /api/discipline/levels
*/
public function index(): ResponseInterface
{
$model = new DisciplineLevelModel();
$rows = $model->where('is_active', 1)
->orderBy('min_score', 'ASC')
->findAll();
$data = array_map(static function (array $r) {
return [
'id' => (int) $r['id'],
'min_score' => (int) $r['min_score'],
'max_score' => $r['max_score'] !== null ? (int) $r['max_score'] : null,
'title' => $r['title'],
'school_action'=> $r['school_action'],
'executor' => $r['executor'],
];
}, $rows);
return $this->successResponse($data, 'Discipline levels');
}
}