コード例 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (file_exists(public_path() . '/backups')) {
         $backups = array_filter(scandir(public_path() . '/backups'), function ($d) {
             return $d[0] != '.';
         });
     } else {
         $backups = [];
     }
     $preferred_server = Session::get('preferred_server', '');
     if (Input::has('modality')) {
         $simulations = Simulation::where('Power_Generator.Modality_Id', '=', Input::get('modality'))->get();
     } else {
         $simulations = Simulation::all();
     }
     $modalities = Modality::all();
     return View::make('simulations.index', compact('simulations', 'backups', 'preferred_server', 'modalities'));
 }
コード例 #2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $modalities = Modality::all()->lists('Name', 'Id');
     return View::make('protocols.create', compact('modalities'));
 }