<!DOCTYPE html>
<html lang="es">
<head>
	<title>Formulario</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
	<body>
		<header>

		</header>

		<div class="space">
		</div>
			<div class="container">
				<div class="row">
					<div class="col">
						<form action="conexion/validar.php" method="post">
							<div class="form-group">
								<label>Nombre</label>
								<input type="text" class="form-control"  name="nombre" placeholder="Ingresa tu nombre">
							</div>
							<div class="form-group">
							    <label>Apellido</label>
							    <input type="text" class="form-control"  name="apellido" placeholder="Ingresa tu apellido">
							</div>
							<div class="form-group">
							    <label >Tipo documento</label>
							    <select class="form-control" name="t_documento" >
							      <option value="C.C">C.C</option>
							      <option value="T.identidad">T.identidad</option>
							      <option value="C.E">C.E</option>
							      <option value="Pasaporte">Pasaporte</option>
							    </select>
							</div>
							<div class="form-group">
							    <label>Documento</label>
							    <input type="number" class="form-control"  name="documento" placeholder="Ingresa tu Documento">
							</div>
							<div class="form-group">
							    <label>Direccion</label>
							    <input type="text" class="form-control"  name="direccion" placeholder="Ingresa tu Direccion">
							</div>
							<div class="form-group">
							    <label>Telefono</label>
							    <input type="number" class="form-control"  name="telefono" placeholder="Ingresa tu Telefono">
							</div>
							<div class="form-group">
								<button type="submit" class="btn btn-success boton">Agregar</button>
							</div>
						</form><!--form-->
					</div><!--col
					<div class="col">-->
					
						<?php

							include'conexion/conexion.php';

							$sql = "SELECT * FROM datos";

							$ejecutar = mysqli_query($conectar,$sql);

							echo"<table class='table'>";
							echo "<thead class='thead-dark'";
							echo "<tr>";
							echo "<th>ID</th>";
							echo "<th>Nombre</th>";
							echo "<th>Apellido</th>";
							echo "<th>Tipo documento</th>";
							echo "<th>Documento</th>";
							echo "<th>Dirección</th>";
							echo "<th>Telefono</th>";
							echo "</tr>";
						?>	

						<?php 

							while ($arreglo = mysqli_fetch_array($ejecutar)) {

							echo"<tbody>";
							echo "<td>$arreglo[0]</td>";
							echo "<td>$arreglo[1]</td>";
							echo "<td>$arreglo[2]</td>";
							echo "<td>$arreglo[3]</td>";
							echo "<td>$arreglo[4]</td>";
							echo "<td>$arreglo[5]</td>";
							echo "<td>$arreglo[6]</td>";

							echo"</tbody>";
							
							}

						?>
					<!--</div>col-->
				</div><!--row-->
			</div><!--container-->

		<footer>
			
		</footer>
	</body>
</html>