Commit d01b8225 by Siti Aisah

tampilan gagal update nik kosong

parent 48464d45
......@@ -98,28 +98,31 @@ public function store(Request $request){
$reviewer = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->get();
foreach($reviewer as $r){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$r->nik)->select('namalengkap','nip')->first();
// if(!empty($isdm)){
$saku = [
'id_pengajuan' => $hasil->id,
'nik' => $r->nik,
'nama' => $isdm->namalengkap,
'nip' => $isdm->nip
];
// } else {
// $saku = [
// 'id_pengajuan' => $hasil->id,
// 'nik' => $r->nik,
// 'nama' => $r->penelaah,
// 'nip' => 'NIK belum terdaftar di ISDM. Silakan update ke Kepegawaian.'
// ];
// }
$rev[$r->nik] = $r->nik;
}
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$rev)->select('namalengkap','nip','noktp')->get();
if(count($isdm) >= 2){
foreach($isdm as $sdm){
$saku = [
'id_pengajuan' => $hasil->id,
'nik' => $sdm->noktp,
'nama' => $sdm->namalengkap,
'nip' => $sdm->nip
];
}
Penelaah::query()->create($saku);
} else {
foreach($isdm as $sdm){
$data['kosong'] = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first();
}
return view('transaksi-gagal', $data);
}
DB::commit();
return Redirect::route('transaksi.index')
......@@ -128,9 +131,9 @@ public function store(Request $request){
catch(Exception $e){
Log::error($e);
DB::rollBack();
return Redirect::route('transaksi.index')
->with('error', 'NIK tidak terdaftar, silakan update di ISDM');
->with('error', 'Data Kategori gagal diupdate');
}
}
}
@extends('layouts.master')
@section('content')
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Notifikasi</h3>
</div>
<div class="card-body">
<h4>{{ $kosong->penelaah }} gagal update karena:<br>
NIK {{ $kosong->nik }} belum terdaftar di ISDM. Silakan update ke Kepegawaian.</h4><br>
<a href="{{ route('transaksi.index') }}">Kembali</a>
</div>
</div>
</div>
</div>
@push('js')
@endpush
@stop
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