public function getPublicationCasual()
 {
     $pub = Publicaciones::where('user_id', '=', Auth::id())->where('tipo', '=', 'Casual')->where('fechRepub', '>', date('Y-m-d', time()))->orderBy('fechRepub', 'desc')->first();
     if (count($pub) > 0 && Auth::id() != 21) {
         Session::flash('error', 'Usted ha consumido el máximo de publicaciones casuales. Inténtelo nuevamente cuando su última publicación casual expire.');
         return Redirect::to('usuario/publicar');
     }
     $title = "Publicación CASUAL | pasillo24.com";
     $url = 'usuario/publicacion/casual/enviar';
     $departamentos = Department::get();
     $categorias = Categorias::where('tipo', '=', 1)->where('deleted', '=', 0)->orderBy('nombre')->get();
     $otros = new StdClass();
     foreach ($categorias as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros->id = $c->id;
             $otros->nombre = $c->nombre;
         }
     }
     if (!isset($otros->id)) {
         $otros->id = '1000';
         $otros->nombre = 'Otros';
     }
     $servicios = Categorias::where('tipo', '=', 2)->where('deleted', '=', 0)->orderBy('nombre')->get();
     $otros2 = new StdClass();
     foreach ($servicios as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros2->id = $c->id;
             $otros2->nombre = $c->nombre;
         }
     }
     if (!isset($otros2->id)) {
         $otros2->id = '1000';
         $otros2->nombre = 'Otros';
     }
     $textos = Textos::where('id', '=', 3)->first();
     return View::make('publications.publicacion')->with('tipo', 'casual')->with('url', $url)->with('title', $title)->with('departamento', $departamentos)->with('categorias', $categorias)->with('texto', $textos)->with('servicios', $servicios)->with('otros', $otros)->with('otros2', $otros2);
 }
Пример #2
0
 public function getPublicationNormal()
 {
     $title = "Publicación HABITUAL | pasillo24.com";
     $marcas = Marcas::all();
     $url = 'usuario/publication/estandar/enviar';
     $departamento = Department::all();
     $categorias = Categorias::where('deleted', '=', 0)->where('tipo', '=', 1)->orderBy('nombre')->get();
     $otros = new StdClass();
     foreach ($categorias as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros->id = $c->id;
             $otros->nombre = $c->nombre;
         }
     }
     if (!isset($otros->id)) {
         $otros->id = '1000';
         $otros->nombre = 'Otros';
     }
     $servicios = Categorias::where('deleted', '=', 0)->where('tipo', '=', 2)->orderBy('nombre')->get();
     $otros2 = new StdClass();
     foreach ($servicios as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros2->id = $c->id;
             $otros2->nombre = $c->nombre;
         }
     }
     if (!isset($otros2->id)) {
         $otros2->id = '1000';
         $otros2->nombre = 'Otros';
     }
     $textos = Textos::where('id', '=', 2)->first();
     return View::make('publications.publicacion')->with('title', $title)->with('tipo', 'normal')->with('marcas', $marcas)->with('url', $url)->with('categorias', $categorias)->with('texto', $textos)->with('departamento', $departamento)->with('servicios', $servicios)->with('otros', $otros)->with('otros2', $otros2);
 }