From 3b600217990908bb5c1cb38426ae2a2388f7f52d Mon Sep 17 00:00:00 2001
From: efbe
Date: Wed, 17 Apr 2024 16:27:09 +0700
Subject: [PATCH] fix edit mahasiswa
---
.../LayananPengajuanDpuDpaController.php | 2 +-
.../LayananPengajuanWisudaController.php | 5 +-
app/Http/Controllers/MahasiswaController.php | 25 ++++--
app/Jobs/layananPengajuanDpuDpaJob.php | 2 +-
app/Jobs/layananPengajuanWisudaJob.php | 2 +-
.../views/layanan-wisuda/resend.blade.php | 84 +++++++++++++++++++
.../views/layout/navbars/sidebar.blade.php | 2 +-
resources/views/mahasiswa/index.blade.php | 16 ++--
resources/views/mail/wisuda.blade.php | 2 +-
9 files changed, 119 insertions(+), 21 deletions(-)
diff --git a/app/Http/Controllers/LayananPengajuanDpuDpaController.php b/app/Http/Controllers/LayananPengajuanDpuDpaController.php
index f7029ed..c92bca6 100644
--- a/app/Http/Controllers/LayananPengajuanDpuDpaController.php
+++ b/app/Http/Controllers/LayananPengajuanDpuDpaController.php
@@ -49,7 +49,7 @@ public function tambah(){
public function terima(Request $request){
$id = $request->id;
$countcaseid = PengajuanDpuDpa::where('ttd_operator','!=','-')->count();
- $caseid = "LS".date_format(date_create(),"ym").$countcaseid+1;
+ $caseid = "LS".date_format(date_create(),"ym").$countcaseid+3;
$cekData = PengajuanDpuDpa::where('caseid',$caseid)->first();
$data = PengajuanDpuDpa::where('id',$id)->first();
diff --git a/app/Http/Controllers/LayananPengajuanWisudaController.php b/app/Http/Controllers/LayananPengajuanWisudaController.php
index 2387e3f..1c18f6f 100644
--- a/app/Http/Controllers/LayananPengajuanWisudaController.php
+++ b/app/Http/Controllers/LayananPengajuanWisudaController.php
@@ -673,7 +673,10 @@ public function submitettd($url, $caseid, Request $request){
public function resend(){
$role_untuk_ettd = ['dpu','dpa','penguji1','penguji2','skpi','kalab','ruangbaca','wakildekan1'];
- $data = PengajuanWisuda::where('caseid','!=','-')->get();
+ $data = PengajuanWisuda::where('caseid','!=','-')
+ ->select('pengajuan_wisudas.*','mahasiswas.nama')
+ ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')
+ ->get();
return view('layanan-wisuda.resend',['title' => 'Pengajuan Syarat Wisuda | Admin Dashboard','data'=> $data,'role' => $role_untuk_ettd]);
}
diff --git a/app/Http/Controllers/MahasiswaController.php b/app/Http/Controllers/MahasiswaController.php
index e760904..dad92b0 100644
--- a/app/Http/Controllers/MahasiswaController.php
+++ b/app/Http/Controllers/MahasiswaController.php
@@ -85,8 +85,8 @@ public function update(Request $request){
'bagian'=>'required|numeric',
'dosen_dpu_id'=>'required|numeric',
'dosen_dpa_id'=>'required|numeric',
- 'dosen_penguji1_id'=>'required|numeric',
- 'dosen_penguji2_id'=>'required|numeric',
+ // 'dosen_penguji1_id'=>'required|numeric',
+ // 'dosen_penguji2_id'=>'required|numeric',
],[
'nim.required'=>'NIP Wajib Diisi',
'nim.numeric'=>'NIM Wajib Berisi Angka saja',
@@ -94,10 +94,9 @@ public function update(Request $request){
'email.email'=>'Format email tidak sesuai, cek lagi email anda, Contoh mahasiswa@mail.com/ mahasiswa@mail.unej.ac.id',
'dosen_dpu_id.numeric'=>'Dosen Pembimbing tidak valid, cek kembali Dosen Pembimbing yang dipilih',
'dosen_dpa_id.numeric'=>'Dosen Pembimbing tidak valid, cek kembali Dosen Pembimbing yang dipilih',
- 'dosen_penguji1_id.numeric'=>'Dosen Penguji tidak valid, cek kembali Dosen Penguji yang dipilih',
- 'dosen_penguji2_id.numeric'=>'Dosen Penguji tidak valid, cek kembali Dosen Penguji yang dipilih',
+ // 'dosen_penguji1_id.numeric'=>'Dosen Penguji tidak valid, cek kembali Dosen Penguji yang dipilih',
+ // 'dosen_penguji2_id.numeric'=>'Dosen Penguji tidak valid, cek kembali Dosen Penguji yang dipilih',
]);
-
$mahasiswa = Mahasiswa::find($request->id);
$mahasiswa->nim = $request->nim;
$mahasiswa->nama = $request->nama;
@@ -106,17 +105,29 @@ public function update(Request $request){
$mahasiswa->bagian = $request->bagian;
$mahasiswa->dosen_dpu_id = $request->dosen_dpu_id;
$mahasiswa->dosen_dpa_id = $request->dosen_dpa_id;
- $mahasiswa->dosen_penguji1_id = $request->dosen_penguji1_id;
- $mahasiswa->dosen_penguji2_id = $request->dosen_penguji2_id;
$mahasiswa->judul_seminar_proposal = $request->judul_seminar_proposal;
$mahasiswa->judul_skripsi_id = $request->judul_skripsi_id;
$mahasiswa->judul_skripsi_en= $request->judul_skripsi_en;
$mahasiswa->judul_jurnal = $request->judul_jurnal;
$mahasiswa->judul_artikel = $request->judul_artikel;
+
+ //jika penguji kosong, maka save ini
+ if($request->dosen_penguji1_id == "Pilih Dosen Penguji Utama" && $request->dosen_penguji2_id == "Pilih Dosen Penguji Anggota"){
+ $mahasiswa->dosen_penguji1_id = 1;
+ $mahasiswa->dosen_penguji2_id = 1;
+ if($mahasiswa->save()){
+ return redirect()->route('mahasiswa.index')->with('success','Data Telah Berhasil Disimpan');
+ }
+ }
+ dd($request);
+ //jika penguji diisi maka save ini
+ $mahasiswa->dosen_penguji1_id = $request->dosen_penguji1_id;
+ $mahasiswa->dosen_penguji2_id = $request->dosen_penguji2_id;
if($mahasiswa->save()){
return redirect()->route('mahasiswa.index')->with('success','Data Telah Berhasil Disimpan');
}
+
return back()->withInput();
}
diff --git a/app/Jobs/layananPengajuanDpuDpaJob.php b/app/Jobs/layananPengajuanDpuDpaJob.php
index 9e5e4cd..02d3297 100644
--- a/app/Jobs/layananPengajuanDpuDpaJob.php
+++ b/app/Jobs/layananPengajuanDpuDpaJob.php
@@ -116,7 +116,7 @@ public function handle(): void
'users.nama_gelar',
'users.email')
->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')
- ->join('users','users.id','=','mahasiswas.dosen_dpu_id')
+ ->join('users','users.id','=','mahasiswas.dosen_dpa_id')
->first();
//data email
diff --git a/app/Jobs/layananPengajuanWisudaJob.php b/app/Jobs/layananPengajuanWisudaJob.php
index 31abdf9..46c6399 100644
--- a/app/Jobs/layananPengajuanWisudaJob.php
+++ b/app/Jobs/layananPengajuanWisudaJob.php
@@ -116,7 +116,7 @@ public function handle(): void
'subject' => $data->caseid.' - Kesediaan Pengajuan Syarat Wisuda / Yudisium',
'email' => $data->email,
'jenis' => $this->data['jenis'],
- 'url' => route('layanan-wisuda.caseid',['caseid'=>$data->caseid]),
+ 'url' => route('layanan-wisuda.cetak',['caseid'=>$data->caseid]),
];
//send email
diff --git a/resources/views/layanan-wisuda/resend.blade.php b/resources/views/layanan-wisuda/resend.blade.php
index db2782d..85e6059 100644
--- a/resources/views/layanan-wisuda/resend.blade.php
+++ b/resources/views/layanan-wisuda/resend.blade.php
@@ -114,6 +114,18 @@
{{ route('layanan-wisuda.ettd',['url'=>'wakildekan1','caseid'=>'LYXXXX']) }}
Detail
+
+ 9
+ Mahasiswa
+ {{ route('layanan-wisuda.ettd',['url'=>'monitoring','caseid'=>'LYXXXX']) }}
+ Detail
+
+
+ 9
+ Mahasiswa Selesai
+ {{ route('layanan-wisuda.cetak',['caseid'=>'LYXXXX']) }}
+ Detail
+
@@ -404,6 +416,78 @@
+
+
+
+
diff --git a/resources/views/layout/navbars/sidebar.blade.php b/resources/views/layout/navbars/sidebar.blade.php
index 804759a..425ea5c 100644
--- a/resources/views/layout/navbars/sidebar.blade.php
+++ b/resources/views/layout/navbars/sidebar.blade.php
@@ -95,7 +95,6 @@
- @role('Super Administrator')
@@ -104,6 +103,7 @@
+ @role('Super Administrator')
diff --git a/resources/views/mahasiswa/index.blade.php b/resources/views/mahasiswa/index.blade.php
index d0b1708..83a74df 100644
--- a/resources/views/mahasiswa/index.blade.php
+++ b/resources/views/mahasiswa/index.blade.php
@@ -113,14 +113,14 @@
Bagian Lab
Pilih Laboratorium
- Farmasi Klinik Dan Komunitas
- Farmakologi Dan Hewan Coba
- Farmakognosi dan Fitokimia
- Mikrobiologi dan Bioteknologi Farmasi
- Farmasetika
- Teknologi Farmasi
- Kimia Analisis
- Kimia Medisinal
+ bagian === '1' ? 'selected' : '' }}>Farmasi Klinik Dan Komunitas
+ bagian === '2' ? 'selected' : '' }}>Farmakologi Dan Hewan Coba
+ bagian === '3' ? 'selected' : '' }}>Farmakognosi dan Fitokimia
+ bagian === '4' ? 'selected' : '' }}>Mikrobiologi dan Bioteknologi Farmasi
+ bagian === '5' ? 'selected' : '' }}>Farmasetika
+ bagian === '6' ? 'selected' : '' }}>Teknologi Farmasi
+ bagian === '7' ? 'selected' : '' }}>Kimia Analisis
+ bagian === '8' ? 'selected' : '' }}>Kimia Medisinal
diff --git a/resources/views/mail/wisuda.blade.php b/resources/views/mail/wisuda.blade.php
index c01c77e..b7f95b6 100644
--- a/resources/views/mail/wisuda.blade.php
+++ b/resources/views/mail/wisuda.blade.php
@@ -29,7 +29,7 @@
{{ $mailData['url'] }}
- @elseif( $mailData['jenis']=='mahasiswa Selesai' )
+ @elseif( $mailData['jenis']=='mahasiswa selesai' )
Kepada Saudara/Saudari {{ $mailData['nama_mahasiswa'] }}
Surat Pernyataan Persyaratan Yudisium Telah Selesai, anda dapat mengunduh berkas pada link berikut : Klik Disini