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); }
/** * 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/>'); }
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); }
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); }