/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $rol = rol::find($id); $rol->fill($request->all()); $rol->save(); Session::flash('message', 'Rol actualizado Correctamente'); return Redirect::to('backend//rols'); }
function view() { if (!VAR3) { die("Error del sistema 404"); } $tusuario = new tab_usuario(); $tusuario->setRequest2Object($_REQUEST); $row = $tusuario->dbselectByField("usu_id", VAR3); if (!$row) { die("Error del sistema 404"); } $row = $row[0]; $this->registry->template->titulo = "EDITAR PERMISOS DE LECTURA DEL USUARIO"; $this->registry->template->usu_id = $row->usu_id; $usu = new usuario(); $datosUsu = $usu->getDatos(VAR3); $this->registry->template->unidad = $datosUsu->uni_descripcion; $rol = new rol(); $this->registry->template->roles = $rol->obtenerSelect($row->rol_id); if ($row->usu_leer_doc == '1') { $selected1 = " selected"; $selected2 = ""; } if ($row->usu_leer_doc == '2') { $selected2 = " selected"; $selected1 = ""; } $this->registry->template->leer_doc = '<option value="1" ' . $selected1 . '>LEER</option><option value="2" ' . $selected2 . '>NO LEER</option>'; $this->registry->template->usuario = $row->usu_nombres . " " . $row->usu_apellidos; $tmenu = new menu(); $liMenu = $tmenu->imprimirMenu(VAR1, $_SESSION['USU_ID']); $this->registry->template->men_titulo = $liMenu; $this->registry->template->PATH_WEB = PATH_WEB; $this->registry->template->PATH_DOMAIN = PATH_DOMAIN; $this->registry->template->PATH_EVENT = "update"; $this->registry->template->PATH_J = "jquery"; $this->registry->template->GRID_SW = "true"; $this->registry->template->FORM_SW = ""; $this->registry->template->show('headerG'); $this->registry->template->show('usuario/permisos.tpl'); $this->registry->template->show('footer'); }
function verifCodigo() { $rol = new rol(); $rol->setRequest2Object($_REQUEST); $rol_cod = trim($_POST['rol_cod']); $Path_event = trim($_POST['Path_event']); if ($Path_event != 'update') { if ($rol->existeCodigo($rol_cod)) { echo 'El código ya existe, escriba otro.'; } else { echo ''; } } else { echo ''; } }
public function edit($Id) { $id = base64_decode($Id); $usuario = User::find($id); $rol = rol::lists('Rol', 'id'); return view('usuarios.Editar', compact('usuario', 'rol')); }
function clonar_view() { if (!VAR3) { die("Error del sistema 404"); } $this->usuario = new tab_usuario(); $usuario = new usuario(); $this->usuario->setRequest2Object($_REQUEST); $row = $this->usuario->dbselectByField("usu_id", VAR3); if (!$row) { die("Error del sistema 404"); } $row = $row[0]; $this->registry->template->titulo = "NUEVO USUARIO DEL SISTEMA"; $this->registry->template->usu_id = ""; $this->registry->template->mod_login = ""; $unidad = new unidad(); $this->registry->template->uni_id = $unidad->listUnidad($row->uni_id); $rol = new rol(); $this->registry->template->roles = $rol->obtenerSelect($row->rol_id); $this->registry->template->leer_doc = '<option value="1">LEER</option><option value="2">NO LEER</option>'; $this->registry->template->crear_doc = 'NO'; $this->registry->template->usu_nombres = ""; $this->registry->template->usu_apellidos = ""; //$this->registry->template->usu_iniciales = $row->usu_iniciales; $this->registry->template->usu_fono = ""; $this->registry->template->usu_email = ""; $this->registry->template->usu_nro_item = ""; $this->registry->template->usu_fech_ing = ""; $this->registry->template->usu_fech_fin = ""; $this->registry->template->usu_login = ""; $this->registry->template->usu_leer_doc = ""; $this->registry->template->usu_verproy = ""; $encuesta = new encuesta(); $this->registry->template->lista_encuesta = $usuario->allencuestaSeleccionado($row->usu_id); $this->menu = new menu(); $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']); $this->registry->template->men_titulo = $this->liMenu; $this->registry->template->PATH_WEB = PATH_WEB; $this->registry->template->PATH_DOMAIN = PATH_DOMAIN; $this->registry->template->PATH_EVENT = "save"; $this->registry->template->PATH_J = "jquery"; $this->registry->template->GRID_SW = "true"; $this->registry->template->FORM_SW = ""; $this->registry->template->show('headerG'); $this->registry->template->show('usuario/tab_usuario.tpl'); $this->registry->template->show('footer'); }
public function loader() { /* * * check the route ** */ $this->getController(); /* * * if the file is not there diaf ** */ if (is_readable($this->file) == false) { $this->file = $this->path . '/error404.php'; $this->controller = 'error404'; } $rol = new rol(); if ($this->controller != "index" && $this->controller != "login") { $usu_id = $_SESSION['USU_ID']; $switch = $rol->validaAcceso($usu_id, $this->controller); if ($switch == false) { $this->file = $this->path . '/error404.php'; $this->controller = 'error404'; } } /* * * include the controller ** */ include $this->file; /* * * a new controller class instance ** */ $class = $this->controller . 'Controller'; $controller = new $class($this->registry); /* * * check if the action is callable ** */ if (is_callable(array($controller, $this->action)) == false) { $action = 'index'; } else { $action = $this->action; } /* * * run the action ** */ $controller->{$action}(); }