diff --git a/src/database.php b/src/database.php index b77caad..7a25403 100644 --- a/src/database.php +++ b/src/database.php @@ -319,7 +319,9 @@ function fetchPatients($pdo) function fetchReportData($pdo, string $id) { - $query = "SELECT * FROM informe WHERE id=?"; + $query = "SELECT informe.id, titulo, fecha, hora, paciente , contenido, usuario FROM informe + INNER JOIN usuario ON informe.medico = usuario.id + WHERE informe.id=?"; $result = $pdo->prepare($query); $result->execute([$id]); $data = $result->fetch(); diff --git a/src/print_html.js b/src/print_html.js new file mode 100644 index 0000000..4fe8ac7 --- /dev/null +++ b/src/print_html.js @@ -0,0 +1,15 @@ +function printExternal(url) { + var printWindow = window.open(url, 'Print', 'left=200, top=200, width=950, height=500, toolbar=0, resizable=0'); + + printWindow.addEventListener('load', function() { + if (Boolean(printWindow.chrome)) { + printWindow.print(); + setTimeout(function(){ + printWindow.close(); + }, 500); + } else { + printWindow.print(); + printWindow.close(); + } + }, true); +} diff --git a/src/report.php b/src/report.php index 321c95e..505b05f 100644 --- a/src/report.php +++ b/src/report.php @@ -7,6 +7,7 @@ +
@@ -25,14 +26,13 @@Titulo | +Fecha | +Hora | +Paciente | +Contenido | +Médico | +
---|---|---|---|---|---|
+ | + | + | + | + | + |