<div class="bs-component main-pagination" ng-controller="usuarioCrtl">
	<div class="row">
		<div class="col-md-4">
			<form class="form-inline">
				<div class="form-group">
					<label >Buscar</label>
					<input type="text" ng-model="search" class="form-control" placeholder="Buscar">
				</div>
			</form>
		</div>
		<div class="col-md-8">
			<p>Total de Usuarios registrados : <strong>{{totalItems}}</strong></p>
		</div>
	</div>
	<table class="table table-striped table-hover">
		<thead>
			<tr>
				<?php if (SUPERADMIN >= $this->session->userdata('rol')){ ?>
				<th colspan="2">
					<span></span>
				</th>
				<?php } ?>
				<th ng-click="sort('documento')"><i class="fas fa-sort"></i> Documento
					<span class="fas fa-sort" ng-show="sortKey=='documento'" ng-class="{'fas fa-sort-amount-up':reverse,'fas fa-sort-amount-down':!reverse}"></span>
				</th>
				<th ng-click="sort('nombre')"><i class="fas fa-sort"></i> Nombre
					<span class="fas fa-sort" ng-show="sortKey=='nombre'" ng-class="{'fas fa-sort-amount-up':reverse,'fas fa-sort-amount-down':!reverse}"></span>
				</th>
				<th ng-click="sort('apellido')"><i class="fas fa-sort"></i> Apellido
					<span class="fas fa-sort" ng-show="sortKey=='apellido'" ng-class="{'fas fa-sort-amount-up':reverse,'fas fa-sort-amount-down':!reverse}"></span>
				</th>
				<th ng-click="sort('rol')"><i class="fas fa-sort"></i> Rol
					<span class="fas fa-sort" ng-show="sortKey=='rol'" ng-class="{'fas fa-sort-amount-up':reverse,'fas fa-sort-amount-down':!reverse}"></span>
				</th>
				<th ng-click="sort('estado')"><i class="fas fa-sort"></i> Estado
					<span class="fas fa-sort" ng-show="sortKey=='estado'" ng-class="{'fas fa-sort-amount-up':reverse,'fas fa-sort-amount-down':!reverse}"></span>
				</th>
			</tr>
		</thead>
		<tbody>
			<tr dir-paginate="usuario in usuarios|orderBy:sortKey:reverse|filter:search|itemsPerPage:15">
				<?php if (SUPERADMIN >= $this->session->userdata('rol')){ ?>
					<td class="acciones"><a class="a-edit" title="Editar" href="<?php echo base_url('usuario/edit')."/" ?>{{usuario.id}}"><i class="fas fa-edit"></i></a></td>
				<td class="acciones"><a class="a-del" title="Eliminar" ng-click="deleteUsuario(usuario.id)"><i class="fas fa-eraser c-del"></i></a></td>

			<?php } ?>
				<td>{{usuario.documento}}</td>
				<td>{{usuario.nombre}}</td>
				<td>{{usuario.apellido}}</td>
				<td>{{usuario.rol}}</td>
				<td>{{usuario.estado == 1 ? 'Activo' : 'Inactivo'}}</td>
			</tr>
		</tbody>
	</table>
	<dir-pagination-controls
		max-size="5"
		direction-links="true"
		boundary-links="true" >
	</dir-pagination-controls>
</div>
