public function getBackMember($id) { if (!Auth::check()) { return redirect("/"); } $memberID = \Input::get('memberID'); $member = Membermanagement::find($memberID); $member->active = 0; $member->save(); return redirect("member/{$id}"); }
public function getGantt($id) { if (!Auth::check()) { return redirect("/"); } $memberOfBoard = Membermanagement::where('User_id', '=', Auth::user()->id)->where('Board_id', '=', $id)->get(); if (count($memberOfBoard) == 0) { return redirect("/"); } $Board = Board::all()->find($id); session::put("idForGantt", $id); $boardCards = Board::with(['members'])->find(session()->get('idForGantt')); $cards = $boardCards->cards()->with(['memberCard.member', 'comments'])->get(); return view('pages.gantt.ganttChart')->with('Board', $Board)->with('Card', $cards); }
public function getCardEditData() { if (!Auth::check()) { return redirect("/"); } $prior = Priority::all('id', 'name'); $member = Membermanagement::with(['member'])->where('Board_id', '=', session()->get('Board'))->get(); $user = User::find(Auth::user()->id); $boardManager = Board::find(session()->get('Board')); $data['priority'] = $prior; $data['manager'] = $member; $data['user'] = $user; $data['boardManager'] = $boardManager; return $data; }
public function hardDeleteBoard($id) { if (!Auth::check()) { return redirect("/"); } if (Auth::user()->Level_id == 1) { return redirect('/managementAccount'); } $data = Board::find($id); if (Auth::user()->id != $data->manager_id) { return redirect("/"); } $cards = Card::where('Board_id', '=', $id)->get(); $ids = []; foreach ($cards as $cards) { $ids[] = $cards['id']; } Checklist::whereIn('Card_id', $ids)->delete(); Comment::whereIn('Card_id', $ids)->delete(); Card::where('Board_id', '=', $id)->whereNotNull('child_id')->delete(); Card::where('Board_id', '=', $id)->delete(); Membermanagement::where('Board_id', '=', $id)->delete(); $data->delete(); return redirect('/home'); }