Esempio n. 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $nisn)
 {
     $this->validate($request, ['name' => 'required', 'NISN' => 'required', 'noInduk' => 'required', 'email' => 'required|email', 'noTelp' => 'required', 'alamat' => 'required', 'tahunAjaran' => 'required', 'kelas' => 'required']);
     Siswa::where('NISN', $nisn)->update(['nama' => $request->name, 'NISN' => $request->NISN, 'noInduk' => $request->noInduk, 'email' => $request->email, 'noTelp' => $request->noTelp, 'alamat' => $request->alamat]);
     KelasSiswa::where('NISN', $nisn)->update(['NISN' => $request->NISN, 'tahunAjaran' => $request->tahunAjaran, 'kelas' => $request->kelas]);
     return redirect(route('getDaftarSiswa'));
     //return response(['req' => $request->all(), 'nisn' => $nisn]);
 }
Esempio n. 2
0
 public function getKelasByTingkat($nisn, $tingkat)
 {
     $data = Kelas::where('tingkat', $tingkat)->select('kelas')->get();
     $kelasSiswa = KelasSiswa::where('NISN', $nisn)->select('kelas')->firstOrFail();
     return view('admin/parsed/getTingkat')->with(['data' => $data, 'kelasSiswa' => $kelasSiswa]);
 }
Esempio n. 3
0
 public function getFilterSiswaByKelas($kelas)
 {
     $data = KelasSiswa::join('tblsiswa', 'tblkelassiswa.nisn', '=', 'tblsiswa.nisn')->where('kelas', $kelas)->get();
     return view('admin/parsed/filteredsiswabykelas')->with('data', $data);
 }