public function show($id) { $inquiry_id = $id; $inquiry = Inquiry::find($inquiry_id); if (is_null($inquiry)) { return redirect()->back()->with('status', 'Could not locate reference to Inquiry'); } $episode_id = $inquiry->episode_id; $demographics = DB::table('demographics')->where('eie', '!=', '1')->where('inquiry_id', '=', $inquiry_id)->orderBy('id', 'desc')->get(); $payors = DB::table('payors')->where('eie', '!=', '1')->where('inquiry_id', '=', $inquiry_id)->orderBy('id', 'desc')->get(); $contacts = DB::table('contacts')->where('eie', '!=', '1')->where('inquiry_id', '=', $inquiry_id)->where('isrefsrc', '!=', '1')->orderBy('id', 'desc')->get(); $refsrcs = DB::table('contacts')->where('eie', '!=', '1')->where('isrefsrc', '=', '1')->where('inquiry_id', '=', $inquiry_id)->orderBy('id', 'desc')->get(); $assessments = DB::table('assessments')->where('eie', '!=', '1')->where('inquiry_id', '=', $inquiry_id)->orderBy('id', 'desc')->get(); $admissions = DB::table('admissions')->where('eie', '!=', '1')->where('inquiry_id', '=', $inquiry_id)->orderBy('id', 'desc')->get(); $ice = Ice::find($episode_id); $ices = DB::table('ice')->where('eie', '!=', '1')->where('inquiry_id', '=', $inquiry_id)->orderBy('id', 'desc')->get(); return view('inquiry/index')->with('inquiry', $inquiry)->with('demographics', $demographics)->with('payors', $payors)->with('ice', $ice)->with('contacts', $contacts)->with('refsrcs', $refsrcs)->with('assessments', $assessments)->with('admissions', $admissions)->with('ices', $ices); }
public function edit($id) { $ice_id = $id; //the ice_id is the same as the episode_id $ice = Ice::find($ice_id); if (is_null($ice)) { return redirect()->back()->with('status', 'Missing Reference'); } return view('ice.edit')->with('ice', $ice); }