/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $mengajar = Mengajar::find($id); $guru = Guru::all(); $mapel = Mapel::all(); $setting = Setting::first(); return View::make('mengajar.edit')->with('mengajar', $mengajar)->with('guru', $guru)->with('mapel', $mapel)->with('setting', $setting); }
public function n_ujian() { $kelas = Kelas::all(); $tahun = DB::table('rombel')->groupBy('thn_ajaran')->get(); $mapel = Mapel::all(); return View::make('laporan.ujian')->with('kelas', $kelas)->with('tahun', $tahun)->with('mapel', $mapel); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $kkm = Kkm::find($id); $mapel = Mapel::all(); return View::make('kkm.edit')->with('kkm', $kkm)->with('mapel', $mapel); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $mengajar = DB::table('mengajar')->where('kd_mapel', '=', $id)->count(); if ($mengajar > 0) { $html = "<hr><div class='alert alert-danger'>Data Mapel tidak dapat dihapus\n\t\t\tkarena masih ada relasi dengan data mengajar : <ul>"; $data = DB::table('mengajar')->where('kd_mapel', '=', $id)->get(); foreach ($data as $row) { $html .= "<li>" . $row->id_mengajar . "</li>"; } $html .= "</ul></div>"; Session::flas('pesan', $html); return Redirect::back(); } else { Mapel::find($id)->delete(); return Redirect::to('admin/mapel')->with('pesan', "<hr><div class='alert alert-info'>\n\t\t\t\t\tData Berhasil dihapus</div>"); } }
public function view() { if (Request::ajax()) { $rombel = Rombel::find(Input::get('rombel')); $jadwal = DB::table('jadwal')->where('kd_rombel', '=', $rombel->kd_rombel)->get(); $mapel = Mapel::all(); return View::make('hal_siswa.view_jadwal')->with('rombel', $rombel)->with('mapel', $mapel); } }