<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
< body >
< ui:composition template = "./template/productosP.xhtml" >
< ui:define name = "top" >
< center >
< / center >
< / ui:define >
< ui:define name = "left" >
< div class = "card" style = "text-align: left;" >
< h:form >
< p:growl id = "messages" showDetail = "true" / >
< p:tieredMenu style = "width:170px" >
< p:submenu label = "Usuarios" >
< p:menuitem value = "Usuario" outcome = "marcaLista3.xhtml" ajax = "false" / >
< p:menuitem value = "Rol" outcome = "rolLista.xhtml" ajax = "false" / >
< / p:submenu >
< p:submenu label = "Proveedores" >
< p:menuitem value = "Proveedor" outcome = "vistaProveedores.xhtml" ajax = "false" / >
< p:menuitem value = "Almacen" outcome = "ubicacionLista.xhtml" ajax = "false" / >
< / p:submenu >
< p:submenu label = "Productos" >
< p:menuitem value = "Producto" outcome = "productosLista.xhtml" ajax = "false" / >
< p:menuitem value = "Categoria" outcome = "categoriaLista.xhtml" ajax = "false" / >
< p:menuitem value = "Talla" outcome = "tallaLista.xhtml" ajax = "false" / >
< p:menuitem value = "Color" outcome = "colorLista.xhtml" ajax = "false" / >
< p:menuitem value = "Marca" outcome = "marcaLista.xhtml" ajax = "false" / >
< p:menuitem value = "Genero" outcome = "vistaGenero.xhtml" ajax = "false" / >
< / p:submenu >
< p:submenu label = "Sesión" >
< p:divider / >
< p:menuitem value = "Token" outcome = "tokenLista.xhtml" ajax = "false" / >
< p:menuitem value = "Cerrar sesión" icon = "pi pi-fw pi-power-off" action = "#{demoBeanLogin.logout()}" / >
< / p:submenu >
< / p:tieredMenu >
< / h:form >
< / div >
< / ui:define >
< ui:define name = "right" >
< / ui:define >
< ui:define name = "content" >
< f:view >
< center >
< h:form style = "background-color: white; margin: -10px;" >
< h1 > < h:outputText style = "color: black;" value = "#{demoBeanUsuarios.titulo}" / > < / h1 >
< p:growl id = "growl" showDetail = "true" / >
< div style = "margin-top: 50px" >
< p:outputLabel value = "Usuario:" for = "usuario" / >
< p:inputText id = "usuario" value = "#{demoBeanUsuarios.usuario.usuario}" style = "margin: 20px" title = "Usuario" required = "true" requiredMessage = "Se requiere campo Usuario." / >
< p:outputLabel value = "Contraseña:" for = "password" / >
< p:inputText id = "password" value = "#{demoBeanUsuarios.usuario.password}" style = "margin-left: 20px; margin-right: 10px; margin-bottom: 20px" title = "password" required = "true" validatorMessage = "La Contraseña no es valido. Debe contener al menos una letra mayúscula, una letra minúscula, un número y tener una longitud mínima de 8 caracteres." requiredMessage = "Se requiere el campo Contraseña." >
< f:validateRegex pattern = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$" for = "password" / >
< / p:inputText >
< / div >
< div >
< h:outputText value = "Genero *" style = "margin-left: 30px;" / >
< p:selectOneMenu id = "generos" value = "#{demoBeanUsuarios.usuario.sexo}" style = "margin-left: 20px; margin-right: 80px; margin-bottom: 20px" converter = "selectOneMenuConverter" title = "Genero" required = "true" requiredMessage = "Se requiere campo Genero." >
< f:selectItems id = "genero" value = "#{demoBeanUsuarios.Seleccionar()}" / >
< / p:selectOneMenu >
< p:outputLabel value = "Fecha de Registro:" for = "fechaRegistro" / >
< p:inputText id = "fechaRegistro" value = "#{demoBeanUsuarios.usuario.fechaRegistro}" style = "margin-left: 20px; margin-right: 30px; margin-top: 20px; margin-bottom:20px " title = "FechaRegistro" required = "true" requiredMessage = "Se requiere campo Fecha de Registro." >
< f:convertDateTime pattern = "MM/dd/yyyy" / >
< / p:inputText >
< / div >
< div >
< p:outputLabel value = "Rol:" for = "rolid" / >
< p:selectOneMenu id = "rolid" value = "#{demoBeanUsuarios.usuario.rolid}" style = "margin-left: 20px; margin-right: 330px; margin-bottom: 20px" converter = "selectOneMenuConverter" required = "true" requiredMessage = "Se requiere campo Rol." >
<!-- TODO: update below reference to list of available items -->
< f:selectItems value = "#{demoBeanRol.listRolll}" var = "item" itemLabel = "#{item.rolUsuario}" itemValue = "#{item}" / >
< / p:selectOneMenu >
< / div >
< p:commandButton action = "#{demoBeanUsuarios.agregarUsuario()}" style = "margin-left: 430px; margin-top: 30px" value = "Guardar" update = "growl" styleClass = "rounded-button ui-button-success" rendered = "#{demoBeanUsuarios.nuevo}" ajax = "false" / >
< p:commandButton action = "marcaLista3.xhtml" style = "margin-left: 430px; margin-top: 30px" actionListener = "#{demoBeanUsuarios.editarUsuarios()}" styleClass = "rounded-button ui-button-success" value = "Editar" update = "growl" rendered = "#{!demoBeanUsuarios.nuevo}" ajax = "false" / >
< p:commandButton action = "marcaLista3.xhtml" style = "margin-left: 10px" styleClass = "rounded-button ui-button-danger" value = "Cancelar" immediate = "true" ajax = "false" / >
< / h:form >
< / center >
< / f:view >
< / ui:define >
< / ui:composition >
< / body >
< / html >