public function run()
 {
     $fecha = Carbon\Carbon::now();
     DB::table('noticias')->delete();
     Noticias::create(array('titulo' => 'Bienvenidos', 'contenido' => 'Tenemos el agrado de presentarte tu nuevo sistema web de control e informaciĆ³n de condominios <br> Echa Un vistazo a traves de las opciones presentadas, ven uestros videos demostrativos o lee nuestro manual del usuario', 'persona' => 'Sistema', 'fecha' => $fecha));
     Noticias::create(array('titulo' => 'Informacion', 'contenido' => 'Puedes agregar tus propias noticias para compartirlas con el resto de los usuarios, aprovecha y promociona tus productos, o comparte imagenes de tus juntas de condominio, Se precavido', 'persona' => 'Sistema', 'fecha' => $fecha));
     DB::table('eventos')->delete();
     Eventos::create(array('razon' => 'Junta de Condominio', 'fecha_ini' => $fecha, 'fecha_fin' => $fecha, 'tiempo_ini' => $fecha->format('H:i:s'), 'tiempo_fin' => $fecha->addHours(2)->format('H:i:s')));
     db::Table('portadas')->delete();
     db::Table('portadas')->insert(array("id" => 1, "titulo" => "Mi Residencia esta la WEB!!", "media" => "slider1.jpg", "contenido" => "ResidenciasOnline.com"));
     db::Table('portadas')->insert(array("id" => 2, "titulo" => Config::get('var.nombre'), "media" => "slider0.jpg", "contenido" => "Bienvenido"));
     $this->command->info('Noticias Table Seed!');
 }
 /**
  * Store a newly created resource in storage.
  * POST /eventos
  *
  * @return Response
  */
 public function store()
 {
     $rules = array('razon' => 'required|min:6|max:30', 'fecha_ini' => 'required', 'fecha_fin' => 'required');
     $validation = Validator::make(Input::except('_token'), $rules);
     if ($validation->fails()) {
         return "ERROR";
     }
     $data = Input::except("areas");
     $data['tiempo_ini'] = date("G:i", strtotime(Input::get('tiempo_ini')));
     $data['tiempo_fin'] = date("G:i", strtotime(Input::get('tiempo_fin')));
     $data = array_add($data, 'persona', Auth::user()->nombre);
     $data = array_add($data, 'user_id', Auth::user()->id);
     $areas = explode(",", Input::get('areas', ""));
     $data = array_add($data, 'areas', $areas);
     $evento = Eventos::create($data);
     return $evento;
 }
Example #3
0
 public function agregarevento()
 {
     if (Request::isMethod('post')) {
         $rules = array('razon' => 'required|min:6|max:30', 'fecha_ini' => 'required', 'fecha_fin' => 'required');
         $validation = Validator::make(Input::except('_token'), $rules);
         if ($validation->fails()) {
             return Redirect::to('agregar-evento')->withErrors($validation);
         }
         $data = Input::except("_token");
         $data['tiempo_ini'] = date("G:i", strtotime(Input::get('tiempo_ini')));
         $data['tiempo_fin'] = date("G:i", strtotime(Input::get('tiempo_fin')));
         $data = array_add($data, 'persona', Auth::user()->nombre);
         $data = array_add($data, 'user_id', Auth::user()->id);
         $evento = Eventos::create($data);
         flashMessage("Evento Agregado Correctamente");
         return Redirect::To('ver-eventos');
     }
     $areas = Areas::get();
     return View::make('agregarevento')->with(compact('areas'));
 }