/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($kelas_id, $id = null)
 {
     //
     $kelas = Kelas::find($kelas_id);
     $data['kelas_id'] = $kelas_id;
     $data['kelas_nama'] = $kelas;
     $data['title'] = 'Data Siswa Kelas ' . $kelas->nama_kelas;
     return view('backend.siswa.index', $data);
 }
示例#2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Kelas::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'nama', $this->nama]);
     return $dataProvider;
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $siswa = Siswa::find($id);
     $kelas = Kelas::all();
     return View('admin.siswa.edit')->with('siswa', $siswa)->with('kelas', $kelas);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $kelas = Kelas::find($id);
     //cek siswa dengan kelas ini
     $siswa = Siswa::where('kd_kelas', $id)->count();
     if ($siswa > 0) {
         Session::flash('pesan', "Data tidak dapat dihapus karena ada siswa yang masih menggunakan kelas ini");
         return Redirect::back();
     }
     //cek detail_jadwal
     $detail = DB::table('detail_jadwal')->where('kd_kelas', $id)->count();
     if ($detail > 0) {
         Session::flash('pesan', "Data tidak dapat dihapus karena ada data jadwal yang masih menggunakan kelas ini");
         return Redirect::back();
     }
     $kelas->delete();
     Session::flash('pesan', "Data Berhasil dihapus");
     return Redirect::to('admin/kelas');
 }
示例#5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getKelas()
 {
     return $this->hasOne(Kelas::className(), ['id' => 'kelas_id']);
 }
 public function kartu_peserta()
 {
     $kelas = Kelas::all();
     return View('admin.laporan.kartu_peserta')->with('kelas', $kelas);
 }
示例#7
0
 public function getDelete($id)
 {
     $data = ['status' => Kelas::remove($id)];
     return response()->json($data);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdKelas()
 {
     return $this->hasOne(Kelas::className(), ['id_kelas' => 'id_kelas']);
 }
 public function detail_jadwal($id)
 {
     $djadwal = Djadwal::find($id);
     $kelas = Kelas::all();
     $ruang = Ruang::all();
     $pengawas = Pengawas::all();
     return View('admin.jadwal.detail_jadwal')->with('jadwal', $djadwal)->with('kelas', $kelas)->with('ruang', $ruang)->with('pengawas', $pengawas);
 }
 public function setting()
 {
     $ruang = Ruang::all();
     $kelas = Kelas::all();
     return View('admin.peserta.setting')->with('ruang', $ruang)->with('kelas', $kelas);
 }
示例#11
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $kelas = Kelas::find($id);
     if ($kelas->delete()) {
         return response()->json(array('success' => TRUE));
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $jurusan = Jurusan::find($id);
     $kelas = Kelas::where('kode_jurusan', $id)->count();
     if ($kelas > 0) {
         $html = "Data Tidak dapat dihapus";
     } else {
         $html = "Data berhasil dihapus";
         $jurusan->delete();
     }
     Session::flash('pesan', $html);
     return Redirect::to('admin/jurusan');
 }
 /**
  * Finds the Kelas model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Kelas the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Kelas::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#14
0
 public function getHapusPartisipan($kelas, $id)
 {
     $k = Kelas::find($kelas);
     $k->siswa()->detach($id);
 }
 public function destroy($idkelas)
 {
     $kls = Kelas::find($idkelas);
     $kls->delete();
     return Redirect::to('administrator/kelas')->with('msgs', 'Kelas berhasil dihapus!');
 }
示例#16
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $kelas = Kelas::find($id);
     $kelas->delete();
     Session::flash('pesan', "Data Berhasil dihapus");
     return Redirect::to('admin/kelas');
 }