コード例 #1
0
ファイル: PposController.php プロジェクト: abada/eppo
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $ppo = Ppo::findOrFail($id);
     $regimens = Regimen::lists('name', 'id');
     $diagnoses = Diagnosis::lists('name', 'id');
     $reasons = DoseModificationReason::lists('name', 'id');
     $diagnosesSelected = $ppo->diagnoses->pluck('id')->all();
     $reasonsSelected = $ppo->reasons->pluck('id')->all();
     return view('ppos.edit', compact('ppo', 'regimens', 'diagnosesSelected', 'diagnoses', 'reasons', 'reasonsSelected'));
 }
コード例 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $reason = DoseModificationReason::findOrFail($id);
     $reason->delete();
     return redirect()->route('dosemodificationreasons.index')->with('success-message', 'Dose Calculation Type deleted.');
 }
コード例 #3
0
ファイル: PposController.php プロジェクト: ssswang/eppo
 /**
  * Show the form for creating a new resource in ajax modal.
  *
  * @return \Illuminate\Http\Response
  */
 public function addReasonAjax(Request $request)
 {
     if ($request->isMethod('post')) {
         $this->validate($request, ['name' => 'required']);
         $input = $request->all();
         DoseModificationReason::create($input);
         return redirect()->route('ppos.create')->with('success-message', 'Regimen list updated');
     }
     return view('ppos.add_reason_ajax');
 }