Commit afd2f461 by Alfiro Pratama

Fixing

parent 479fcc68
...@@ -38,10 +38,14 @@ class DosenController extends Controller ...@@ -38,10 +38,14 @@ class DosenController extends Controller
->whereYear('created_at', $periode->nama) ->whereYear('created_at', $periode->nama)
->count(); ->count();
$slot_tersisa = max(0, 10 - $jumlah_bimbingan);
$status_slot = $slot_tersisa == 0 ? '<span style="color: red; font-weight: bold;">(Slot Bimbingan Penuh)</span>' : "(Slot Bimbingan: $slot_tersisa slot)";
$itemData = [ $itemData = [
'id' => encrypt($item['id_sdm'].'_'.$item['nm_sdm'].'_'.$item['nidn']), 'id' => encrypt($item['id_sdm'].'_'.$item['nm_sdm'].'_'.$item['nidn']),
'full_name' => $item['nm_sdm'], 'full_name' => $item['nm_sdm'],
'description' => $item['prodi'] . '<span style="margin-left: 2em">-</span><i style="margin-left: 2em">(Slot Bimbingan: ' . (10-$jumlah_bimbingan) . ' slot)</i>', // 'description' => $item['prodi'] . '<span style="margin-left: 2em">-</span><i style="margin-left: 2em">(Slot Bimbingan: ' . (10-$jumlah_bimbingan) . ' slot)</i>',
'description' => $item['prodi'] . '<span style="margin-left: 2em">-</span><i style="margin-left: 2em">' . $status_slot . '</i>',
'nidn' => $item['nidn'], 'nidn' => $item['nidn'],
'bimbingan_count' => $jumlah_bimbingan, 'bimbingan_count' => $jumlah_bimbingan,
'disabled' => $jumlah_bimbingan >= 10 ? true : false, 'disabled' => $jumlah_bimbingan >= 10 ? true : false,
...@@ -61,7 +65,7 @@ class DosenController extends Controller ...@@ -61,7 +65,7 @@ class DosenController extends Controller
]; ];
// dd($data); // dd($data);
// return response()->json($data); return response()->json($data);
return response($data, 200); // return response($data, 200);
} }
} }
...@@ -37,6 +37,7 @@ class ProposalController extends Controller ...@@ -37,6 +37,7 @@ class ProposalController extends Controller
->whereHas('rKelompok', function ($query) use($bio){ ->whereHas('rKelompok', function ($query) use($bio){
$query->where('nidn_dosen', $bio->noidentitas); $query->where('nidn_dosen', $bio->noidentitas);
}) })
->whereRaw('LOWER(nama_dosen) = ?', [strtolower($bio->name)])
->whereYear('created_at', $year) ->whereYear('created_at', $year)
->orderBy('kelompok_id') ->orderBy('kelompok_id')
->get(); ->get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment