Commit c351c34d by Farendi Giotivano R.P

update fakultas dosen

parent ce52ec63
......@@ -21,7 +21,7 @@ class DashboardController extends Controller
$title = 'Dashboard PKM';
$pengumuman = $pengumuman = Pengumuman::query()->first();
if(Auth::user()->hasrole(['mahasiswa'])){
if (Auth::user()->hasrole(['mahasiswa'])) {
$user = Auth::user()->rBiodata->noidentitas;
$dataMhs = GetDataApiController::getAccount($user);
......@@ -33,6 +33,30 @@ class DashboardController extends Controller
$biodata->update($person);
}
if(Auth::user()->hasrole(['dosen'])){
$user = Auth::user()->rBiodata->email;
$isdm = GetDataApiController::sso($user);
if ($isdm[0]->nidn) {
$noidentitas = $isdm[0]->nidn;
} else {
if ($isdm[0]->nuptk) {
$noidentitas = $isdm[0]->nuptk;
} else {
$noidentitas = $isdm[0]->userid;
}
}
$person['noidentitas'] = $noidentitas;
$person['fakultas'] = $isdm[0]->namaparentsatker;
$person['prodi'] = $isdm[0]->namasatker;
$biodata = Biodata::where('email', $user)->first();
$biodata->update($person);
}
$data = [
'title' => $title,
'pengumuman' => $pengumuman,
......
......@@ -44,4 +44,13 @@ class GetDataApiController extends Controller
return $data;
}
public static function sso($email)
{
$client = new Client();
$apiRequest = $client->request('GET', 'https://sso.unesa.ac.id/userid/' . $email);
$isdm = json_decode($apiRequest->getBody()->getContents());
return $isdm;
}
}
......@@ -99,6 +99,10 @@
<a onclick="hapus('{{ encrypt($item->kelompok_id) }}', 'row-{{ $token }}')" class="btn btn-danger btn-sm">Hapus</a>
@endif
{{-- @if($item->revisi == 1)
<a href="{{ URL::to('mahasiswa/kelompok-new', encrypt($item->kelompok_id)) }}" class="btn btn-warning btn-sm">Edit</a>
@endif --}}
<div id="{{ 'lihat'.$item->kelompok_id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
......
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