<?php

$resul = new Usuario;
$resul=$resul->mostrar();

foreach ($resul as $fila) {
	?>
	<tr>
		<td><?php print $fila['id_user']; ?></td>
		<td><?php print $fila['nom_per']." ".$fila['primerAp_per']." ".$fila['segundoAp_per']; ?></td>
		<td><?php print $fila['numDoc_per']; ?></td>
		<td><?php print $fila['correo_per']; ?></td>
		<td align="center">
		<?php 
		if($fila['tipo_user']=='ADMINISTRADOR'){
			?>
			<form action="" method="POST">
				<input type="hidden" name="id_user" value="<?php print $fila['id_user']; ?>">
				<input type="hidden" name="tipo_user" value="AUX"> 
				<button type="submit" name="tipoUser" class="btn btn-success btn-sm">USUARIO ADMINISTRADOR</button>
			</form>
			<?php
		}else{
			?>
			<form action="" method="POST">
				<input type="hidden" name="id_user" value="<?php print $fila['id_user']; ?>">
				<input type="hidden" name="tipo_user" value="ADMINISTRADOR"> 
				<button type="submit" name="tipoUser" class="btn btn-info btn-sm">USUARIO AUXILIAR</button>
			</form>
			<?php 
		}
		?>
		</td>
		<td align="right">
		<?php 
		if($fila['estado_user']=='ACTIVO'){
			?>
			<form action="" method="POST">
				<input type="hidden" name="id_user" value="<?php print $fila['id_user']; ?>">
				<input type="hidden" name="estado_user" value="PASIVO"> 
				<button type="submit" name="estadoUser" class="btn btn-primary btn-sm">ACTIVO</button>
			</form>
			<?php 
		}else{
			?>
			<form action="" method="POST">
				<input type="hidden" name="id_user" value="<?php print $fila['id_user']; ?>">
				<input type="hidden" name="estado_user" value="ACTIVO"> 
				<button type="submit" name="estadoUser" class="btn btn-danger btn-sm">PASIVO</button>
			</form>
			<?php
		}
		?>
		</td>
		
		<!--<td>
			<form action="" method="POST">
				<button type="submit" class="btn btn-outline-primary btn-sm"><i class="fas far fa-edit"></i></button>
			</form>
		</td> -->
	</tr>
	<?php 
}




?>