diff --git a/Modules/PPDB/Http/Controllers/DataMuridController.php b/Modules/PPDB/Http/Controllers/DataMuridController.php index e9a8662..0d1ee55 100644 --- a/Modules/PPDB/Http/Controllers/DataMuridController.php +++ b/Modules/PPDB/Http/Controllers/DataMuridController.php @@ -9,9 +9,8 @@ use Illuminate\Http\Request; use Validator; use Illuminate\Routing\Controller; -use DB; -use Session; - +use Illuminate\Support\Facades\Session; +use Illuminate\Support\Facades\DB; class DataMuridController extends Controller { /** @@ -51,7 +50,10 @@ public function store(Request $request) public function show($id) { $murid = User::with('muridDetail','dataOrtu','berkas')->where('role','Guest')->find($id); - // return $murid; + if (!$murid->muridDetail->agama || !$murid->dataOrtu->nama_ayah || !$murid->berkas->kartu_keluarga) { + Session::flash('error','Calon Siswa Belum Input Biodata Diri !'); + return redirect('/ppdb/data-murid'); + } return view('ppdb::backend.dataMurid.show',compact('murid')); } diff --git a/Modules/PPDB/Http/Controllers/PendaftaranController.php b/Modules/PPDB/Http/Controllers/PendaftaranController.php index f3a9904..76c11cd 100644 --- a/Modules/PPDB/Http/Controllers/PendaftaranController.php +++ b/Modules/PPDB/Http/Controllers/PendaftaranController.php @@ -9,10 +9,10 @@ use Modules\PPDB\Http\Requests\{berkasMuridRequest, DataMuridRequest,DataOrtuRequest}; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Auth; -use DB; +use Illuminate\Support\Facades\DB; use Modules\PPDB\Entities\BerkasMurid; use Modules\PPDB\Entities\DataOrangTua; -use Session; +use Illuminate\Support\Facades\Session; class PendaftaranController extends Controller { @@ -113,7 +113,7 @@ public function updateOrtu(DataOrtuRequest $request, $id) DB::commit(); Session::flash('success','Success, Data Berhasil dikirim !'); - return redirect('/home'); + return redirect('/ppdb/form-berkas'); } catch (ErrorException $e) { DB::rollback(); throw new ErrorException($e->getMessage()); @@ -173,12 +173,18 @@ public function berkasStore(berkasMuridRequest $request,$id) $tujuan_upload = 'public/images/berkas_murid'; $imagerapor->storeAs($tujuan_upload,$rapor); - if ($request->foto) { - $imagefoto = $request->file('foto'); - $foto = time()."_".$imagefoto->getClientOriginalName(); + $imagefoto = $request->file('foto'); + $foto = time()."_".$imagefoto->getClientOriginalName(); + // isi dengan nama folder tempat kemana file diupload + $tujuan_upload = 'public/images/berkas_murid'; + $imagefoto->storeAs($tujuan_upload,$foto); + + if ($request->ijazah) { + $imageijazah = $request->file('ijazah'); + $ijazah = time()."_".$imageijazah->getClientOriginalName(); // isi dengan nama folder tempat kemana file diupload $tujuan_upload = 'public/images/berkas_murid'; - $imagefoto->storeAs($tujuan_upload,$foto); + $imageijazah->storeAs($tujuan_upload,$ijazah); } $berkas = BerkasMurid::find($id); @@ -188,7 +194,8 @@ public function berkasStore(berkasMuridRequest $request,$id) $berkas->surat_sehat = $suratsehat; $berkas->surat_tidak_buta_warna = $surattidakbutawarna; $berkas->rapor = $rapor; - $berkas->foto = $foto ?? NULL; + $berkas->foto = $foto; + $berkas->ijazah = $ijazah ?? null; $berkas->save(); DB::commit(); diff --git a/Modules/PPDB/Http/Requests/BerkasMuridRequest.php b/Modules/PPDB/Http/Requests/BerkasMuridRequest.php index 390720e..a8fc0eb 100644 --- a/Modules/PPDB/Http/Requests/BerkasMuridRequest.php +++ b/Modules/PPDB/Http/Requests/BerkasMuridRequest.php @@ -49,8 +49,8 @@ public function messages() 'foto.required' => 'Foto tidak boleh kosong.', 'foto.mimes' => 'Foto hanya mendukung .jpg .jpeg .png atau pdf.', 'foto.max' => 'Ukuran file tidak boleh lebih dari 2MB.', - - + 'ijazah.mimes' => 'File Ijazah hanya mendukung .jpg .jpeg .png atau pdf.', + 'ijazah.max' => 'Ukuran file tidak boleh lebih dari 2MB.', ]; } diff --git a/Modules/PPDB/Resources/views/backend/dataMurid/show.blade.php b/Modules/PPDB/Resources/views/backend/dataMurid/show.blade.php index b78efec..f6b4571 100644 --- a/Modules/PPDB/Resources/views/backend/dataMurid/show.blade.php +++ b/Modules/PPDB/Resources/views/backend/dataMurid/show.blade.php @@ -23,6 +23,11 @@
+
@@ -350,7 +355,7 @@
- + Batal
diff --git a/Modules/PPDB/Resources/views/backend/pendaftaran/dataOrtu.blade.php b/Modules/PPDB/Resources/views/backend/pendaftaran/dataOrtu.blade.php index 0f7bcfb..d21fbe2 100644 --- a/Modules/PPDB/Resources/views/backend/pendaftaran/dataOrtu.blade.php +++ b/Modules/PPDB/Resources/views/backend/pendaftaran/dataOrtu.blade.php @@ -30,7 +30,7 @@
- + @error('nama_ayah')
{{ $message }} @@ -41,7 +41,7 @@
- + @error('telp_ayah')
{{ $message }} @@ -57,7 +57,7 @@ - + @@ -104,7 +104,7 @@
- + @error('nama_ibu')
{{ $message }} @@ -115,7 +115,7 @@
- + @error('telp_ibu')
{{ $message }} @@ -131,7 +131,7 @@ - +