From 76876f94efe62caab3f42331e38f942abdc5653e Mon Sep 17 00:00:00 2001 From: JokoPrasetio Date: Mon, 11 May 2026 14:42:14 +0700 Subject: [PATCH] membuat code pengembangan, merubah status menjadi penilaian dan menambahkan akun batasan untuk login --- app/Http/Controllers/AuthController.php | 42 +- app/Http/Controllers/PitStopController.php | 296 ++++++++++-- resources/views/auth/login.blade.php | 428 ++++++++++++++---- resources/views/pitstop/index.blade.php | 50 +- .../views/pitstop/monitoring_pdf.blade.php | 199 ++++++-- .../pitstop/monitoring_pdf_external.blade.php | 207 +++++++-- .../progress_external_detail.blade.php | 11 +- .../views/pitstop/progress_unit.blade.php | 10 +- .../pitstop/progress_unit_detail.blade.php | 4 +- routes/web.php | 5 +- 10 files changed, 1022 insertions(+), 230 deletions(-) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index f894014..73d8c45 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -5,11 +5,15 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\User; use Illuminate\Support\Facades\Auth; +use App\Models\MasterPitStopPraAkre; class AuthController extends Controller { public function login(){ - return view('auth.login'); + $totalSteps = (int) MasterPitStopPraAkre::where('statusenabled', true)->count(); + return view('auth.login', [ + 'totalSteps' => $totalSteps, + ]); } public function submitLogin(Request $request){ @@ -17,8 +21,25 @@ class AuthController extends Controller 'namauser' => 'required', 'password' => 'required' ]); - $user = User::where('namauser', $request->namauser)->first(); + $allowedIds = [ + 727, + 1755, + 2184, + 2549, + 993, + 3053, + 2319, + 1995, + 2011, + 2145, + 1113, + 2998 + ]; + $user = User::where('namauser', $request->namauser)->first(); + if (!in_array($user->id, $allowedIds)) { + return back()->with(['error' => 'Akun Anda tidak diizinkan login']); + } if ($user && $user->passcode === sha1($request->password)) { auth()->login($user); $request->session()->regenerate(); @@ -34,4 +55,21 @@ class AuthController extends Controller request()->session()->regenerateToken(); return redirect('/login'); } + // query dibawah digunakan untuk mencari data akun user login + // select ls.id, ls.namauser, ls.objectpegawaifk, pm.nama + // FROM pegawai_m pm + // left join loginuser_s ls on pm.id = ls.objectpegawaifk + // WHERE nama ILIKE ANY (ARRAY[ + // '%Sarvita Dewi%', + // '%Milwiyandia%', + // '%Zulkarnaen%', + // '%Ripka perdija surbakti%', + // '%Arum Budiarti%', + // '%Ghufran Haning Putra%', + // '%Ifah Kisyafah%', + // '%Putri rishki Roma Dani%', + // '%Putri Milenia Ramadhanti%', + // '%Nurul susilowati%', + // '%Joko Prasetio%' + // ]); } diff --git a/app/Http/Controllers/PitStopController.php b/app/Http/Controllers/PitStopController.php index 606352e..d741ca5 100644 --- a/app/Http/Controllers/PitStopController.php +++ b/app/Http/Controllers/PitStopController.php @@ -39,7 +39,7 @@ class PitStopController extends Controller public function pitstop(){ $masterPitStop = MasterPitStopPraAkre::where('statusenabled', true)->get(); $data = [ - 'title' => 'Pit Stop', + 'title' => 'PitStop', 'masterPitStop' => $masterPitStop ]; return view('pitstop.index', $data); @@ -122,7 +122,7 @@ class PitStopController extends Controller DB::raw('ukp.id as unit_id'), DB::raw("coalesce(ukp.name, '-') as unit_name"), DB::raw('pg.id as pegawai_id'), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), ]) ->groupBy('ukp.id', 'ukp.name', 'pg.id'); @@ -206,7 +206,7 @@ class PitStopController extends Controller ->select([ DB::raw("coalesce(nullif(pl.tipe, ''), '-') as tipe"), DB::raw('pl.id as pegawai_id'), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), ]) ->groupBy(DB::raw("coalesce(nullif(pl.tipe, ''), '-')"), 'pl.id'); @@ -338,7 +338,6 @@ class PitStopController extends Controller { $unitId = $request->query('unit_id'); $unitId = is_null($unitId) || $unitId === '' ? null : (int) $unitId; - $totalSteps = (int) MasterPitStopPraAkre::where('statusenabled', true)->count(); $generatedAt = now(); @@ -362,7 +361,7 @@ class PitStopController extends Controller DB::raw('ukp.id as unit_id'), DB::raw("coalesce(ukp.name, '-') as unit_name"), DB::raw('pg.id as pegawai_id'), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), ]) ->groupBy('ukp.id', 'ukp.name', 'pg.id'); @@ -408,7 +407,7 @@ class PitStopController extends Controller ])->setPaper('a4', 'landscape'); $filename = 'monitoring-pra-akreditasi-ringkasan-' . $generatedAt->format('Ymd-Hi') . '.pdf'; - return $pdf->download($filename); + return $pdf->stream($filename); } // Mode detail: PDF per unit (lebih aman untuk memory). @@ -442,13 +441,12 @@ class PitStopController extends Controller DB::raw('pg.id as pegawai_id'), DB::raw("coalesce(pg.namalengkap, '-') as nama"), DB::raw("coalesce(pg.nip_pns, '-') as nip_pns"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select string_agg(ms.nama, ', ' order by ms.id) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pg.id - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -503,7 +501,7 @@ class PitStopController extends Controller ])->setPaper('a4', 'landscape'); $filename = 'monitoring-pra-akreditasi-unit-' . $unitId . '-' . $generatedAt->format('Ymd-Hi') . '.pdf'; - return $pdf->download($filename); + return $pdf->stream($filename); } public function monitoringPdfExternal(Request $request) @@ -530,7 +528,7 @@ class PitStopController extends Controller ->select([ DB::raw("coalesce(nullif(pl.tipe, ''), '-') as tipe"), DB::raw('pl.id as pegawai_id'), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), ]) ->groupBy(DB::raw("coalesce(nullif(pl.tipe, ''), '-')"), 'pl.id'); @@ -566,7 +564,7 @@ class PitStopController extends Controller ])->setPaper('a4', 'landscape'); $filename = 'monitoring-karyawan-luar-ringkasan-' . $generatedAt->format('Ymd-Hi') . '.pdf'; - return $pdf->download($filename); + return $pdf->stream($filename); } // Detail per tipe @@ -585,14 +583,13 @@ class PitStopController extends Controller 'pl.id', DB::raw("coalesce(pl.nama, '-') as nama"), DB::raw("coalesce(pl.nik, '-') as nik"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select string_agg(ms.nama, ', ' order by ms.id) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pl.id and px.tipe_karyawan = 'luar' - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -666,7 +663,7 @@ class PitStopController extends Controller DB::raw('ukp.id as unit_id'), DB::raw("coalesce(ukp.name, '-') as unit_name"), DB::raw('pg.id as pegawai_id'), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), ]) ->groupBy('ukp.id', 'ukp.name', 'pg.id'); @@ -737,13 +734,12 @@ class PitStopController extends Controller 'pg.id', DB::raw("coalesce(pg.namalengkap, '-') as nama"), DB::raw("coalesce(pg.nip_pns, '-') as nip_pns"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select string_agg(ms.nama, ', ' order by ms.id) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pg.id - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -807,7 +803,7 @@ class PitStopController extends Controller ->select([ DB::raw("coalesce(nullif(pl.tipe, ''), '-') as tipe"), DB::raw('pl.id as pegawai_id'), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), ]) ->groupBy(DB::raw("coalesce(nullif(pl.tipe, ''), '-')"), 'pl.id'); @@ -864,14 +860,13 @@ class PitStopController extends Controller 'pl.id', DB::raw("coalesce(pl.nama, '-') as nama"), DB::raw("coalesce(pl.nik, '-') as nik"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select string_agg(ms.nama, ', ' order by ms.id) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pl.id and px.tipe_karyawan = 'luar' - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -945,13 +940,12 @@ class PitStopController extends Controller 'pg.id', DB::raw("coalesce(pg.namalengkap, '-') as nama"), DB::raw("coalesce(pg.nip_pns, '-') as nip_pns"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select count(*) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pg.id - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -961,7 +955,6 @@ class PitStopController extends Controller from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pg.id - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1040,14 +1033,13 @@ class PitStopController extends Controller 'pl.id', DB::raw("coalesce(pl.nama, '-') as nama"), DB::raw("coalesce(pl.nik, '-') as nik"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select count(*) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pl.id and px.tipe_karyawan = 'luar' - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1058,7 +1050,6 @@ class PitStopController extends Controller left join public.praakre px on px.pegawai_id = pl.id and px.tipe_karyawan = 'luar' - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1142,13 +1133,12 @@ class PitStopController extends Controller DB::raw("coalesce(pg.namalengkap, '-') as nama"), DB::raw("coalesce(pg.nip_pns, '-') as identitas"), DB::raw("coalesce(ukp.name, '-') as unit_name"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select count(*) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pg.id - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1158,7 +1148,6 @@ class PitStopController extends Controller from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pg.id - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1183,14 +1172,13 @@ class PitStopController extends Controller DB::raw("coalesce(pl.nama, '-') as nama"), DB::raw("coalesce(pl.nik, '-') as identitas"), DB::raw("coalesce(nullif(pl.tipe, ''), '-') as unit_name"), - DB::raw("count(distinct m.id) filter (where p.status='lulus') as lulus_count"), + DB::raw("count(distinct m.id) as lulus_count"), DB::raw("coalesce(( select count(*) from public.masterpitstop ms left join public.praakre px on px.pegawai_id = pl.id and px.tipe_karyawan = 'luar' - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1201,7 +1189,6 @@ class PitStopController extends Controller left join public.praakre px on px.pegawai_id = pl.id and px.tipe_karyawan = 'luar' - and px.status = 'lulus' and px.masterpitstop_id = ms.id::text where ms.statusenabled = true and px.id is null @@ -1285,13 +1272,13 @@ class PitStopController extends Controller ->where('m.statusenabled', true); }) ->where('p.pegawai_id', $pegawaiId) - ->where('p.status', 'lulus') + // ->where('p.status', 'lulus') ->whereNotNull('m.id') ->select([ 'p.id', 'p.masterpitstop_id', DB::raw("coalesce(m.nama, '-') as step_nama"), - 'p.status', + 'p.nilai', DB::raw("to_char(p.created_at, 'DD-MM-YYYY HH24:MI') as created_at"), ]) ->orderByDesc('p.id') @@ -1327,14 +1314,13 @@ class PitStopController extends Controller ->where('m.statusenabled', true); }) ->where('p.tipe_karyawan', 'luar') - ->where('p.status', 'lulus') ->where('p.pegawai_id', $pegawaiId) ->whereNotNull('m.id') ->select([ 'p.id', 'p.masterpitstop_id', DB::raw("coalesce(m.nama, '-') as step_nama"), - 'p.status', + 'p.nilai', DB::raw("to_char(p.created_at, 'DD-MM-YYYY HH24:MI') as created_at"), ]) ->orderByDesc('p.id') @@ -1364,7 +1350,7 @@ class PitStopController extends Controller $pegawaiId = (int) $validator->validated()['pegawai_id']; $lockedSteps = PraAkre::where('pegawai_id', $pegawaiId) - ->where('status', 'lulus') + // ->where('status', 'lulus') ->distinct() ->pluck('masterpitstop_id'); @@ -1394,7 +1380,7 @@ class PitStopController extends Controller $lockedSteps = PraAkre::where('pegawai_id', $pegawaiId) ->where('tipe_karyawan', 'luar') - ->where('status', 'lulus') + // ->where('status', 'lulus') ->distinct() ->pluck('masterpitstop_id'); @@ -1414,9 +1400,10 @@ class PitStopController extends Controller $validator = Validator::make($request->all(), [ 'karyawan_id' => ['required', 'integer'], 'step' => 'required', - 'status' => 'required|in:lulus,tidak_lulus', + // 'status' => 'required|in:lulus,tidak_lulus', 'unit_id' => 'nullable|string|max:15', 'tipe_karyawan' => 'nullable|in:internal,luar', + 'nilai' => 'required' ]); if ($validator->fails()) { @@ -1460,13 +1447,13 @@ class PitStopController extends Controller $alreadyPassed = PraAkre::where('pegawai_id', $pegawaiId) ->where('tipe_karyawan', $tipeKaryawan) ->where('masterpitstop_id', $masterPitstopId) - ->where('status', 'lulus') + // ->where('status', 'lulus') ->exists(); if ($alreadyPassed) { return response()->json([ 'error' => 1, - 'message' => 'Step ini sudah lulus dan terkunci.', + 'message' => 'Pitstop ini sudah terkunci.', ], 409); } @@ -1474,7 +1461,8 @@ class PitStopController extends Controller 'pegawai_id' => $pegawaiId, 'masterpitstop_id' => $masterPitstopId, 'unit_id' => $tipeKaryawan === 'luar' ? null : ($payload['unit_id'] ?? null), - 'status' => $payload['status'], + // 'status' => $payload['status'], + 'nilai' => $payload['nilai'], 'tipe_karyawan' => $payload['tipe_karyawan'], 'action_at' => auth()->user()->objectpegawaifk , @@ -1493,4 +1481,230 @@ class PitStopController extends Controller ]); } + public function progressDetailGhost(Request $request) + { + $validator = Validator::make($request->all(), [ + 'pegawai_id' => 'required|integer|exists:pgsql.public.pegawai_m,id', + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => 1, + 'message' => 'Validasi gagal.', + 'errors' => $validator->errors(), + ], 422); + } + + $pegawaiId = (int) $validator->validated()['pegawai_id']; + + $rows = DB::connection('pgsql') + ->table('public.praakre as p') + ->leftJoin('public.masterpitstop as m', function ($join) { + $join->on(DB::raw('m.id::text'), '=', 'p.masterpitstop_id') + ->where('m.statusenabled', true); + }) + ->where('p.pegawai_id', $pegawaiId) + ->whereNotNull('m.id') + ->select([ + 'p.id', + 'p.masterpitstop_id', + DB::raw("coalesce(m.nama, '-') as step_nama"), + 'p.nilai', + DB::raw("to_char(p.created_at, 'DD-MM-YYYY HH24:MI') as created_at"), + ]) + ->orderByDesc('p.id') + ->limit(500) + ->get(); + + return response()->json([ + 'error' => 0, + 'data' => $rows, + ]); + } + + public function progressDetailExternalGhost(Request $request) + { + $validator = Validator::make($request->all(), [ + 'pegawai_id' => 'required|integer|exists:pgsql.public.pegawai_luar_pl,id', + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => 1, + 'message' => 'Validasi gagal.', + 'errors' => $validator->errors(), + ], 422); + } + + $pegawaiId = (int) $validator->validated()['pegawai_id']; + + $rows = DB::connection('pgsql') + ->table('public.praakre as p') + ->leftJoin('public.masterpitstop as m', function ($join) { + $join->on(DB::raw('m.id::text'), '=', 'p.masterpitstop_id') + ->where('m.statusenabled', true); + }) + ->where('p.tipe_karyawan', 'luar') + ->where('p.status', 'lulus') + ->where('p.pegawai_id', $pegawaiId) + ->whereNotNull('m.id') + ->select([ + 'p.id', + 'p.masterpitstop_id', + DB::raw("coalesce(m.nama, '-') as step_nama"), + 'p.status', + DB::raw("to_char(p.created_at, 'DD-MM-YYYY HH24:MI') as created_at"), + ]) + ->orderByDesc('p.id') + ->limit(500) + ->get(); + + return response()->json([ + 'error' => 0, + 'data' => $rows, + ]); + } + + public function dataProgressAllKaryawanGhost(Request $request){ + $draw = $this->dtInt($request->input('draw'), 1); + $start = $this->dtInt($request->input('start'), 0); + $length = $this->dtInt($request->input('length'), 10); + if ($length < 1) $length = 10; + if ($length > 200) $length = 200; + + $search = trim((string) data_get($request->all(), 'search.value', '')); + + $totalSteps = (int) MasterPitStopPraAkre::where('statusenabled', true)->count(); + + // Internal + $internal = DB::connection('pgsql') + ->table('public.mappegawaijabatantounitkerja_m as mp') + ->join('public.pegawai_m as pg', 'pg.id', '=', 'mp.objectpegawaifk') + ->join('public.unitkerjapegawai_m as ukp', 'ukp.id', '=', 'mp.objectunitkerjapegawaifk') + ->leftJoin('public.praakre as p', 'p.pegawai_id', '=', 'pg.id') + ->leftJoin('public.masterpitstop as m', function ($join) { + $join->on(DB::raw('m.id::text'), '=', 'p.masterpitstop_id') + ->where('m.statusenabled', true); + }) + ->where('mp.statusenabled', true) + ->where('mp.isprimary', true) + ->where('pg.statusenabled', true) + ->where('pg.kedudukanfk', 1) + ->where('ukp.statusenabled', true) + ->select([ + DB::raw("'internal' as tipe_karyawan"), + 'pg.id', + DB::raw("coalesce(pg.namalengkap, '-') as nama"), + DB::raw("coalesce(ukp.name, '-') as unit_name"), + DB::raw("count(distinct m.id) as lulus_count"), + DB::raw("coalesce(( + select count(*) + from public.masterpitstop ms + left join public.praakre px + on px.pegawai_id = pg.id + and px.masterpitstop_id = ms.id::text + where ms.statusenabled = true + and px.id is null + ), 0) as belum_count"), + DB::raw("coalesce(( + select string_agg(ms.nama, ', ' order by ms.id) + from public.masterpitstop ms + left join public.praakre px + on px.pegawai_id = pg.id + and px.masterpitstop_id = ms.id::text + where ms.statusenabled = true + and px.id is null + ), '') as belum_steps"), + ]) + ->groupBy('pg.id', 'pg.namalengkap', 'pg.nip_pns', 'ukp.name'); + + // External + $external = DB::connection('pgsql') + ->table('public.pegawai_luar_pl as pl') + ->leftJoin('public.praakre as p', function ($join) { + $join->on('p.pegawai_id', '=', 'pl.id') + ->where('p.tipe_karyawan', 'luar'); + }) + ->leftJoin('public.masterpitstop as m', function ($join) { + $join->on(DB::raw('m.id::text'), '=', 'p.masterpitstop_id') + ->where('m.statusenabled', true); + }) + ->select([ + DB::raw("'luar' as tipe_karyawan"), + 'pl.id', + DB::raw("coalesce(pl.nama, '-') as nama"), + DB::raw("coalesce(nullif(pl.tipe, ''), '-') as unit_name"), + DB::raw("count(distinct m.id) as lulus_count"), + DB::raw("coalesce(( + select count(*) + from public.masterpitstop ms + left join public.praakre px + on px.pegawai_id = pl.id + and px.tipe_karyawan = 'luar' + and px.masterpitstop_id = ms.id::text + where ms.statusenabled = true + and px.id is null + ), 0) as belum_count"), + DB::raw("coalesce(( + select string_agg(ms.nama, ', ' order by ms.id) + from public.masterpitstop ms + left join public.praakre px + on px.pegawai_id = pl.id + and px.tipe_karyawan = 'luar' + and px.masterpitstop_id = ms.id::text + where ms.statusenabled = true + and px.id is null + ), '') as belum_steps"), + ]) + ->groupBy('pl.id', 'pl.nama', 'pl.nik', DB::raw("coalesce(nullif(pl.tipe, ''), '-')")); + + $union = $internal->unionAll($external); + + $baseNoSearch = DB::connection('pgsql')->query()->fromSub($union, 'u'); + $base = DB::connection('pgsql')->query()->fromSub($union, 'u'); + + if ($search !== '') { + $base->where(function ($q) use ($search) { + $q->where('u.nama', 'ILIKE', '%' . $search . '%') + ->orWhere('u.unit_name', 'ILIKE', '%' . $search . '%') + ->orWhere('u.tipe_karyawan', 'ILIKE', '%' . $search . '%'); + }); + } + + $recordsTotal = DB::connection('pgsql')->query()->fromSub($baseNoSearch, 't')->count(); + $recordsFiltered = $search === '' + ? $recordsTotal + : DB::connection('pgsql')->query()->fromSub($base, 't')->count(); + + $rows = $base + ->orderByDesc('lulus_count') + ->orderBy('nama') + ->offset($start) + ->limit($length) + ->get(); + + $data = $rows->map(function ($r) use ($totalSteps) { + $lulus = (int) ($r->lulus_count ?? 0); + $pct = $totalSteps > 0 ? round(($lulus / $totalSteps) * 100, 1) : 0; + return [ + 'tipe_karyawan' => (string) ($r->tipe_karyawan ?? 'internal'), + 'id' => (int) ($r->id ?? 0), + 'nama' => (string) ($r->nama ?? '-'), + 'unit_name' => (string) ($r->unit_name ?? '-'), + 'lulus_count' => $lulus, + 'pct' => $pct, + 'selesai' => $totalSteps > 0 ? ($lulus >= $totalSteps ? 1 : 0) : 0, + 'belum_count' => (int) ($r->belum_count ?? 0), + 'belum_steps' => (string) ($r->belum_steps ?? ''), + ]; + })->values(); + + return response()->json([ + 'draw' => $draw, + 'recordsTotal' => $recordsTotal, + 'recordsFiltered' => $recordsFiltered, + 'data' => $data, + ]); + } + } diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index c1d4c59..a1b8773 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -2,8 +2,49 @@ @section('custom_css') +
@@ -30,32 +144,34 @@
Dicetak: {{ optional($generatedAt)->format('Y-m-d H:i') }}
-
- Total PitStop Aktif: {{ (int) ($totalSteps ?? 0) }} -
@if (($isSummaryOnly ?? false) === true) + + + + + - - - + + + @forelse ($units ?? [] as $i => $u) - + - + @empty - + @endforelse @@ -72,13 +188,20 @@
NoUnitKaryawan Selesai / Total KaryawanNoUnitKaryawan Selesai / Total
{{ $i + 1 }}{{ $i + 1 }} -
{{ $u->unit_name }}
+ {{ $u->unit_name }}
{{ number_format((int) $u->pegawai_selesai) }}/{{ number_format((int) $u->total_pegawai) }}{{ number_format((int) $u->pegawai_selesai) }}/{{ number_format((int) $u->total_pegawai) }}
Tidak ada data.Tidak ada data.
+ + + + + + + - - - - - + + + + + @@ -87,15 +210,15 @@ $selesai = ((int) ($p->total_steps ?? 0)) > 0 && ((int) ($p->lulus_steps ?? 0)) >= ((int) ($p->total_steps ?? 0)); @endphp - + - - + + @empty - + @endforelse diff --git a/resources/views/pitstop/monitoring_pdf_external.blade.php b/resources/views/pitstop/monitoring_pdf_external.blade.php index 0b944a9..05faa78 100644 --- a/resources/views/pitstop/monitoring_pdf_external.blade.php +++ b/resources/views/pitstop/monitoring_pdf_external.blade.php @@ -1,53 +1,174 @@ + - {{ $title ?? 'Monitoring Karyawan Luar' }} - + {{ $title ?? 'Monitoring Pra Akreditasi' }} +
-
{{ $title ?? 'Monitoring Karyawan Luar' }}
+
{{ $title ?? 'Monitoring Pra Akreditasi' }}
Dicetak: {{ optional($generatedAt)->format('Y-m-d H:i') }}
-
- Total PitStop Aktif: {{ (int) ($totalSteps ?? 0) }} -
@if (($isSummaryOnly ?? false) === true)
NoNamaNIPLulus / Total PitStopPitStop Belum SelesaiNoNamaNIPLulus / Total PitStopPitStop Belum Selesai
{{ $i + 1 }}{{ $i + 1 }} {{ $p->nama }}{{ $p->nip_pns }}{{ number_format((int) $p->lulus_steps) }}/{{ number_format((int) $p->total_steps) }}{{ $p->nip_pns }}{{ number_format((int) $p->lulus_steps) }}/{{ number_format((int) $p->total_steps) }} {{ $selesai ? '-' : ($p->belum_selesai_steps !== '' ? $p->belum_selesai_steps : '-') }}
Tidak ada data pegawai.Tidak ada data pegawai.
+ + + + + - - - + + + @forelse ($types ?? [] as $i => $t) - + - + @empty @@ -58,23 +179,30 @@
NoTipeSelesai / TotalNoTipeKaryawan Selesai / Total
{{ $i + 1 }}{{ $i + 1 }} -
{{ $t->tipe }}
+ {{ $t->tipe }}
{{ number_format((int) $t->pegawai_selesai) }}/{{ number_format((int) $t->total_pegawai) }}{{ number_format((int) $t->pegawai_selesai) }}/{{ number_format((int) $t->total_pegawai) }}
@else @forelse ($types ?? [] as $t) -
-
-
{{ $t->tipe }}
-