Exemplo 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);
 }
Exemplo n.º 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $soal = Soal::find($id);
     $detail = Detail::where('id_soal', $id)->get();
     return View('admin.soal.detail')->with('soal', $soal)->with('detail', $detail);
 }
Exemplo n.º 3
0
 public function savetoolinfo(Request $request)
 {
     $id = $request->id;
     $data = $request->data;
     $fn = $data['fn'];
     // supplier shortname
     $detail = Detail::where('tool_id', '=', $id)->first();
     if ($detail === null) {
         $detail = Detail::saveDetails($id, $data);
     } else {
         // Update Detail
         $detail->tool_id = $id;
         $detail->title1 = $data['title1'];
         $detail->title2 = $data['title2'];
         $detail->cuttingdata = $data['cuttingdata'];
         $detail->description = $data['description'];
         $detail->save();
     }
     if (count($data['images']) > 0) {
         foreach ($data['images'] as $url) {
             $this->savePicture($id, $data, $url);
         }
     }
     return "Success";
 }