public function dismiss()
 {
     // check we're logged in
     if (!Auth::check()) {
         Session::flash('redirect', URL::route('reports'));
         return Redirect::route('login');
     }
     $reportId = Input::get('report');
     $report = Report::findOrFail($reportId);
     $report->delete();
     return Redirect::route('reports')->with('success', 'Report dismissed');
 }
 public function postUpdate()
 {
     $reports = Input::get('reports');
     if (is_null($reports)) {
         Redirect::back();
     }
     foreach ($reports as $r) {
         $report = Report::findOrFail($r['report']);
         $report->fill($r);
         $report->save();
     }
     return App::make('TournamentsController')->ranking(Tournament::findOrFail(Input::get('tournament')));
 }
 /**
  * Show the form for editing the specified reportgrouping.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($report_id, $id)
 {
     $reportgrouping = ReportGrouping::findOrFail($id);
     if (Request::ajax()) {
         return $this->_ajax_denied();
     }
     if (!$reportgrouping->canUpdate()) {
         return _access_denied();
     }
     $report = Report::findOrFail($report_id);
     return View::make('reportgroupings.edit', compact('reportgrouping', 'report_id', 'report'));
 }
 /**
  * Display the specified resource.
  * GET /reports/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Report::findOrFail($id);
 }
示例#5
0
 /**
  * Remove the specified report from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $report = Report::findOrFail($id);
     if (!$report->canDelete()) {
         return $this->_access_denied();
     }
     $report->delete();
     if (Request::ajax()) {
         return Response::json($this->deleted_message);
     }
     return Redirect::action('ReportsController@index')->with('notification:success', $this->deleted_message);
 }
示例#6
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $report = $this->report->findOrFail($id);
     return View::make('reports.show', compact('report'));
 }