<?php
	// include Database connection file 
	include("db_connection.php");

	// Design initial table header 
	$clinica=$_GET['clinica'];;
	$id_pac=$_GET['id_pac'];;
	
	$query = "SELECT * FROM tabla1 WHERE id_pac LIKE '$id_pac'";

	if (!$result = mysqli_query($con, $query)) {
        exit(mysqli_error($con));
    }
	$row = mysqli_fetch_assoc($result);
	
	echo "<h3>".$row['paciente']." ".$row['nombre']."</h3><p>";
	$data = '<table class="table table-bordered table-striped" id="myTable">
		<tr onclick="GetUserDetails('.$row['id_pac'].')">
			<th style="max-width:30px;">Apellido</th>
			<td>'.$row['paciente'].'</td>
		</tr>		
		<tr onclick="GetUserDetails('.$row['id_pac'].')">
			<th style="max-width:30px;">Nombre</th>
			<td><p onclick="GetUserDetails('.$row['id_pac'].')">'.$row['nombre'].'</p></td>
		</tr>
		<tr onclick="GetUserDetails('.$row['id_pac'].')">		
			<th style="max-width:30px;">DNI</th>
			<td>'.$row['dni'].'</td>
		</tr>		
		<tr onclick="GetUserDetails('.$row['id_pac'].')">
			<th style="max-width:30px;">Email</th>
			<td>'.$row['email'].'</td>
		</tr>
		<tr onclick="GetUserDetails('.$row['id_pac'].')">
			<th style="max-width:30px;">Profesional</th>
			<td>'.$row['usuario'].'</td>
		</tr>
		<tr onclick="GetUserDetails('.$row['id_pac'].')">
			<th style="max-width:30px;"></th>
			<td></td>
		</tr>
		<tr>
			<th style="max-width:30px;"><font color:red>Borrar</font></th>
			<td><button onclick="DeleteUser('.$row['id_pac'].')" class="btn btn-danger">Borrar</button></td>
		</tr>		
			
	</tabla>';
		
	echo $data;
?>

