From 755ac3c2030a794cfa317f62ce9441f3ab32880b Mon Sep 17 00:00:00 2001 From: fikyb Date: Wed, 20 Mar 2024 17:08:09 +0700 Subject: [PATCH] fix sidang akhir --- .../LayananPengajuanDpuDpaController.php | 21 +- .../Controllers/LayananSeminarProposal.php | 25 +- .../LayananSidangAkhirController.php | 382 ++++++++++++++++++ app/Http/Controllers/MonitoringController.php | 19 + app/Jobs/layananPengajuanDpuDpaJob.php | 52 ++- app/Jobs/layananSeminarProposalJob.php | 10 +- app/Jobs/layananSidangAkhirJob.php | 105 +++++ app/Models/PengajuanSidangAkhir.php | 22 + .../2024_03_18_220555_create_jobs_table.php | 32 ++ ...0_create_pengajuan_sidang_akhirs_table.php | 38 ++ .../views/layanan-dpudpa/index.blade.php | 73 +++- .../views/layanan-sempro/index.blade.php | 20 +- .../views/layanan-sidangakhir/cari.blade.php | 67 +++ .../views/layanan-sidangakhir/cetak.blade.php | 192 +++++++++ .../views/layanan-sidangakhir/ettd.blade.php | 106 +++++ .../views/layanan-sidangakhir/index.blade.php | 274 +++++++++++++ .../layanan-sidangakhir/tambah.blade.php | 219 ++++++++++ resources/views/layout/app_guest.blade.php | 8 + .../views/layout/navbars/sidebar.blade.php | 8 + .../views/monitoring/sidangakhir.blade.php | 99 +++++ routes/web.php | 16 + 21 files changed, 1743 insertions(+), 45 deletions(-) create mode 100644 app/Http/Controllers/LayananSidangAkhirController.php create mode 100644 app/Jobs/layananSidangAkhirJob.php create mode 100644 app/Models/PengajuanSidangAkhir.php create mode 100644 database/migrations/2024_03_18_220555_create_jobs_table.php create mode 100644 database/migrations/2024_03_19_103810_create_pengajuan_sidang_akhirs_table.php create mode 100644 resources/views/layanan-sidangakhir/cari.blade.php create mode 100644 resources/views/layanan-sidangakhir/cetak.blade.php create mode 100644 resources/views/layanan-sidangakhir/ettd.blade.php create mode 100644 resources/views/layanan-sidangakhir/index.blade.php create mode 100644 resources/views/layanan-sidangakhir/tambah.blade.php create mode 100644 resources/views/monitoring/sidangakhir.blade.php diff --git a/app/Http/Controllers/LayananPengajuanDpuDpaController.php b/app/Http/Controllers/LayananPengajuanDpuDpaController.php index 626402e..53b1305 100644 --- a/app/Http/Controllers/LayananPengajuanDpuDpaController.php +++ b/app/Http/Controllers/LayananPengajuanDpuDpaController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Jobs\kirimNotifikasiErrorJob; use App\Jobs\layananPengajuanDpuDpaJob; use App\Models\Bagian; @@ -11,12 +12,13 @@ use Barryvdh\DomPDF\Facade\Pdf; use Carbon\Carbon; - +use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; use SimpleSoftwareIO\QrCode\Facades\QrCode; use Spatie\Permission\Models\Role; +use Ixudra\Curl\Facades\Curl; class LayananPengajuanDpuDpaController extends Controller { @@ -347,6 +349,23 @@ public function cetak($caseid){ return $pdf->setPaper('a4', 'potrait')->stream($caseid.'-Kesediaan Menjadi Dosen Pembimbing Tugas Akhir'); } +public function resend($caseid,Request $request){ + try{ + $data = PengajuanDpuDpa::where('caseid',$caseid)->first(); + $data_job = [ + 'id' => $data->id, + 'jenis' => $request->jenis, + ]; + dispatch(new layananPengajuanDpuDpaJob($data_job)); + }catch(Exception $e){ + $text['error'] = $e->getMessage(); + dispatch(new kirimNotifikasiErrorJob($text)); + + return redirect()->route('layanan-dpudpa.index')->with('error','Error : '.$text['error']); + } + return redirect()->route('layanan-dpudpa.index')->with('success','Berhasil Kirim Ulang Email Kepada '.$request->jenis.' Dengan CaseID : '.$caseid); +} + //cek apakah DPU dan DPU sudah Tanda tangan, jika sudah maka akan mengirim notifikasi ke Kombi private function cek_dpa_dpu($caseid){ $status = PengajuanDpuDpa::where('caseid',$caseid) diff --git a/app/Http/Controllers/LayananSeminarProposal.php b/app/Http/Controllers/LayananSeminarProposal.php index 679ec74..ead4bb9 100644 --- a/app/Http/Controllers/LayananSeminarProposal.php +++ b/app/Http/Controllers/LayananSeminarProposal.php @@ -26,11 +26,9 @@ public function index(){ 'mahasiswas.nim as nim', 'mahasiswas.nama as nama', 'dosen_dpu.nama_gelar as dpu_nama_gelar', - 'dosen_dpa.nama_gelar as dpa_nama_gelar' ) ->join('mahasiswas','mahasiswas_id','=','mahasiswas.id') ->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id') - ->join('users as dosen_dpa','mahasiswas.dosen_dpa_id','=','dosen_dpa.id') ->get(); return view('layanan-sempro.index',['title' => 'Pengajuan Seminar Proposal | Admin Dashboard','data' => $data]); } @@ -180,7 +178,6 @@ public function store(Request $request){ return redirect()->route('layanan-sempro.tambah')->with('success','Sukses Tambah Data, Silahkan Menunggu Email Konfirmasi setelah disetujui Oleh Operator'); } return redirect()->route('layanan-sempro.tambah')->with('error','Gagal Tambah data, Cek kembali data yang anda masukkan'); - // $path = $request->nim.'/'.$file_transkrip_name; } //done @@ -216,7 +213,8 @@ public function destroy(Request $request){ catch(Exception $e){ $text['error'] = $e->getMessage(); dispatch(new kirimNotifikasiErrorJob($text)); - exit; + + return redirect()->route('layanan-sempro.index')->with('error','Error : '.$text['error']); } } @@ -366,4 +364,23 @@ public function cetak($caseid){ //jika URL tidak diantara ketika itu maka render ini } + +public function resend($caseid, Request $request){ + try{ + $data = PengajuanSempro::where('caseid',$caseid)->first(); + $data_job = [ + 'id' => $data->id, + 'jenis' => $request->jenis, + ]; + dispatch(new layananSeminarProposalJob($data_job)); + }catch(Exception $e){ + $text['error'] = $e->getMessage(); + dispatch(new kirimNotifikasiErrorJob($text)); + + return redirect()->route('layanan-sempro.index')->with('error','Error : '.$text['error']); + } + return redirect()->route('layanan-sempro.index')->with('success','Berhasil Kirim Ulang Email Kepada '.$request->jenis.' Dengan CaseID : '.$caseid); + +} + } diff --git a/app/Http/Controllers/LayananSidangAkhirController.php b/app/Http/Controllers/LayananSidangAkhirController.php new file mode 100644 index 0000000..fa446fc --- /dev/null +++ b/app/Http/Controllers/LayananSidangAkhirController.php @@ -0,0 +1,382 @@ +join('mahasiswas','mahasiswas_id','=','mahasiswas.id') + ->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id') + ->get(); + return view('layanan-sidangakhir.index',['title' => 'Pengajuan Sidang Akhir | Admin Dashboard', 'data' => $data]); +} + +public function tambah(){ + $dosen = User::role('Dosen')->get(); + $bagian = Bagian::select('id','nama_bagian')->get(); + //cek apakah ada data mahasiswa dari hasil cari + $nim = session('mahasiswas_id'); + if($nim!=null){ + $data_mahasiswa = Mahasiswa::find($nim); + return view('layanan-sidangakhir.tambah',['dosen'=>$dosen, 'bagian'=>$bagian,'data_mahasiswa'=>$data_mahasiswa]); + } + return view('layanan-sidangakhir.tambah',['dosen'=>$dosen, 'bagian'=>$bagian]); +} + +public function cari(){ + return view('layanan-sidangakhir.cari',['title'=>'Cari Data Mahasiswa Untuk Keperluan Pengajuan Sidang Akhir']); +} + +public function search(Request $request){ + $data = Mahasiswa::where('nim',$request->nim)->first(); + if($data==null){ + return redirect()->route('layanan-sidangakhir.tambah')->with('error','NIM Tidak Ditemukan, Gunakan Fitur Tambah'); + } + return redirect()->route('layanan-sidangakhirtambah')->with('mahasiswas_id',$data->id); +} + +public function destroy(Request $request){ + $id = $request->id; + //cari data dan kirim notif sebelum dihapus + $data = PengajuanSidangAkhir::where('pengajuan_sidang_akhirs.id',$id) + ->join('mahasiswas','mahasiswas_id','=','mahasiswas.id') + ->first(); + //data yang akan dikirim untuk dihapus + $data_job = [ + 'jenis' => 'penolakan', + 'nama' => $data->nama, + 'email' => $data->email, + 'created_at' => $data->created_at, + 'alasan' => $request->alasan, + ]; + //lokasi file + $path = [ + 'bukti_transkrip' => $data->nim."/".$data->bukti_transkrip, + 'bukti_turnitin' => $data->nim."/".$data->bukti_turnitin, + 'bukti_sister' => $data->nim."/".$data->bukti_sister, + 'bukti_lembar_monitoring' => $data->nim."/".$data->bukti_lembar_monitoring, + 'bukti_naskah_dosen_pembimbing' => $data->nim."/".$data->bukti_naskah_dosen_pembimbing, + 'bukti_naskah_dosen_penguji' => $data->nim."/".$data->bukti_naskah_dosen_penguji, + ]; + + //delete file + foreach($path as $item){ + try { + Storage::disk('public')->delete($item); + } + catch(Exception $e){ + $text['error'] = $e->getMessage(); + dispatch(new kirimNotifikasiErrorJob($text)); + + return redirect()->route('layanan-sidangakhir.index')->with('error','Error : '.$text['error']); + } + } + + //delete data mahasiswa + try { + $dataDelete = PengajuanSidangAkhir::findOrFail($id); + $dataDelete->delete(); + //kirim notif ke mahasiswa bahwa ditolak + dispatch(new layananSidangAkhirJob($data_job)); + + }catch(Exception $e){ + //kirim notif error jika terjadi error + $text['error'] = $e->getMessage(); + dispatch(new kirimNotifikasiErrorJob($text)); + + return redirect()->route('layanan-sidangakhir.index')->with('error','Error : '.$text['error']); + } + return redirect()->route('layanan-sidangakhir.index')->with('success','Permintaan Sudah Diproses, Email akan segera dikirim ke penerima'); +} + +public function store(Request $request){ + + $request->validate([ + 'nim'=>'required|numeric', + 'nama'=>'required', + 'nomor_hp'=>'required|numeric', + 'email'=>'required|email', + 'judul_skripsi_id'=>'required', + 'judul_skripsi_en'=>'required', + 'bagian'=>'required|numeric', + 'dosen_dpu'=>'required|numeric', + 'dosen_dpa'=>'required|numeric', + 'dosen_penguji1'=>'required|numeric', + 'dosen_penguji2'=>'required|numeric', + 'nilai_plagiasi'=>'required|numeric', + 'bukti_lembar_monitoring' => 'required|mimes:pdf|max:4096', + 'bukti_transkrip' => 'required|mimes:pdf|max:4096', + 'bukti_turnitin' => 'required|mimes:pdf|max:4096', + 'bukti_sister' => 'required|mimes:pdf|max:4096', + 'bukti_naskah_dosen_pembimbing' => 'required|mimes:pdf|max:4096', + 'bukti_naskah_dosen_penguji' => 'required|mimes:pdf|max:4096', + ],[ + 'nim.required'=>'NIP Wajib Diisi', + 'nim.numeric'=>'NIM Wajib Berisi Angka saja', + 'nomor_hp.numeric'=>'Nomor HP Wajib Menggunakan Angka, Contoh 089xxxxx', + 'email.email'=>'Format email tidak sesuai, cek lagi email anda, Contoh mahasiswa@gmail.com/ mahasiswa@mail.unej.ac.id', + 'bagian.numeric'=>'Bagian tidak valid, cek kembali Bagian yang dipilih', + 'dosen_dpu.numeric'=>'Dosen Pembimbing tidak valid, cek kembali Dosen Pembimbing Utama yang dipilih', + 'dosen_dpa.numeric'=>'Dosen Pembimbing tidak valid, cek kembali Dosen Pembimbing Anggota yang dipilih', + 'dosen_penguji1.numeric'=>'Dosen Penguji tidak valid, cek kembali Dosen Penguji Utama yang dipilih', + 'dosen_penguji2.numeric'=>'Dosen Penguji tidak valid, cek kembali Dosen Penguji Anggota yang dipilih', + 'nilai_plagiasi.numeric'=>'Masukkan Nilai Plagiasi Berupa Angka saja', + ]); + + //olah file + $bukti_transkrip = $request->file('bukti_transkrip'); + $bukti_turnitin = $request->file('bukti_turnitin'); + $bukti_sister = $request->file('bukti_sister'); + $bukti_lembar_monitoring = $request->file('bukti_lembar_monitoring'); + $bukti_naskah_dosen_pembimbing = $request->file('bukti_naskah_dosen_pembimbing'); + $bukti_naskah_dosen_penguji = $request->file('bukti_naskah_dosen_penguji'); + //beri nama tiap file + $bukti_transkrip_name= 'LA_1'.str_replace(' ', '_',$bukti_transkrip->getClientOriginalName()); + $bukti_turnitin_name = 'LA_2'.str_replace(' ', '_',$bukti_turnitin->getClientOriginalName()); + $bukti_sister_name = 'LA_3'.str_replace(' ', '_',$bukti_sister->getClientOriginalName()); + $bukti_lembar_monitoring_name = 'LA_4'.str_replace(' ', '_',$bukti_lembar_monitoring->getClientOriginalName()); + $bukti_naskah_dosen_pembimbing_name = 'LA_5'.str_replace(' ', '_',$bukti_naskah_dosen_pembimbing->getClientOriginalName()); + $bukti_naskah_dosen_penguji_name = 'LA_6'.str_replace(' ', '_',$bukti_naskah_dosen_penguji->getClientOriginalName()); + + //cek apakah data mahasiswa ada, jika ada maka dikembalikan dan dianjurkan menggunakan fitur cari + $mahasiswa = Mahasiswa::where('nim',$request->nim)->first(); + if(!is_null($mahasiswa) && $request->status!="ada"){ + return redirect()->route('layanan-sidangakhir.tambah')->with('error','Data Anda Sudah Ada, Gunakan Fitur Cari Menggunakan NIM :'.$request->nim); + } + //kalo menggunakan fitur cari, akan menggunakan fungsi ini + elseif(!is_null($mahasiswa) && $request->status=="ada"){ + $mahasiswas_id = $mahasiswa->id; + $data_sidangakhir['mahasiswas_id'] = $mahasiswas_id; + $data_sidangakhir['nilai_plagiasi'] = $request->nilai_plagiasi; + $data_sidangakhir['bukti_transkrip'] = $bukti_transkrip_name; + $data_sidangakhir['bukti_turnitin'] = $bukti_turnitin_name; + $data_sidangakhir['bukti_sister'] = $bukti_sister_name; + $data_sidangakhir['bukti_lembar_monitoring'] = $bukti_lembar_monitoring_name; + $data_sidangakhir['bukti_naskah_dosen_pembimbing'] = $bukti_naskah_dosen_pembimbing_name; + $data_sidangakhir['bukti_naskah_dosen_penguji'] = $bukti_naskah_dosen_penguji_name; + //save data pengajuan + PengajuanSidangAkhir::create($data_sidangakhir); + //update data mahasiswa + $mahasiswa->judul_skripsi_id = $request->judul_skripsi_id; + $mahasiswa->judul_skripsi_en = $request->judul_skripsi_en; + $mahasiswa->save(); + //save file + Storage::disk('public')->put($request->nim.'/'.$bukti_transkrip_name, file_get_contents($bukti_transkrip)); + Storage::disk('public')->put($request->nim.'/'.$bukti_turnitin_name, file_get_contents($bukti_turnitin)); + Storage::disk('public')->put($request->nim.'/'.$bukti_sister_name, file_get_contents($bukti_sister)); + Storage::disk('public')->put($request->nim.'/'.$bukti_lembar_monitoring_name, file_get_contents($bukti_lembar_monitoring)); + Storage::disk('public')->put($request->nim.'/'.$bukti_naskah_dosen_pembimbing_name, file_get_contents($bukti_naskah_dosen_pembimbing)); + Storage::disk('public')->put($request->nim.'/'.$bukti_naskah_dosen_penguji_name, file_get_contents($bukti_naskah_dosen_penguji)); + return redirect()->route('layanan-sidangakhir.tambah')->with('success','Sukses Tambah Data, Silahkan Menunggu Email Konfirmasi setelah disetujui Oleh Operator'); + } + + //jika data belum ada, maka create data baru + $data_mhs['nim'] = $request->nim; + $data_mhs['nama'] = $request->nama; + $data_mhs['nomor_hp'] = $request->nomor_hp; + $data_mhs['email'] = $request->email; + $data_mhs['judul_seminar_proposal'] = '-'; + $data_mhs['bagian'] = $request->bagian; + $data_mhs['dosen_dpu_id'] = $request->dosen_dpu; + $data_mhs['dosen_dpa_id'] = $request->dosen_dpa; + $data_mhs['dosen_penguji1_id'] = $request->dosen_penguji1; + $data_mhs['dosen_penguji2_id'] = $request->dosen_penguji2; + //set default values to - + $data_mhs['judul_skripsi_id'] = $request->judul_skripsi_id; + $data_mhs['judul_skripsi_en'] = $request->judul_skripsi_en; + $data_mhs['judul_jurnal'] = '-'; + $data_mhs['judul_artikel'] = '-'; + + + + + + + //save data mahasiswa dan pengajuan + if(Mahasiswa::create($data_mhs)){ + $mahasiswas_id = Mahasiswa::where('nim',$request->nim)->first(); + $data_sidangakhir['mahasiswas_id'] = $mahasiswas_id->id; + $data_sidangakhir['nilai_plagiasi'] = $request->nilai_plagiasi; + $data_sidangakhir['bukti_transkrip'] = $bukti_transkrip_name; + $data_sidangakhir['bukti_turnitin'] = $bukti_turnitin_name; + $data_sidangakhir['bukti_sister'] = $bukti_sister_name; + $data_sidangakhir['bukti_lembar_monitoring'] = $bukti_lembar_monitoring_name; + $data_sidangakhir['bukti_naskah_dosen_pembimbing'] = $bukti_naskah_dosen_pembimbing_name; + $data_sidangakhir['bukti_naskah_dosen_penguji'] = $bukti_naskah_dosen_penguji_name; + PengajuanSidangAkhir::create($data_sidangakhir); + + Storage::disk('public')->put($request->nim.'/'.$bukti_transkrip_name, file_get_contents($bukti_transkrip)); + Storage::disk('public')->put($request->nim.'/'.$bukti_turnitin_name, file_get_contents($bukti_turnitin)); + Storage::disk('public')->put($request->nim.'/'.$bukti_sister_name, file_get_contents($bukti_sister)); + Storage::disk('public')->put($request->nim.'/'.$bukti_lembar_monitoring_name, file_get_contents($bukti_lembar_monitoring)); + Storage::disk('public')->put($request->nim.'/'.$bukti_naskah_dosen_pembimbing_name, file_get_contents($bukti_naskah_dosen_pembimbing)); + Storage::disk('public')->put($request->nim.'/'.$bukti_naskah_dosen_penguji_name, file_get_contents($bukti_naskah_dosen_penguji)); + return redirect()->route('layanan-sidangakhir.tambah')->with('success','Sukses Tambah Data, Silahkan Menunggu Email Konfirmasi setelah disetujui Oleh Operator'); + } + return redirect()->route('layanan-sidangakhir.tambah')->with('error','Gagal Tambah data, Cek kembali data yang anda masukkan'); +} + +public function terima(Request $request){ + $id = $request->id; + $countcaseid = PengajuanSidangAkhir::where('ttd_operator','!=','-')->count(); + $caseid = "LA".date_format(date_create(),"ym").$countcaseid+1; + + $cekData = PengajuanSidangAkhir::where('caseid',$caseid)->first(); + $data = PengajuanSidangAkhir::where('id',$id)->first(); + //cek apakah ada caseid yang sama sebelum disave + if(!is_null($cekData)){ + $data->updated_at = Carbon::now(); + $data->save(); + return redirect()->route('layanan-sidangakhir.index')->with('error','Gagal simpan Data, Cek kembali Detail Data yang akan diterima'); + } + + $data->caseid = $caseid; + $data->ttd_operator = Carbon::now(); + if($data->save()){ + $data_job = [ + [ + 'jenis' => 'mahasiswa', + 'id' => $id, + ], + [ + 'jenis' => 'dpu', + 'id' => $id, + ], + ]; + foreach($data_job as $item){ + dispatch(new layananSidangAkhirJob($item)); + } + return redirect()->route('layanan-sidangakhir.index')->with('success','Data Berhasil Disimpan, Email Akan Dikirimkan ke Mahasiswa, DPU dan DPA'); + } +} + +public function ettd($caseid){ + $data = PengajuanSidangAkhir::where('caseid', $caseid) + ->select( + 'pengajuan_sidang_akhirs.*', + 'mahasiswas.nama', + 'mahasiswas.nim', + 'mahasiswas.judul_skripsi_id', + 'mahasiswas.judul_skripsi_en', + 'dosen_dpu.nama_gelar as dosen_dpu_nama_gelar', + ) + ->join('mahasiswas','pengajuan_sidang_akhirs.mahasiswas_id','=','mahasiswas.id') + ->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id') + ->first(); + //jika data tidak null, maka render ini + if(!is_null($data)){ + $jenis = 'Dosen Pembimbing Utama'; + return view('layanan-sidangakhir.ettd',['title'=> 'INPUT E-Signature','jenis'=>$jenis,'data'=> $data]); + } + //jika URL tidak diantara ketika itu maka render ini + return redirect()->route('laman-awal')->with(['error'=>'Invalid CASEID, Atau CaseID Tidak Ditemukan']); +} + +public function submitettd($caseid, Request $request){ + $data = PengajuanSidangAkhir::where('caseid','=',$caseid)->first(); + //jika data ada, maka diproses + if(!is_null($data)){ + //cek ttd jika ttd sudah pernah diisi maka dikembalikan error + if($data->ttd_dpu!='-'){ + return redirect()->route('layanan-sidangakhir.ettd',['caseid'=>$caseid])->with(['error'=>'CaseID Ini Sudah Pernah Anda Tandatangani Pada '.$data->ttd_dpu]); + } + $ttd = Mahasiswa::where('nim',$request->nim)->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id')->first(); + //jika Belum Pernah maka TTD akan diproses + if($ttd->ettd==$request->ettd){ + $data->ttd_dpu = Carbon::now(); + $data->save(); + $data_job =[ + 'jenis' => 'mahasiswa selesai', + 'id' => $data->id, + ]; + dispatch(new layananSidangAkhirJob($data_job)); + return redirect()->route('monitoring.caseid',['caseid'=>$caseid])->with(['success'=>'Terimakasih Telah Melakukan Tanda Tangan Pada CaseID '.$caseid]); + } + //jika ETTD Tidak sesuai Akan Dikembalikan Ke laman TTD Dengan error + else{ + return redirect()->route('layanan-sidangakhir.ettd',['caseid'=>$caseid])->with(['error'=>'E-TTD Tidak Sesuai, Cek Kembali ETTD Anda']); + } + } +} + +public function cetak($caseid){ + $data = PengajuanSidangAkhir::where('caseid', $caseid) + ->select( + 'pengajuan_sidang_akhirs.*', + 'mahasiswas.nama', + 'bagians.nama_bagian', + 'mahasiswas.nim', + 'mahasiswas.judul_skripsi_id', + 'mahasiswas.judul_skripsi_en', + 'dosen_dpu.nama_gelar as dosen_dpu_nama_gelar', + 'dosen_dpu.nip as dosen_dpu_nip', + ) + ->join('mahasiswas','pengajuan_sidang_akhirs.mahasiswas_id','=','mahasiswas.id') + ->join('bagians','mahasiswas.bagian','=','bagians.id') + ->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id') + ->first(); + //jika data tidak null, maka render ini + if($data->ttd_dpu=='-'){ + return redirect()->route('monitoring.caseid',['caseid'=>$caseid])->with('error','Data Belum Di TandaTangani Oleh Dosen Pembimbing Utama, File Bisa didownload ketika DPU sudah tanda tangan!'); + } + if(is_null($data)){ + return redirect()->route('monitoring.caseid',['caseid'=>$caseid])->with('error','Data Dengan CASEID Tersebut Tidak ada'); + } + + $data = [ + 'title' => 'Cetak Kesediaan', + // 'date' => Carbon::now()->format('d-m-Y'), + 'date' => $data->created_at->format('d-m-Y'), + 'nama_mahasiswa' => $data->nama, + 'nim' => $data->nim, + 'bagian' => $data->nama_bagian, + 'judul_skripsi_id' => $data->judul_skripsi_id, + 'judul_skripsi_en' => $data->judul_skripsi_en, + 'nilai_plagiasi' => $data->nilai_plagiasi, + 'dosen_dpu_nama_gelar' => $data->dosen_dpu_nama_gelar, + 'dosen_dpu_nip' => $data->dosen_dpu_nip, + 'dosen_dpu_qrcode' => base64_encode(QrCode::size(100)->generate($data->dosen_dpu_nama_gelar.'_TTD_'.$data->ttd_dpu)), + ]; + $pdf = Pdf::loadView('layanan-sidangakhir.cetak', $data); + return $pdf->setPaper('a4', 'potrait')->stream($caseid.'-Kesediaan Menjadi Dosen Pembimbing Tugas Akhir'); +} + +public function resend($caseid, Request $request){ + try{ + $data = PengajuanSidangAkhir::where('caseid',$caseid)->first(); + $data_job = [ + 'id' => $data->id, + 'jenis' => $request->jenis, + ]; + dispatch(new layananSidangAkhirJob($data_job)); + }catch(Exception $e){ + $text['error'] = $e->getMessage(); + dispatch(new kirimNotifikasiErrorJob($text)); + + return redirect()->route('layanan-sidangakhir.index')->with('error','Error : '.$text['error']); + } + return redirect()->route('layanan-sidangakhir.index')->with('success','Berhasil Kirim Ulang Email Kepada '.$request->jenis.' Dengan CaseID : '.$caseid); + +} +} diff --git a/app/Http/Controllers/MonitoringController.php b/app/Http/Controllers/MonitoringController.php index 7ae356e..c1e58ab 100644 --- a/app/Http/Controllers/MonitoringController.php +++ b/app/Http/Controllers/MonitoringController.php @@ -4,6 +4,7 @@ use App\Models\PengajuanDpuDpa; use App\Models\PengajuanSempro; +use App\Models\PengajuanSidangAkhir; use Illuminate\Http\Request; class MonitoringController extends Controller @@ -55,6 +56,24 @@ public function caseid($caseid){ } return view('monitoring.sempro',['title' => 'Monitoring Pengajuan Seminar Proposal - '.$caseid,'data' => $data]); } + elseif($cek_caseid=="LA"){ + $data = PengajuanSidangAkhir::where('caseid',$caseid) + ->select( + 'pengajuan_sidang_akhirs.*', + 'mahasiswas.nim', + 'mahasiswas.nama', + 'mahasiswas.judul_skripsi_id', + 'mahasiswas.judul_skripsi_en', + 'dosen_dpu.nama_gelar as dosen_dpu_nama_gelar', + ) + ->join('mahasiswas','mahasiswas_id','=','mahasiswas.id') + ->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id') + ->first(); + if($data==null){ + return redirect()->route('monitoring.index')->with('error','CaseID Tidak Ditemukan'); + } + return view('monitoring.sidangakhir',['title' => 'Monitoring Pengajuan Sidang Akhir - '.$caseid,'data' => $data]); + } else{ return redirect()->route('monitoring.index')->with('error','CaseID Tidak Valid'); } diff --git a/app/Jobs/layananPengajuanDpuDpaJob.php b/app/Jobs/layananPengajuanDpuDpaJob.php index 2cec5fd..eed4106 100644 --- a/app/Jobs/layananPengajuanDpuDpaJob.php +++ b/app/Jobs/layananPengajuanDpuDpaJob.php @@ -4,7 +4,7 @@ use App\Models\PengajuanDpuDpa; - +use Exception; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; @@ -39,24 +39,50 @@ public function handle(): void ->get(); } elseif($this->data['jenis'] == 'dpu'){ - $data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal','mahasiswas.dosen_dpu_id','users.nama_gelar','users.email')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->join('users','users.id','=','dosen_dpu_id')->first(); + $data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id']) + ->select('mahasiswas.nama', + 'mahasiswas.nim', + 'mahasiswas.judul_seminar_proposal', + 'mahasiswas.dosen_dpu_id', + 'users.nama_gelar', + 'users.email') + ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') + ->join('users','users.id','=','mahasiswas.dosen_dpu_id') + ->first(); $text = "BETA\n". "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". "Kepada DPU : ".$data->nama_gelar."\n\n". - "Alamat Email : ".$data->email; + "Alamat Email : ".str_replace('_','\_',$data->email); Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } elseif($this->data['jenis'] == 'dpa'){ - $data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal','mahasiswas.dosen_dpa_id','users.nama_gelar','users.email')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->join('users','users.id','=','dosen_dpa_id')->first(); - $text = "BETA\n". - "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". - "Kepada DPA : ".$data->nama_gelar."\n\n". - "Alamat Email : ".$data->email; - Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') - ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) - ->get(); + try{ + $data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id']) + ->select('mahasiswas.nama', + 'mahasiswas.nim', + 'mahasiswas.judul_seminar_proposal', + 'mahasiswas.dosen_dpa_id', + 'users.nama_gelar', + 'users.email') + ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') + ->join('users','users.id','=','mahasiswas.dosen_dpa_id') + ->first(); + $text = "BETA\n". + "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". + "Kepada DPA : ".$data->nama_gelar."\n\n". + "Alamat Email : ". str_replace('_','\_',$data->email); + Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') + ->withData( array( 'chat_id' => '-1001903808078', 'text' => strval($text), 'parse_mode' => 'Markdown') ) + ->get(); + }catch(Exception $e){ + Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') + ->withData( array( 'chat_id' => '-1001903808078', 'text' => $e, 'parse_mode' => 'Markdown') ) + ->get(); + } + + } elseif($this->data['jenis'] == 'kombi'){ $kombiRole = Role::findByName('Ketua Kombi')->users; @@ -74,7 +100,7 @@ public function handle(): void $text = "BETA\n". "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". "Kepada Mahasiswa : ".$data->nama."\n\n". - "Alamat Email : ".$data->email; + "Alamat Email : ".str_replace('_','\_',$data->email); Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); @@ -84,7 +110,7 @@ public function handle(): void $text = "BETA\n". "Kirim Notifikasi Pengajuan Selesai A/N Mahasiswa: ".$data->nama."\n". "Kepada Mahasiswa : ".$data->nama."\n\n". - "Alamat Email : ".$data->email; + "Alamat Email : ".str_replace('_','\_',$data->email); Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); diff --git a/app/Jobs/layananSeminarProposalJob.php b/app/Jobs/layananSeminarProposalJob.php index 9818999..1cdca67 100644 --- a/app/Jobs/layananSeminarProposalJob.php +++ b/app/Jobs/layananSeminarProposalJob.php @@ -37,7 +37,7 @@ public function handle(): void ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } - elseif($this->data['jenis'] == 'dpu'){ + elseif($this->data['jenis'] == 'mahasiswa'){ $data = PengajuanSempro::where('pengajuan_sempros.id',$this->data['id']) ->select( 'pengajuan_sempros.caseid', @@ -52,7 +52,7 @@ public function handle(): void $text = "BETA - ".$data->caseid."\n". "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". "Kepada mahasiswa : ".$data->nama."\n\n". - "Alamat Email : ".$data->email; + "Alamat Email : ".str_replace('_','\_',$data->email); Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); @@ -74,12 +74,12 @@ public function handle(): void $text = "BETA - ".$data->caseid."\n". "Pengajuan Selesai A/N Mahasiswa: ".$data->nama."\n". "Kepada DPU : ".$data->nama_gelar."\n\n". - "Alamat Email : ".$data->email; + "Alamat Email : ".str_replace('_','\_',$data->email); Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); } - elseif($this->data['jenis'] == 'mahasiswa'){ + elseif($this->data['jenis'] == 'dpu'){ $data = PengajuanSempro::where('pengajuan_sempros.id',$this->data['id']) ->select( 'pengajuan_sempros.caseid', @@ -96,7 +96,7 @@ public function handle(): void $text = "BETA - ".$data->caseid."\n". "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". "Kepada DPU : ".$data->nama_gelar."\n\n". - "Alamat Email : ".$data->email; + "Alamat Email : ".str_replace('_','\_',$data->email); Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) ->get(); diff --git a/app/Jobs/layananSidangAkhirJob.php b/app/Jobs/layananSidangAkhirJob.php new file mode 100644 index 0000000..fd35164 --- /dev/null +++ b/app/Jobs/layananSidangAkhirJob.php @@ -0,0 +1,105 @@ +data = $data; + } + + /** + * Execute the job. + */ + public function handle(): void + { + if($this->data['jenis']==="penolakan"){ + $text = "BETA\n". + "Penolakan Pengajuan Sidang Akhir Mahasiswa: ".$this->data['nama']."\n". + "Dengan Email : ".$this->data['email']."\n\n". + "Alasan : ".$this->data['alasan']; + Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') + ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) + ->get(); + } + elseif($this->data['jenis'] == 'mahasiswa'){ + $data = PengajuanSidangAkhir::where('pengajuan_sidang_akhirs.id',$this->data['id']) + ->select( + 'pengajuan_sidang_akhirs.caseid', + 'pengajuan_sidang_akhirs.nilai_plagiasi', + 'mahasiswas.nama', + 'mahasiswas.nim', + 'mahasiswas.email', + 'mahasiswas.judul_skripsi_id', + 'mahasiswas.judul_skripsi_en', + 'mahasiswas.dosen_dpu_id',) + ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') + ->first(); + $text = "BETA - ".$data->caseid."\n". + "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". + "Kepada mahasiswa : ".$data->nama."\n\n". + "Alamat Email : ".str_replace('_','\_',$data->email); + Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') + ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) + ->get(); + } + elseif($this->data['jenis'] == 'mahasiswa selesai'){ + $data = PengajuanSidangAkhir::where('pengajuan_sidang_akhirs.id',$this->data['id']) + ->select( + 'pengajuan_sidang_akhirs.caseid', + 'pengajuan_sidang_akhirs.nilai_plagiasi', + 'mahasiswas.nama', + 'mahasiswas.nim', + 'mahasiswas.judul_seminar_proposal', + 'mahasiswas.dosen_dpu_id', + 'users.nama_gelar', + 'users.email') + ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') + ->join('users','users.id','=','dosen_dpu_id') + ->first(); + $text = "BETA - ".$data->caseid."\n". + "Pengajuan Selesai A/N Mahasiswa: ".$data->nama."\n". + "Kepada DPU : ".$data->nama_gelar."\n\n". + "Alamat Email : ".str_replace('_','\_',$data->email); + Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') + ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) + ->get(); + } + elseif($this->data['jenis'] == 'dpu'){ + $data = PengajuanSidangAkhir::where('pengajuan_sidang_akhirs.id',$this->data['id']) + ->select( + 'pengajuan_sidang_akhirs.caseid', + 'pengajuan_sidang_akhirs.nilai_plagiasi', + 'mahasiswas.nama', + 'mahasiswas.nim', + 'mahasiswas.judul_seminar_proposal', + 'mahasiswas.dosen_dpu_id', + 'users.nama_gelar', + 'users.email') + ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id') + ->join('users','users.id','=','dosen_dpu_id') + ->first(); + $text = "BETA - ".$data->caseid."\n". + "Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n". + "Kepada DPU : ".$data->nama_gelar."\n\n". + "Alamat Email : ".str_replace('_','\_',$data->email); + Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage') + ->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') ) + ->get(); + } + } +} diff --git a/app/Models/PengajuanSidangAkhir.php b/app/Models/PengajuanSidangAkhir.php new file mode 100644 index 0000000..23f33f7 --- /dev/null +++ b/app/Models/PengajuanSidangAkhir.php @@ -0,0 +1,22 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('jobs'); + } +}; diff --git a/database/migrations/2024_03_19_103810_create_pengajuan_sidang_akhirs_table.php b/database/migrations/2024_03_19_103810_create_pengajuan_sidang_akhirs_table.php new file mode 100644 index 0000000..8a7daf7 --- /dev/null +++ b/database/migrations/2024_03_19_103810_create_pengajuan_sidang_akhirs_table.php @@ -0,0 +1,38 @@ +id(); + $table->string('caseid')->default('-'); + $table->foreignId('mahasiswas_id')->constrained(); + $table->string('ttd_operator')->default('-'); + $table->string('ttd_dpu')->default('-'); + $table->integer('nilai_plagiasi'); + $table->string('bukti_lembar_monitoring'); + $table->string('bukti_transkrip'); + $table->string('bukti_turnitin'); + $table->string('bukti_sister'); + $table->string('bukti_naskah_dosen_pembimbing'); + $table->string('bukti_naskah_dosen_penguji'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('pengajuan_sidang_akhirs'); + } +}; diff --git a/resources/views/layanan-dpudpa/index.blade.php b/resources/views/layanan-dpudpa/index.blade.php index 79bdabe..c0ac9f3 100644 --- a/resources/views/layanan-dpudpa/index.blade.php +++ b/resources/views/layanan-dpudpa/index.blade.php @@ -99,30 +99,60 @@ + + + + + + + + + + + diff --git a/resources/views/layanan-sidangakhir/index.blade.php b/resources/views/layanan-sidangakhir/index.blade.php new file mode 100644 index 0000000..9ee0d02 --- /dev/null +++ b/resources/views/layanan-sidangakhir/index.blade.php @@ -0,0 +1,274 @@ + +@extends('layout.app') + +@push('css') + + + + +@endpush + +@section('content') + +@include('layout.navbars.sidebar') +
+ +
+
+
+
+

Pengajuan Sidang Akhir

+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
Perhatian!
+ CaseID Akan muncul ketika pengajuan telah diterima untuk menghindari data duplikat untuk mahasiswa yang sama. +
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error ) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + @if(session('success')) +
+
    +
  • {{ session('success') }}
  • +
+
+ @endif + @if(session('error')) +
+
    +
  • {{ session('error') }}
  • +
+
+ @endif + + + + + + + + + + + + @foreach ($data as $datas) + + + + + + + + + + + + @endforeach + + + + + + + + + + +
CaseIDNIMNamaDPUAction
{{ $datas->caseid }}{{ $datas->nim }} {{ $datas->nama }} {{ $datas->dpu_nama_gelar }} + | + @if($datas->ttd_operator=="-") + | + + @endif +
CaseIDNIMDPUDPAAction
+
+ +
+ +
+ +
+@endsection + + +@push('js') + + + + + + + + + + + + + + + +@endpush + diff --git a/resources/views/layanan-sidangakhir/tambah.blade.php b/resources/views/layanan-sidangakhir/tambah.blade.php new file mode 100644 index 0000000..5995780 --- /dev/null +++ b/resources/views/layanan-sidangakhir/tambah.blade.php @@ -0,0 +1,219 @@ + +@extends('layout.app_guest',['title' => 'Pengajuan Sidang Akhir']) +@section('content') + + +
+
+ +
+
+

Pengajuan Sidang Akhir

+
+ +
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error ) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + @if(session('success')) +
+
    +
  • {{ session('success') }}
  • +
+
+ @endif + @if(session('error')) +
+
    +
  • {{ session('error') }}
  • +
+
+ @endif +
+ +
Perhatian!
+ Pernah Menggunakan Layanan PINTU Untuk Pengajuan ? Coba Gunakan Fitur Cari. Klik Disini +
+
+ @csrf + @if(isset($data_mahasiswa)) + + +
+
+ + + + + + + + + + +
+ +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+ +
+ + @else + +
+
+ + + + + + + + + + +
+ +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+ +
+ + @endif + +
+
+
+ + +
+ +
+
+
+ + +
+ +
+ +
+ + +
+
+ + + + +
+
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+ +
+ +
+ + +@endsection diff --git a/resources/views/layout/app_guest.blade.php b/resources/views/layout/app_guest.blade.php index 9322d4a..5d79eda 100644 --- a/resources/views/layout/app_guest.blade.php +++ b/resources/views/layout/app_guest.blade.php @@ -70,6 +70,14 @@

+ + @role('Super Administrator')