<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Lista Tipo Muestra</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');
		$fechahoy=date('Y-m-d');
		if (!$conexion) {
		    die('Could not connect: ' . mysqli_error($con));
		}

		//$sql="SELECT * FROM paciente_caja WHERE fecha='$fechahoy'";
		$sql="SELECT * FROM paciente_caja";
		$result = mysqli_query($conexion,$sql);

		echo "<table class='table table-hover table-sm btn-table'>
		<tr class='bg-primary'>
		<th>Cod. Pac.</th>
		<th>Paciente</th>
		<th>Muestra</th>
		<th>Fecha</th>
		<th>Precio</th>
		<th>importe</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['codpaciente'] . "</td>";
		    echo "<td>" . $row['nombres'] ." ". $row['apepaterno'] ." ". $row['apematerno'] . "</td>";
		    echo "<td>" . $row['muestra'] . "</td>";
		    echo "<td>" . $row['fecha'] . "</td>";
		    echo "<td> S/. " . sprintf("%01.2f",$row['precioexamen']) . "</td>";
		    echo "<td> S/. " . sprintf("%01.2f",$row['importe']) . "</td>";
		    echo "<td><button class='btn btn-secondary btn-sm active' type='button' onclick='actualizarcaja(".$row['id'].");return false;'><span class='ion-edit'></span> Modificar</button></td>";
		    /*echo "<td><button class='btn btn-secondary btn-sm active' type='button' onclick='actualizarmuestra(".$row['id'].");return false;'><span class='ion-edit'></span> Modificar</button></td>";*/
		    echo "</tr>";
		}
		echo "</table>";
	?>
	</div>
	<?php mysqli_close($conexion); ?>
</body>
</html>