<?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/principal.xhtml" >
< ui:define name = "top" >
< center > < H2 > U S U A R I O S < / H2 > < / center >
< / ui:define >
< ui:define name = "left" >
< h:form >
< p:menu style = "border-color: gray; width: 163px; height: 630px;" >
< p:menuitem action = "ProductoLista.xhtml" value = "Productos" ajax = "false" icon = "pi pi-shopping-bag" iconPos = "left" style = "background-color: lightgray; height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "proveedorLista.xhtml" value = "Proveedores" ajax = "false" icon = "pi pi-id-card" iconPos = "left" style = "background-color: white ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "marcaLista.xhtml" value = "Marcas" ajax = "false" icon = "pi pi-tag" iconPos = "left" style = "background-color: lightgray ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "categoriaLista.xhtml" value = "Categorias" ajax = "false" icon = "pi pi-star" iconPos = "left" style = "background-color: white ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "UbicacionAlmacenLista.xhtml" value = "Almacen" ajax = "false" icon = "pi pi-map-marker" iconPos = "left" style = "background-color: lightgray ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "usuariosLista.xhtml" value = "Usuarios" ajax = "false" icon = "pi pi-users" iconPos = "left" style = "background-color: white ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "rolLista.xhtml" value = "Roles" ajax = "false" icon = "pi pi-sitemap" iconPos = "left" style = "background-color: lightgray ;height: 80px;" styleClass = "botonMenu" / >
< / p:menu >
< / h:form >
< / ui:define >
< ui:define name = "content" >
< f:view >
< h:form id = "formtabla" >
< p:growl id = "growl" showDetail = "true" / >
< p:dataTable id = "tabla" value = "#{demoBeanUsuarios.all}" var = "item"
widgetVar="Usuarios" emptyMessage="No se han encontrado el usuario"
filteredValue="#{demoBeanUsuarios.filteredCustomers3}"
globalFilterFunction="#{demoBeanUsuarios.globalFilterFunction}"
scrollable="true" scrollHeight="480" >
< f:facet name = "header" >
< div class = "flex justify-content-end" style = "height: 30px;" >
< div >
< p:commandButton ajax = "true" oncomplete = "PF('dlg').show();" actionListener = "#{demoBeanUsuarios.prepararNuevo()}"
update=":dialog" value="Nuevo" icon="pi pi-plus" />
< i class = "pi pi-search" style = "margin-left:690px; margin-top: 10px;" > < / i >
< p:inputText id = "globalFilter" onkeyup = "PF('usuario').filter()" placeholder = "Buscar usuario"
style="width:250px; margin-right: 120px; float: right; margin-top: -1px;" />
< p:commandButton value = "Logout" ajax = "false" icon = "pi pi-sign-out" action = "#{demoBeanLogin.logout()}" style = "background-color: #036FAB; width: 100px; float: right; margin-top: -40px " / >
< / div >
< / div >
< / f:facet >
< p:column styleClass = "columnaId2" style = "text-align: center;" >
< f:facet name = "header" >
< h:outputText value = "Id" style = "font-weight: bolder; " / >
< / f:facet >
< h:outputText value = "#{item.id}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Nombre" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.nombre}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Apellidos Paterno" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.apellidop}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Apellido Materno" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.apellidom}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Usuario" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.usuario}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Correo" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.correo}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Telefono" style = "font-weight:bolder;" / >
< / f:facet >
< h:outputText value = "#{item.telefono}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Rol" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.rolId.rol}" / >
< / p:column >
< p:column styleClass = "columnaOpc" >
< f:facet name = "header" >
< h:outputText value = "Opciones" style = "font-weight: bolder;" / >
< / f:facet >
< p:commandButton ajax = "true" oncomplete = "PF('dlg').show();" actionListener = "#{demoBeanUsuarios.prepararEditar(item)}"
update=":dialog" style="margin-right: 10px; " icon="pi pi-file-edit" />
< p:commandButton ajax = "true" oncomplete = "PF('dlg2').show();" actionListener = "#{demoBeanUsuarios.prepararEliminar(item)}"
update=":dialog2" style="background-color: red; color:white; border-color: red; " icon="pi pi-trash" />
< p:commandButton ajax = "true" oncomplete = "PF('dlg3').show();" actionListener = "#{demoBeanUsuarios.prepararEditar(item)}"
update=":dialog3" icon="pi pi-eye" style="background-color: #88DC65; color:black; margin-right: 10px; width: 85px; margin-top: 10px" />
< / p:column >
< / p:dataTable >
< / h:form >
<!-- crear/editar''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->
< p:dialog id = "dialog" widgetVar = "dlg" width = "900" height = "500" modal = "true" appendTo = "@(body)" >
< h:form >
< p:growl id = "growl" for = "usuariosMsj" showDetail = "true" / >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; margin-bottom: 10px;" >
< h:outputText value = "#{demoBeanUsuarios.titulo}" / > < / h3 >
< h:panelGrid id = "grid" columns = "6" style = "width: 100%" >
< p:outputLabel style = "font-weight:bolder" value = "Nombre:" for = "nombre" / >
< p:inputText id = "nombre" value = "#{demoBeanUsuarios.usuarios.nombre}" title = "Nombre" required = "true" requiredMessage = "campo obligatorio" validatorMessage = " el numbre debe enpesar con mayuscula " >
< f:validateRegex pattern = "^[A-Z]$" for = "nombre" / >
< / p:inputText >
< p:messages for = "nombre" / >
< p:outputLabel style = "font-weight:bolder" value = "Genero:" for = "genero" / >
< p:inputText id = "genero" value = "#{demoBeanUsuarios.usuarios.genero}" title = "Genero" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "genero" / >
< p:outputLabel style = "font-weight:bolder" value = "Apellido Paterno:" for = "apellidop" / >
< p:inputText id = "apellidop" value = "#{demoBeanUsuarios.usuarios.apellidop}" title = "Apellidop" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "apellidop" / >
< p:outputLabel style = "font-weight:bolder" value = "Fecha de nacimiento:" for = "fechanacimiento" / >
< p:inputText id = "fechanacimiento" value = "#{demoBeanUsuarios.usuarios.fechanacimiento}" title = "Fechanacimiento" required = "true" requiredMessage = "campo obligatorio" validatorMessage = "La fecha tine que ir como yyyy/mm/dd" >
< f:convertDateTime pattern = "MM/dd/yyyy" / >
< / p:inputText >
< p:messages for = "fechanacimiento" / >
< p:outputLabel style = "font-weight:bolder" value = "Apellido Materno:" for = "apellidom" / >
< p:inputText id = "apellidom" value = "#{demoBeanUsuarios.usuarios.apellidom}" title = "Apellidom" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "apellidom" / >
< p:outputLabel style = "font-weight:bolder" value = "Correo:" for = "correo" / >
< p:inputText id = "correo" value = "#{demoBeanUsuarios.usuarios.correo}" title = "Correo" required = "true" requiredMessage = "campo obligatorio" validatorMessage = "Correo electronico invalido" >
< f:validateRegex pattern = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" for = "correo" / >
< / p:inputText >
< p:messages for = "correo" / >
< p:outputLabel style = "font-weight:bolder" value = "Usuario:" for = "usuario" / >
< p:inputText id = "usuario" value = "#{demoBeanUsuarios.usuarios.usuario}" title = "Usuario" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "usuario" / >
< p:outputLabel style = "font-weight:bolder" value = "Contraseña:" for = "contrasenia" / >
< p:inputText id = "contrasenia" value = "#{demoBeanUsuarios.usuarios.contrasenia}" title = "Contrasenia" required = "true" requiredMessage = "campo obligatorio" >
< f:validateRegex pattern = "^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{8}$" for = "contrasenia" / >
< / p:inputText >
< p:messages for = "contrasenia" / >
< p:outputLabel style = "font-weight:bolder" value = "Telefono:" for = "telefono" / >
< p:inputText id = "telefono" value = "#{demoBeanUsuarios.usuarios.telefono}" title = "Telefono" required = "true" requiredMessage = "campo obligatorio" validatorMessage = "el numero esta incompleto revise que si coresponda" >
< f:validateRegex pattern = "^[0-9]{10}$" for = "telefono" / >
< / p:inputText >
< p:messages for = "telefono" / >
< p:outputLabel style = "font-weight:bolder" value = "Pais:" for = "pais" / >
< p:inputText id = "pais" value = "#{demoBeanUsuarios.usuarios.pais}" title = "Pais" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "pais" / >
< p:outputLabel style = "font-weight:bolder" value = "Estado:" for = "estado" / >
< p:inputText id = "estado" value = "#{demoBeanUsuarios.usuarios.estado}" title = "Estado" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "estado" / >
< p:outputLabel style = "font-weight:bolder" value = "Municipio:" for = "municipio" / >
< p:inputText id = "municipio" value = "#{demoBeanUsuarios.usuarios.municipio}" title = "Municipio" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "municipio" / >
< p:outputLabel style = "font-weight:bolder" value = "Localidad:" for = "localidad" / >
< p:inputText id = "localidad" value = "#{demoBeanUsuarios.usuarios.localidad}" title = "Localidad" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "localidad" / >
< p:outputLabel style = "font-weight:bolder" value = "Calle:" for = "calle" / >
< p:inputText id = "calle" value = "#{demoBeanUsuarios.usuarios.calle}" title = "Calle" required = "true" requiredMessage = "campo obligatorio" >
< / p:inputText >
< p:messages for = "calle" / >
< p:outputLabel style = "font-weight:bolder" value = "Numero:" for = "numero" / >
< p:inputText id = "numero" value = "#{demoBeanUsuarios.usuarios.numero}" title = "Numero" required = "true" requiredMessage = "campo obligatorio" >
< f:validateRegex pattern = "^[0-9]+(\s[A-Z])?$" for = "numero" / >
< / p:inputText >
< p:messages for = "numero" / >
< p:outputLabel style = "font-weight:bolder" value = "CP:" for = "cp" / >
< p:inputText id = "cp" value = "#{demoBeanUsuarios.usuarios.cp}" title = "Cp" required = "true" requiredMessage = "campo obligatorio" validatorMessage = "el codigo posta es incorrecto revisaelo" >
< f:validateRegex pattern = "^[0-9]{5}$" for = "cp" / >
< / p:inputText >
< p:messages for = "cp" style = "" / >
< p:outputLabel style = "font-weight:bolder;" value = "Rol:" for = "rolId" / >
< p:selectOneMenu id = "rolId" value = "#{demoBeanUsuarios.usuarios.rolId}" converter = "selectOneMenuConverter" >
< f:selectItems value = "#{demoBeanRol.all}" var = "item" itemLabel = "#{item.rol}" itemValue = "#{item}" / >
< / p:selectOneMenu >
< / h:panelGrid >
< p:commandButton action = "usuariosLista.xhtml" ajax = "false" icon = "pi pi-times" immediate = "true" update = "grid, formtabla:tabla, growl"
style="background-color: red; border-color:red; float: right;"/>
< p:commandButton action = "#{demoBeanUsuarios.agregar()}" update = "grid, formtabla:tabla, growl" ajax = "true"
rendered="#{demoBeanUsuarios.nuevo}" icon="pi pi-check"
style="margin-right: 10px; background-color:green; border-color:green; float: right; " />
< p:commandButton action = "#{demoBeanUsuarios.editar()}"
update="grid, formtabla:tabla, growl" ajax="true" rendered="#{!demoBeanUsuarios.nuevo}" icon="pi pi-check"
style="margin-right: 10px; background-color:green; border-color:green; float: right;" />
< / h:form >
< / p:dialog >
<!-- eliminiar''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->
< p:dialog id = "dialog2" widgetVar = "dlg2" width = "900" height = "500" modal = "true" >
< h:form >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; margin-bottom: 10px;" >
< h:outputText value = "E L I M I N A R" / > < / h3 >
< div >
< h:panelGrid id = "grid" columns = "4" style = "width: 100%" cellpadding = "10" >
< h:outputText value = "Id:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.id}" title = "Id" / >
< h:outputText value = "Genero:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.genero}" title = "Genero" / >
< h:outputText value = "Nombre:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.nombre}" title = "Nombre" / >
< h:outputText value = "Fecha de nacimiento:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.fechanacimiento}" title = "Fechanacimiento" >
< f:convertDateTime pattern = "MM/dd/yyyy" / >
< / h:outputText >
< h:outputText value = "Apellido Paterno:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.apellidop}" title = "Apellidop" / >
< h:outputText value = "Correo:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.correo}" title = "Correo" / >
< h:outputText value = "Apellido Materno:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.apellidom}" title = "Apellidom" / >
< h:outputText value = "Usuario:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.usuario}" title = "Usuario" / >
< h:outputText value = "Telefono:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.telefono}" title = "Telefono" / >
< h:outputText value = "Contraseña:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.contrasenia}" title = "Contrasenia" / >
< h:outputText value = "Pais:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.pais}" title = "Pais" / >
< h:outputText value = "Estado:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.estado}" title = "Estado" / >
< h:outputText value = "Municipio:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.municipio}" title = "Municipio" / >
< h:outputText value = "Localidad:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.localidad}" title = "Localidad" / >
< h:outputText value = "Calle:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.calle}" title = "Calle" / >
< h:outputText value = "Numero:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.numero}" title = "Numero" / >
< h:outputText value = "Cp:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.cp}" title = "Cp" / >
< h:outputText value = "Rol:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.rolId.rol}" title = "RolId" / >
< / h:panelGrid >
< / div >
< div style = "margin-top: 20px;" >
< p:commandButton action = "usuariosLista.xhtml" icon = "pi pi-times" ajax = "false" immediate = "true"
style="margin-left: 10px; background-color:red; border-color:red; float: right;" />
< p:commandButton action = "usuariosLista.xhtml" actionListener = "#{demoBeanUsuarios.eliminar()}"
ajax="false" icon="pi pi-check"
style=" background-color:green; border-color:green; float: right;"/>
< / div >
< / h:form >
< / p:dialog >
<!-- info''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->
< p:dialog id = "dialog3" widgetVar = "dlg3" width = "900" height = "500" modal = "true" >
< h:form >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; margin-bottom: 10px;" >
< h:outputText value = "D E T A L L E S" / > < / h3 >
< div >
< h:panelGrid id = "grid" columns = "4" style = "width: 100%" cellpadding = "10" >
< h:outputText value = "Id:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.id}" title = "Id" / >
< h:outputText value = "Genero:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.genero}" title = "Genero" / >
< h:outputText value = "Nombre:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.nombre}" title = "Nombre" / >
< h:outputText value = "Fecha de nacimiento:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.fechanacimiento}" title = "Fechanacimiento" >
< f:convertDateTime pattern = "MM/dd/yyyy" / >
< / h:outputText >
< h:outputText value = "Apellido Paterno:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.apellidop}" title = "Apellidop" / >
< h:outputText value = "Correo:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.correo}" title = "Correo" / >
< h:outputText value = "Apellido Materno:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.apellidom}" title = "Apellidom" / >
< h:outputText value = "Usuario:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.usuario}" title = "Usuario" / >
< h:outputText value = "Telefono:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.telefono}" title = "Telefono" / >
< h:outputText value = "Contraseña:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.contrasenia}" title = "Contrasenia" / >
< h:outputText value = "Pais:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.pais}" title = "Pais" / >
< h:outputText value = "Estado:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.estado}" title = "Estado" / >
< h:outputText value = "Municipio:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.municipio}" title = "Municipio" / >
< h:outputText value = "Localidad:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.localidad}" title = "Localidad" / >
< h:outputText value = "Calle:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.calle}" title = "Calle" / >
< h:outputText value = "Numero:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.numero}" title = "Numero" / >
< h:outputText value = "Cp:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.cp}" title = "Cp" / >
< h:outputText value = "Rol:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanUsuarios.usuarios.rolId.rol}" title = "RolId" / >
< / h:panelGrid >
< p:commandButton action = "usuariosLista.xhtml" icon = "pi pi-arrow-left" ajax = "false" style = "right:-790px" / >
< / div >
< / h:form >
< / p:dialog >
< / f:view >
< / ui:define >
< / ui:composition >
< / body >
< / html >