You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					150 lines
				
				9.9 KiB
			
		
		
			
		
	
	
					150 lines
				
				9.9 KiB
			| 
								 
											2 years ago
										 
									 | 
							
								<?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> R O L </H2></center>
							 | 
						||
| 
								 | 
							
								            </ui:define>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            <ui:define name="left">
							 | 
						||
| 
								 | 
							
								                <h:form>
							 | 
						||
| 
								 | 
							
								                  <p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px; "  >
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                         <p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false"  icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" />
							 | 
						||
| 
								 | 
							
								                        <p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/>
							 | 
						||
| 
								 | 
							
								                        <p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" />                   
							 | 
						||
| 
								 | 
							
								                        <p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" />          
							 | 
						||
| 
								 | 
							
								                        <p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/>
							 | 
						||
| 
								 | 
							
								                        <p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" />
							 | 
						||
| 
								 | 
							
								                        <p:menuitem action="rolLista.xhtml" value="Rol" ajax="false" icon="pi pi-sitemap" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" />
							 | 
						||
| 
								 | 
							
								                     </p:menu>  
							 | 
						||
| 
								 | 
							
								                </h:form>
							 | 
						||
| 
								 | 
							
								                
							 | 
						||
| 
								 | 
							
								            </ui:define>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            <ui:define name="content">
							 | 
						||
| 
								 | 
							
								                <f:view>
							 | 
						||
| 
								 | 
							
								                     <h:form id="formtabla">
							 | 
						||
| 
								 | 
							
								                        <p:growl id="grsowl" showDetail="true" />
							 | 
						||
| 
								 | 
							
								                       
							 | 
						||
| 
								 | 
							
								                        <p:dataTable id="tabla" value="#{demoBeanRol.all}" var="item" 
							 | 
						||
| 
								 | 
							
								                                     widgetVar="Rol" emptyMessage="No se han encontrado el usuario"
							 | 
						||
| 
								 | 
							
								                                     filteredValue="#{demoBeanRol.filteredCustomers3}"
							 | 
						||
| 
								 | 
							
								                                     globalFilterFunction="#{demoBeanRol.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="#{demoBeanRol.prepararNuevo()}"  
							 | 
						||
| 
								 | 
							
								                                                          update=":dialog" value="Nuevo" icon="pi pi-plus" />
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								                                       <i class="pi pi-search" style="margin-left: 765px; margin-top: 10px;"></i>
							 | 
						||
| 
								 | 
							
								                                       <p:inputText id="globalFilter" onkeyup="PF('rol').filter()" placeholder="Buscar rol" 
							 | 
						||
| 
								 | 
							
								                                                    style="width:300px; margin-left: 10px; float: right; margin-top: -40px;"/>
							 | 
						||
| 
								 | 
							
								                                        
							 | 
						||
| 
								 | 
							
								                                    </div>
							 | 
						||
| 
								 | 
							
								                                </div>
							 | 
						||
| 
								 | 
							
								                              </f:facet>
							 | 
						||
| 
								 | 
							
								                            
							 | 
						||
| 
								 | 
							
								                            <p:column styleClass="columnaId2">
							 | 
						||
| 
								 | 
							
								                                <f:facet name="header">
							 | 
						||
| 
								 | 
							
								                                    <h:outputText value="Id" style=" font-weight:bolder; float: left" />
							 | 
						||
| 
								 | 
							
								                                </f:facet>
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="#{item.id}"/>
							 | 
						||
| 
								 | 
							
								                            </p:column>
							 | 
						||
| 
								 | 
							
								                            <p:column>
							 | 
						||
| 
								 | 
							
								                                <f:facet name="header">
							 | 
						||
| 
								 | 
							
								                                    <h:outputText value="Rol" style=" font-weight:bolder; float: left" />
							 | 
						||
| 
								 | 
							
								                                </f:facet>
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="#{item.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="#{demoBeanRol.prepararEditar(item)}"  
							 | 
						||
| 
								 | 
							
								                                                 icon="pi pi-file-edit" update=":dialog" style="margin-right: 10px "/>
							 | 
						||
| 
								 | 
							
								                                
							 | 
						||
| 
								 | 
							
								                                <p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{demoBeanRol.prepararEliminar(item)}" 
							 | 
						||
| 
								 | 
							
								                                                 update=":dialog2" style="background-color: red; color:white; border-color: red; " icon="pi pi-trash" />
							 | 
						||
| 
								 | 
							
								                                
							 | 
						||
| 
								 | 
							
								                            </p:column>
							 | 
						||
| 
								 | 
							
								                            
							 | 
						||
| 
								 | 
							
								                        </p:dataTable>
							 | 
						||
| 
								 | 
							
								                    </h:form>
							 | 
						||
| 
								 | 
							
								                    
							 | 
						||
| 
								 | 
							
								                    
							 | 
						||
| 
								 | 
							
								                    <!-- crear/editar''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->
							 | 
						||
| 
								 | 
							
								                    
							 | 
						||
| 
								 | 
							
								                    <p:dialog id="dialog" widgetVar="dlg" width="600" height="150" modal="true" appendTo="@(body)" >
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								                        <h:form style="height: 600px;" class="form-container" >
							 | 
						||
| 
								 | 
							
								                            <p:growl id="growl" for="proveedorMsj" showDetail="true" />
							 | 
						||
| 
								 | 
							
								                            
							 | 
						||
| 
								 | 
							
								                        <h1 style="text-align: center; background-color: #ADD8E6; padding: 20px; color: #000; font-size: 2em; margin-bottom: 10px;">
							 | 
						||
| 
								 | 
							
								                               <h:outputText value="#{demoBeanRol.titulo}"/></h1>
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								                        <h:panelGrid id="grid" columns="3" style="width: 100%">
							 | 
						||
| 
								 | 
							
								                            
							 | 
						||
| 
								 | 
							
								                            <p:outputLabel value="Rol:" for="rol" style=" font-weight:bolder"/>
							 | 
						||
| 
								 | 
							
								                            <p:inputText id="rol" value="#{demoBeanRol.rol.rol}" title="Rol" required="true" requiredMessage="este campo es obligatorio" styleClass="formulario-elemento"/>
							 | 
						||
| 
								 | 
							
								                            <p:message for="rol"/>
							 | 
						||
| 
								 | 
							
								                         </h:panelGrid>
							 | 
						||
| 
								 | 
							
								                            
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								                            <p:commandButton action="#{demoBeanRol.agregar()}"  update="grid, formtabla:tabla, growl" rendered="#{demoBeanRol.nuevo}" ajax="false" icon="pi pi-check"
							 | 
						||
| 
								 | 
							
								                                             style="margin-right: 10px; margin-top: 10px;  background-color: green; color:white; border-color:green;" />  
							 | 
						||
| 
								 | 
							
								                            
							 | 
						||
| 
								 | 
							
								                            <p:commandButton action="#{demoBeanRol.editar()}" update="grid, formtabla:tabla, growl" ajax="true" rendered="#{!demoBeanRol.nuevo}" icon="pi pi-check" 
							 | 
						||
| 
								 | 
							
								                                             style="margin-right: 10px; margin-top: 10px;  background-color: green; color:white; border-color:green;"  />
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								                            <p:commandButton action="rolLista.xhtml"  immediate="true" ajax="false" icon="pi pi-times"  style="background-color: red; color:white; border-color: red; margin-right: 15px;"/>
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								                    </h:form>
							 | 
						||
| 
								 | 
							
								                    </p:dialog>
							 | 
						||
| 
								 | 
							
								                    
							 | 
						||
| 
								 | 
							
								                    <!-- elimininar -->
							 | 
						||
| 
								 | 
							
								                    
							 | 
						||
| 
								 | 
							
								                    <p:dialog id="dialog2" widgetVar="dlg2" width="600" height="150" modal="true" >
							 | 
						||
| 
								 | 
							
								                        <h:form>
							 | 
						||
| 
								 | 
							
								                            <h1 style="text-align: center; background-color: #ADD8E6; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="Eliminar"/></h1>
							 | 
						||
| 
								 | 
							
								                            <div>
							 | 
						||
| 
								 | 
							
								                              <h:panelGrid id="grid" columns="4" style="width: 100%;" cellpadding="20" >
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="Id:"/>
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="#{demoBeanRol.rol.id}" title="Id"/>
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="Rol:"/>
							 | 
						||
| 
								 | 
							
								                                <h:outputText value="#{demoBeanRol.rol.rol}" title="Rol"/>
							 | 
						||
| 
								 | 
							
								                            </h:panelGrid>  
							 | 
						||
| 
								 | 
							
								                            </div>
							 | 
						||
| 
								 | 
							
								                            <div style="margin-top: 20px;">
							 | 
						||
| 
								 | 
							
								                                <p:commandButton action="rolLista.xhtml" icon="pi pi-times" ajax="false" immediate="true"
							 | 
						||
| 
								 | 
							
								                                                 style="margin-left: 10px; background-color:red; border-color:red; float: right;" />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                                <p:commandButton  action="rolLista.xhtml" actionListener="#{demoBeanRol.eliminar()}" 
							 | 
						||
| 
								 | 
							
								                                                  ajax="false" icon="pi pi-check"
							 | 
						||
| 
								 | 
							
								                                                  style=" background-color:green; border-color:green; float: right;"/>
							 | 
						||
| 
								 | 
							
								                            </div>
							 | 
						||
| 
								 | 
							
								                        </h:form>
							 | 
						||
| 
								 | 
							
								                        
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                    </p:dialog>
							 | 
						||
| 
								 | 
							
								                </f:view>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            </ui:define>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        </ui:composition>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    </body>
							 | 
						||
| 
								 | 
							
								</html>
							 |