Example #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $noti_show = Noticia::where('id', $id)->get();
     if ($this->auth->user()->role == 1) {
         return view('admin.noticia.show', ['noti_show' => $noti_show]);
     } else {
         return Redirect::to('home');
     }
 }
Example #2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $id_site = \Session::get('id_site');
     $noti_show = Noticia::where('id', $id)->get();
     $sitios = Sites::where('id', $id_site)->get();
     if ($this->auth->user()->role == 1) {
         return view('admin.noticia.show', ['noti_show' => $noti_show, 'sitios' => $sitios]);
     } else {
         return view('noticia.show', ['noti_show' => $noti_show, 'sitios' => $sitios]);
     }
 }
Example #3
0
 public function contenidos()
 {
     $id_site = \Session::get('id_site');
     $id_user = $this->auth->user()->id;
     $user_role = Sites_users::where('id_site', $id_site)->where('id_user', $id_user)->value('role');
     $sites = Sites_users::where('id_user', $id_user)->count();
     if ($user_role == 1) {
         $noticias = Noticia::where('id_site', $id_site)->get();
         $documentos = Documentos::where('id_site', $id_site)->get();
         $utiles = Utiles::where('id_site', $id_site)->get();
         $sitios = Sites::where('id', $id_site)->get();
         return view('/admin/contenidos', ['sitios' => $sitios, 'sites' => $sites, 'utiles' => $utiles, 'noticias' => $noticias, 'documentos' => $documentos]);
     } else {
         return Redirect::to('home');
     }
 }