From 62948a0b2fe51e322347a6425f29e6c452d6e3d7 Mon Sep 17 00:00:00 2001 From: fikyb Date: Tue, 21 May 2024 09:47:32 +0700 Subject: [PATCH] production: pemutihan fix --- app/Http/Controllers/MonitoringController.php | 10 ++ .../layananPemutihanController.php | 83 +++++++++- app/Models/PengajuanPemutihan.php | 1 + ..._pemutihans_add_column_status_operator.php | 30 ++++ resources/views/index.blade.php | 10 ++ .../views/layanan-pemutihan/cetak.blade.php | 146 +++++++++++++++++ .../views/layanan-pemutihan/index.blade.php | 149 ++++++------------ .../views/layanan-pemutihan/tambah.blade.php | 2 +- resources/views/layout/app_guest.blade.php | 8 + .../views/monitoring/pemutihan.blade.php | 120 ++++++++++++++ routes/web.php | 3 +- 11 files changed, 460 insertions(+), 102 deletions(-) create mode 100644 database/migrations/2024_05_14_132120_alter_table_pengajuan_pemutihans_add_column_status_operator.php create mode 100644 resources/views/layanan-pemutihan/cetak.blade.php create mode 100644 resources/views/monitoring/pemutihan.blade.php diff --git a/app/Http/Controllers/MonitoringController.php b/app/Http/Controllers/MonitoringController.php index 12ee9bc..ad5b447 100644 --- a/app/Http/Controllers/MonitoringController.php +++ b/app/Http/Controllers/MonitoringController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Models\PengajuanDpuDpa; +use App\Models\PengajuanPemutihan; use App\Models\PengajuanRevisiPublikasi; use App\Models\PengajuanSempro; use App\Models\PengajuanSidangAkhir; @@ -27,6 +28,15 @@ public function ruangbaca(){ ->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->get(); return view('monitoring.ruangbaca',['title' => 'Monitoring Pengajuan Wisuda Untuk Ruang Baca','data'=>$data]); } +public function pemutihan(){ + $data = PengajuanPemutihan:: + select( + 'pengajuan_pemutihans.*', + 'users.nama_gelar as dosen_pengampu', + ) + ->join('users','users.id','=','dosen_id')->get(); + return view('monitoring.pemutihan',['title' => 'Monitoring Pemutihan','data'=>$data]); +} public function search(Request $request){ return redirect()->route('monitoring.caseid',['caseid'=>$request->caseid]); diff --git a/app/Http/Controllers/layananPemutihanController.php b/app/Http/Controllers/layananPemutihanController.php index c78e738..ff912c6 100644 --- a/app/Http/Controllers/layananPemutihanController.php +++ b/app/Http/Controllers/layananPemutihanController.php @@ -4,13 +4,22 @@ use App\Models\PengajuanPemutihan; use App\Models\User; +use Barryvdh\DomPDF\Facade\Pdf; +use Carbon\Carbon; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Storage; +use SimpleSoftwareIO\QrCode\Facades\QrCode; class LayananPemutihanController extends Controller { public function index(){ - $data = PengajuanPemutihan::get(); + $data = PengajuanPemutihan:: + select( + 'pengajuan_pemutihans.*', + 'users.nama_gelar as dosen_pengampu', + ) + ->join('users','dosen_id','=','users.id')->get(); return view('layanan-pemutihan.index',['title' => 'Pengajuan Pemutihan | Admin Dashboard','data' => $data]); } @@ -38,8 +47,78 @@ public function store(Request $request){ 'bukti_pemutihan.mimes' => 'Format File tidak berupa file JPG / PDF, cek kembali file anda', 'bukti_pemutihan.max' => 'Ukuran File Anda lebih dari 4Mb, Cek Ulang File anda', ]); + //get lastid + 1 + $countcaseid = PengajuanPemutihan::latest()->first()->id; + $caseid = "P".date_format(date_create(),"Y").$countcaseid+1; - + $data_pemutihan['caseid'] = $caseid; + $data_pemutihan['mata_kuliah'] = $request->mata_kuliah; + $data_pemutihan['dosen_id'] = $request->dosen_pengampu; + $data_pemutihan['program_studi'] = $request->program_studi; + $data_pemutihan['ruang_kelas'] = $request->ruang_kelas; + $data_pemutihan['tanggal_kelas'] = $request->tanggal_kelas; + $data_pemutihan['jam_kelas'] = $request->jam_kelas; + $data_pemutihan['jurnal_kuliah'] = $request->jurnal_kuliah; + $data_pemutihan['alasan'] = $request->alasan; + $data_pemutihan['keterangan'] = $request->keterangan; + + $bukti_pemutihan = $request->file('bukti_pemutihan'); + $bukti_pemutihan_name = 'P_'.str_replace(' ', '_',$bukti_pemutihan->getClientOriginalName()); + $path = $request->tanggal_kelas.'/'.$request->tanggal_kelas.'/'.$bukti_pemutihan_name; + //jika berhasil save file dan save data mhs maka pengajuan akan diisi + if(Storage::disk('public')->put($path, file_get_contents($bukti_pemutihan))){ + $data_pemutihan['bukti_izin_dosen'] = $bukti_pemutihan_name; + PengajuanPemutihan::create($data_pemutihan); + return redirect()->route('layanan-pemutihan.tambah')->with('success','Sukses Tambah Data, Silahkan Monitoring Pengajuan Anda melalui menu monitoring'); + } + return redirect()->route('layanan-pemutihan.tambah')->with('error','Gagal Tambah data, Cek kembali data yang anda masukkan'); + +} + +public function cetak($caseid){ + $data = PengajuanPemutihan:: + select( + 'pengajuan_pemutihans.*', + 'users.nama_gelar as dosen_pengampu', + 'users.nip as dosen_pengampu_nip', + ) + ->join('users','dosen_id','=','users.id') + ->where('caseid',$caseid) + ->first(); + + //jika data kosong maka render ini + if(is_null($data)){ + return redirect()->route('monitoring.caseid',['caseid'=>$caseid])->with('error','Data Dengan CASEID Tersebut Tidak ada'); + } + $tanggal_kelas = strtotime($data->tanggal_kelas); + $data_pdf = [ + 'title' => 'Form Berita Acara Perkuliahan dalam Kondisi Gangguan Sistem', + // 'date' => Carbon::now()->format('d-m-Y'), + 'date' => $data->created_at->format('d-m-Y'), + 'mata_kuliah' => $data->mata_kuliah, + 'program_studi' => $data->program_studi, + 'ruang_kelas' => $data->ruang_kelas, + 'tanggal_kelas' => date('d-m-Y',$tanggal_kelas), + 'jam_kelas' => $data->jam_kelas, + 'jurnal_kuliah' => $data->jurnal_kuliah, + 'alasan' => $data->alasan, + 'keterangan' => $data->keterangan, + 'dosen_pengampu' => $data->dosen_pengampu, + 'dosen_pengampu_nip' => $data->dosen_pengampu_nip, + 'dosen_pengampu_qrcode' => base64_encode(QrCode::size(100)->generate($data->dosen_pengampu.'_TTD_'.$data->created_at)), + ]; + $pdf = Pdf::loadView('layanan-pemutihan.cetak', $data_pdf); + return $pdf->setPaper('a4', 'potrait')->stream($caseid.'-Form Berita Acara Perkuliahan dalam Kondisi Gangguan Sistem.pdf'); +} + +public function selesai($caseid, Request $request){ + $data = PengajuanPemutihan::where('caseid', $caseid)->first(); + if($data==null){ + return redirect()->route('layanan-pemutihan.index')->with('error','Gagal Memproses, Data tidak ditemukan'); + } + $data->status_operator = Carbon::now(); + $data->save(); + return redirect()->route('layanan-pemutihan.index')->with('success','Data Berhasil Disimpan, status akan diupdate menjadi selesai'); dd($request->all()); } } diff --git a/app/Models/PengajuanPemutihan.php b/app/Models/PengajuanPemutihan.php index adf7006..97cb49c 100644 --- a/app/Models/PengajuanPemutihan.php +++ b/app/Models/PengajuanPemutihan.php @@ -10,6 +10,7 @@ class PengajuanPemutihan extends Model use HasFactory; protected $fillable = [ + 'caseid', 'dosen_id', 'program_studi', 'mata_kuliah', diff --git a/database/migrations/2024_05_14_132120_alter_table_pengajuan_pemutihans_add_column_status_operator.php b/database/migrations/2024_05_14_132120_alter_table_pengajuan_pemutihans_add_column_status_operator.php new file mode 100644 index 0000000..759be7c --- /dev/null +++ b/database/migrations/2024_05_14_132120_alter_table_pengajuan_pemutihans_add_column_status_operator.php @@ -0,0 +1,30 @@ +foreignId('user_roles_id')->constrained(); + $table->timestamp('status_operator')->nullable()->after('dosen_id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('pengajuan_pemutihans', function (Blueprint $table) { + // $table->drop('user_roles_id'); + $table->drop('status_operator'); + }); + } +}; diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index b1cfbed..01e0870 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -140,6 +140,16 @@

Pengajuan Syarat Mengikuti Wisuda

+
+ + + + + +

Pengajuan Pemutihan Kelas

+

Pengajuan Pemutihan Kelas

+
+
diff --git a/resources/views/layanan-pemutihan/cetak.blade.php b/resources/views/layanan-pemutihan/cetak.blade.php new file mode 100644 index 0000000..cf6cebf --- /dev/null +++ b/resources/views/layanan-pemutihan/cetak.blade.php @@ -0,0 +1,146 @@ + + + + + {{ $title }} + + + + + + + + + + + + + + +
LOGOUNEJNama Dokumen :Form Berita Acara Perkuliahan dalam Kondisi Gangguan Sistem
Tujuan :Sebagai dasar/acuan bagi Operator Akademik Prodi untuk meng-entry presensi mahasiswa dan jurnal perkuliahan ke SISTER secara MANUAL
+

Dengan ini diberitahukan bahwa

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Mata Kuliah / Program Studi : {{ $mata_kuliah }} / {{$program_studi}}
Dosen Pengampu : {{ $dosen_pengampu }}
Ruang Kelas : {{ $ruang_kelas }}
Tanggal Kelas : {{ $tanggal_kelas }}
Jam kelas : {{ $jam_kelas }}
Jurnal Kuliah : {{ $jurnal_kuliah }}
+

Telah dilaksanakan sesuai jadwal tanpa menggunakan presensi QR Code dan/atau e-learning karena : +
{{ $alasan }} +

+

Keterangan :
+ {!! nl2br($keterangan) !!} +

+

Oleh karena itu supaya entry presensi mahasiswa dan jurnal kuliah ke SISTER dilakukan secara MANUAL oleh Operator Akademik Prodi.

+ + + + + + + + + + + + + + + + + + + + +
Jember, {{ $date }}
Dosen Pengampu,
+ + + +
{{ $dosen_pengampu }}
NIP. {{ $dosen_pengampu_nip }} +
+ + \ No newline at end of file diff --git a/resources/views/layanan-pemutihan/index.blade.php b/resources/views/layanan-pemutihan/index.blade.php index baf872d..a35982c 100644 --- a/resources/views/layanan-pemutihan/index.blade.php +++ b/resources/views/layanan-pemutihan/index.blade.php @@ -17,12 +17,12 @@
-

Pengajuan Seminar Proposal

+

Pengajuan Pemutihan

@@ -65,9 +65,11 @@ CaseID - NIM - Nama - DPU + Program Studi + Mata Kuliah + Dosen Pengampu + Ruang Kuliah + Tanggal Action @@ -75,15 +77,16 @@ @foreach ($data as $datas) {{ $datas->caseid }} - {{ $datas->nim }} - {{ $datas->nama }} - {{ $datas->dpu_nama_gelar }} + {{ $datas->program_studi }} + {{ $datas->mata_kuliah }} + {{ $datas->dosen_pengampu }} + {{ $datas->ruang_kelas }} + {{ $datas->tanggal_kelas }} - | - @if($datas->ttd_operator=="-") - | - - @endif +
@csrf + Details + @if($datas->status_operator == null) | @endif +
@@ -99,64 +102,49 @@
- - + @endforeach CaseID - NIM - DPU - DPA + Program Studi + Mata Kuliah + Dosen Pengampu + Ruang Kuliah + Tanggal Action diff --git a/resources/views/layanan-pemutihan/tambah.blade.php b/resources/views/layanan-pemutihan/tambah.blade.php index 562bbd2..df0bf56 100644 --- a/resources/views/layanan-pemutihan/tambah.blade.php +++ b/resources/views/layanan-pemutihan/tambah.blade.php @@ -76,7 +76,7 @@ - diff --git a/resources/views/layout/app_guest.blade.php b/resources/views/layout/app_guest.blade.php index 39b9ffb..5146cdd 100644 --- a/resources/views/layout/app_guest.blade.php +++ b/resources/views/layout/app_guest.blade.php @@ -115,6 +115,14 @@

+ diff --git a/resources/views/monitoring/pemutihan.blade.php b/resources/views/monitoring/pemutihan.blade.php new file mode 100644 index 0000000..d9a51ad --- /dev/null +++ b/resources/views/monitoring/pemutihan.blade.php @@ -0,0 +1,120 @@ + +@extends('layout.app_guest',['title' => $title]) +@push('css') + + + +@endpush +@section('content') + + +
+
+ +
+
+

{{$title}}

+
+ +
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error ) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + @if(session('success')) +
+
    +
  • {{ session('success') }}
  • +
+
+ @endif + @if(session('error')) +
+
    +
  • {{ session('error') }}
  • +
+
+ @endif +
+ +
Perhatian!
+ Data yang tampil disini adalah data Real time. Jika Belum melakukan pengisian maka data tidak akan muncul +
+ + + + + + + + + + + + + + @foreach($data as $item) + + + + + + + + + + @endforeach + + + + + + + + + + + + +
CaseIDProgram StudiMata KuliahDosen PengampuRuang KuliahTanggalStatus
{{$item->caseid}}{{$item->program_studi}}{{$item->mata_kuliah}}{{$item->dosen_pengampu}}{{$item->ruang_kelas}}{{$item->tanggal_kelas}}{{$item->status_operator}}
CaseIDProgram StudiMata KuliahDosen PengampuRuang KuliahTanggalStatus
+
+
+ +
+ +
+ + +@endsection +@push('js') + + + + + + + + + + + + + + + +@endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 133ebb4..96d57d1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -49,7 +49,7 @@ Route::get('/layanan-pemutihan', [LayananPemutihanController::class, 'index'])->name('layanan-pemutihan.index'); Route::DELETE('/layanan-pemutihan', [LayananPemutihanController::class, 'destroy'])->name('layanan-pemutihan.destroy'); Route::POST('/layanan-pemutihan', [LayananPemutihanController::class, 'terima'])->name('layanan-pemutihan.terima'); - Route::POST('/layanan-pemutihan/resend/{caseid}', [LayananPemutihanController::class, 'resend'])->name('layanan-pemutihan.resend'); + Route::POST('/layanan-pemutihan/selesai/{caseid}', [LayananPemutihanController::class, 'selesai'])->name('layanan-pemutihan.selesai'); //layanan Pengajuan DPU DPA Route::get('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'index'])->name('layanan-dpudpa.index'); Route::DELETE('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'destroy'])->name('layanan-dpudpa.destroy'); @@ -144,4 +144,5 @@ Route::get('/monitoring', [MonitoringController::class, 'index'])->name('monitoring.index'); Route::post('/monitoring', [MonitoringController::class, 'search'])->name('monitoring.search'); Route::get('/monitoring/ruangbaca', [MonitoringController::class, 'ruangbaca'])->name('monitoring.ruangbaca'); +Route::get('/monitoring/pemutihan', [MonitoringController::class, 'pemutihan'])->name('monitoring.pemutihan'); Route::get('/monitoring/{caseid}', [MonitoringController::class, 'caseid'])->name('monitoring.caseid'); \ No newline at end of file