<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Lista Informes Citologicos</title>
	<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css">
  	<script src="../js/jquery.min.js"></script>
  	<script src="../bootstrap/js/bootstrap.min.js"></script>
  	<link href="../css/ionicons.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div class="table-responsive">
	<?php
	include_once('../php_conexion.php');
	include_once('../Class/funciones.php');
	if (!$conexion) {
	    die('Could not connect: ' . mysqli_error($con));
	}
	if (!empty($_GET['bus']) && !empty($_GET['tipobus'])) {
		$bus = $_GET['bus'];
		$tipobus = $_GET['tipobus'];
		$sql="SELECT * FROM paciente WHERE $tipobus LIKE '%".$bus."%'";
		$result = mysqli_query($conexion,$sql);
	}else{
		$fechahoy=date('Y-m-d');
		$sql="SELECT * FROM paciente WHERE fecha='$fechahoy'";
		$result = mysqli_query($conexion,$sql);
	}
		

		echo "<table class='table table-hover table-sm btn-table'>
		<tr class='bg-primary'>
		<th>ID PAC.</th>
		<th>NUM. DOC.</th>
		<th>NOMBRE Y APELLIDOS</th>
		<th>FECHA REGISTRO</th>
		<th>EDAD</th>
		<th>TELEFONO</th>
		<th>ACCIONES</th>
		</tr>";
		while($row = mysqli_fetch_array($result)) {
		    echo "<tr>";
		    echo "<td style='font-size: 18px; color: #FF0000; font-weight: bold;''>" . $row['idpaciente'] . "</td>";
		    echo "<td>" . $row['numdoc'] . "</td>";
		    echo "<td>" . $row['apepaterno'] ." ". $row['apematerno'] ." ". $row['nombre'] ."</td>";
		    echo "<td>" . $row['fecha'] . "</td>";
			echo "<td>" . calculaedad($row['fechanac']) . "</td>";
		    echo "<td>" . $row['telefono'] . "</td>";
		    echo "<td><button class='btn btn-secondary btn-sm active' type='button' aria-pressed='true' onclick='actualizarinfo(".$row['idpaciente'].");return false;'><span class='ion-edit'></span> Modificar</button></td>";
		    /*$idinfpac=buscainformepac($conexion,$row['idpaciente']);
		    if ($idinfpac!="") {
		    	echo "<a href='reportpdf/impresiontriaje.php?idinf=".$idinfpac."' class='btn btn-primary btn-sm active' role='button' aria-pressed='true' target='_blank'><span class='ion-printer'></span> Imprimir</a></td>";
		    }else{
		    	echo "<td></td>";
		    }*/
		    

		    echo "</tr>";
		}
		echo "</table>";
		mysqli_close($conexion);
	?>
	</div>
</body>
</html>