public function savechanges() { $publicidad = Publicidad::find(Input::get('id')); // $date1 = DateTime::createFromFormat('d/m/Y', Input::get('date')); // $date1=$date1->format('Y-m-d'); $publicidad->descripcion = Input::get('descripcion'); // $publicidad->dia = $date1; $publicidad->hora_inicio = Input::get('hora_inicio'); $publicidad->hora_fin = Input::get('hora_fin'); $publicidad->save(); return Redirect::to('admin/publicidad')->with('message', 'Cambios con éxito'); }
public function postElimSlides() { if (Request::ajax()) { $id = Input::get('id'); $st = Input::get('status'); $publi = Publicidad::find($id); if ($st == 1) { $publi->activo = 0; } else { $publi->activo = 1; } if ($publi->save()) { return Response::json(array('type' => 'success', 'msg' => 'Slide eliminado satisfactoriamente')); } else { return Response::json(array('type' => 'danger', 'msg' => 'Error al eliminar el slide')); } } }
public function getAddDelItemProm($id) { $title = "Agregar/Quitar items"; $prom = Publicidad::find($id); $b = Items::where('deleted', '=', '0')->where(function ($query) use($id) { $query->where('item_prom', '=', 0)->orWhere('item_prom', '=', $id); })->get(array('item_cod', 'id', 'item_prom')); $item = array(); $i = 0; foreach ($b as $a) { $aux = Misc::where('item_id', '=', $a->id)->where('deleted', '=', 0)->first(); $b->img[$i] = Images::where('misc_id', '=', $aux->id)->where('deleted', '=', 0)->pluck('image'); $item[$i] = $b; $i++; } return View::make('admin.mdfPromItem')->with('title', $title)->with('prom', $prom)->with('items', $item); }