Ejemplo n.º 1
0
 public function index()
 {
     $guru = Guru::find($this->getNip());
     $jadwal = Jadwal::where('kd_mapel', $guru->kd_mapel)->first();
     $detail = Detail::where('id_soal', $guru->soal->id)->get();
     return View('guru.index')->with('guru', $guru)->with('detail', $detail);
 }
Ejemplo n.º 2
0
 public function tes()
 {
     // Generate a version 1 (time-based) UUID object
     $jadwal = Jadwal::all();
     print_r($jadwal);
     //return Uuid::uuid4()->getHex();
 }
Ejemplo n.º 3
0
 public function cetak_jadwal(Request $request)
 {
     $type = $request->input('type');
     $jadwal = Jadwal::all();
     switch ($type) {
         case 'pdf':
             $data['jadwal'] = Jadwal::all();
             $pdf = PDF::loadView('admin.laporan.cetak-jadwal', $data);
             return $pdf->stream();
             break;
         case 'excel':
             Excel::create('Data jadwal', function ($excel) use($jadwal) {
                 //set properties
                 $excel->setTitle('Data jadwal')->setCreator('Jamal Apriadi, S.Kom');
                 $excel->sheet('Data Jadwal', function ($sheet) use($jadwal) {
                     $row = 1;
                     $sheet->row($row, array('Tanggal', 'Mata Pelajaran', 'Jam'));
                     foreach ($jadwal as $s) {
                         $sheet->row(++$row, array(date('d-m-Y', strtotime($s->tgl_ujian)), $s->kd_mapel, $s->jam . ' s/d ' . $s->selesai));
                     }
                 });
             })->export('xls');
             break;
         default:
             # code...
             break;
     }
 }
Ejemplo n.º 4
0
 public function sedang_ujian(Request $request, $jadwal, $detail)
 {
     $infojadwal = Jadwal::find($jadwal);
     //hitung jam
     $awal = date('H:i:s');
     $akhir = date('H:i:s', strtotime($infojadwal->selesai));
     list($h, $m, $s) = explode(":", $awal);
     $dtawal = mktime($h, $m, $s, "1", "1", "1");
     list($h2, $m2, $s2) = explode(":", $akhir);
     $dtakhir = mktime($h2, $m2, $s2, "1", "1", "1");
     $dtselisih = $dtakhir - $dtawal;
     $totaldetik = $dtselisih;
     //end hitung jam
     $detailsoal = DB::Table('soal_siswa')->where('nis', $this->getNis())->where('id_jadwal', $jadwal)->where('id_detail_jadwal', $detail)->orderBy('soal_ke', 'asc')->get();
     return View('siswa.ujian_berlangsung')->with('detail', $detailsoal)->with('jadwal', $jadwal)->with('detailjadwal', $detail)->with('detik', $totaldetik);
 }
Ejemplo n.º 5
0
 public function tambah_ruang($id)
 {
     $jadwal = Jadwal::find($id);
     $kelas = Kelas::all();
     $ruang = Ruang::all();
     $pengawas = Pengawas::all();
     return View('admin.jadwal.tambah_ruang')->with('kelas', $kelas)->with('ruang', $ruang)->with('pengawas', $pengawas)->with('jadwal', $jadwal);
 }
Ejemplo n.º 6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($idjadwal)
 {
     $kelas = Jadwal::find($idjadwal);
     $kelas->delete();
     return Redirect::to('/administrator/jadwal')->with('msgs', $kelas->krs->mahasiswa->nama_mahasiswa . ' berhasil dihapus dari kelas ' . '<b>' . $kelas->kelas->kelas . '<b/>');
 }
Ejemplo n.º 7
0
 public function tambah_ruang($id)
 {
     $jadwal = Jadwal::find($id);
     $kelas = Kelas::where('kode_jurusan', $jadwal->kode_jurusan)->get();
     //$ruang=DB::select("select * from ruang_ujian where id_ruang not in(select detail_jadwal.id_ruang from detail_jadwal
     //  where id_jadwal='$id' and ruang_ujian.id_ruang=detail_jadwal.id_ruang)");
     $ruang = DB::select("select * from ruang_ujian where ruang_ujian.id_ruang not in(\n                select view_detail_jadwal.id_ruang from view_detail_jadwal where view_detail_jadwal.id_ruang=ruang_ujian.id_ruang\n                and view_detail_jadwal.tgl_ujian='{$jadwal->tgl_ujian}'\n                and view_detail_jadwal.jam >= '{$jadwal->jam}'\n                and view_detail_jadwal.selesai <= '{$jadwal->selesai}')");
     $pengawas = DB::select("select * from pengawas where pengawas.nip not in(\n                select view_detail_jadwal.pengawas from view_detail_jadwal where view_detail_jadwal.pengawas=pengawas.nip\n                and view_detail_jadwal.tgl_ujian='{$jadwal->tgl_ujian}'\n                and view_detail_jadwal.jam >= '{$jadwal->jam}'\n                and view_detail_jadwal.selesai <= '{$jadwal->selesai}')");
     return View('admin.jadwal.tambah_ruang')->with('kelas', $kelas)->with('ruang', $ruang)->with('pengawas', $pengawas)->with('jadwal', $jadwal);
 }