public function getDetail($id) { //TODO: check jika user punya authentifikasi untuk mengakses module $data = Checklist::find($id)->firstOrFail(); $list = Checklist_relasion::with('checklist', 'actifity', 'sub_jenis_dok')->where('checklist_id', $id)->orderBy('actifity_id')->get(); $name = ''; $i = 1; foreach ($list as $val) { if ($name === $val['actifity']['nama_actifity']) { $i++; } else { $i = 1; } $act[$val['actifity']['nama_actifity']]['rowspan'] = $i; $name = $val['actifity']['nama_actifity']; } return view('checklist.detail', compact('data', 'list', 'act')); }
public function updateChecklist($id) { if (!Auth::check()) { return redirect("/"); } $check = Checklist::find($id); $check->fill(Input::all()); $check->save(); $card = Card::with(['checklists', 'memberCard.member', 'comments.memberComment', 'preCard'])->find($check['Card_id']); return $card; }
/** * for list page * @return mix */ public function actionIndex() { $checklists = Checklist::find()->all(); return $this->render('index', ['checklists' => $checklists]); }
public function actionIndex() { $count = ['clients' => count(Client::find()->all()), 'websites' => count(Website::find()->all()), 'checklists' => count(Checklist::find()->all()), 'messages' => count(Message::find()->all())]; return $this->render('index', ['count' => $count]); }