Esempio n. 1
0
 public function pdf($reporterId)
 {
     $reporter = MediaReporter::find($reporterId);
     $pdf = App::make('dompdf');
     $pdf->loadView('blupl/printmedia::printing._print-single', ['name' => $reporter->name, 'role' => $reporter->role, 'organization' => $reporter->organization->name, 'photo' => $reporter->photo]);
     return $pdf->stream();
 }
Esempio n. 2
0
 /**
  * Update the role.
  * @return mixed
  */
 public function update($reporterId, Request $request)
 {
     $reporter = MediaReporter::find($reporterId);
     if ($reporter->status == 0) {
         foreach ($request->zone as $key => $zone) {
             $reporter->zone()->create(['zone' => $zone]);
         }
         $reporter->status = 1;
         $reporter->save();
     } else {
         if ($reporter->status == 1) {
             $massage = "Already Approve";
         } else {
             $massage = "Reporter Not Found";
         }
         Flash::error($massage);
         return $this->redirect(handles('blupl/printmedia::approval'));
     }
     Flash::success($reporter->name . ' Approved Successfully');
     return $this->redirect(handles('blupl/printmedia::approval'));
 }
Esempio n. 3
0
 /**
  * Show a role.
  *
  * @param  int  $roles
  *
  * @return mixed
  */
 public function show($reporterId)
 {
     $reporter = MediaReporter::find($reporterId);
     return view('blupl/printmedia::print-single', compact('reporter'));
 }
Esempio n. 4
0
 /**
  * Save the role.
  *
  * @param  \Orchestra\Model\Role  $role
  * @param  array  $input
  * @param  string  $type
  *
  * @return bool
  */
 protected function saving(Eloquent $media, $request, $type = 'create')
 {
     $beforeEvent = $type === 'create' ? 'creating' : 'updating';
     $afterEvent = $type === 'create' ? 'created' : 'updated';
     //        $media->setRawAttributes($request->organization);
     //        $media->member()->setRawAttributes($request->officer);
     //        $media->reporter()->setRawAttributes($request->reporter);
     $this->fireEvent($beforeEvent, [$media]);
     $this->fireEvent('saving', [$media]);
     //        DB::transaction(function () use ($media) {
     //            $media->save();
     //        });
     //        $media->save();
     $organization = $media->create($request->organization);
     $organization->member()->insert($request->officer);
     $organization->reporter()->insert($request->reporter);
     $this->fireEvent($afterEvent, [$media]);
     $this->fireEvent('saved', [$media]);
     return true;
 }
Esempio n. 5
0
 public function show($listener, $reporterId)
 {
     $reporter = MediaReporter::find($reporterId);
     return $listener->showSucceed($reporter);
 }