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 @@ Hora Paciente Médico - Acciones + Acciones Borrar + + + + + PDF + diff --git a/src/report_content.php b/src/report_content.php new file mode 100644 index 0000000..0f6dc77 --- /dev/null +++ b/src/report_content.php @@ -0,0 +1,38 @@ + + + + + Gestión de informes + + + + + + + + + + + + + + + + + + + + + + + + + + +
TituloFechaHoraPacienteContenidoMédico
+ diff --git a/src/report_create_form.php b/src/report_create_form.php index dd94622..0ebd7c2 100644 --- a/src/report_create_form.php +++ b/src/report_create_form.php @@ -14,8 +14,8 @@ include 'database.php'; $pdo = connectDatabase(); - $doctors = listDoctors($pdo); $patients = fetchPatients($pdo); + $user = finduser($pdo, $_SESSION["user"]); ?>
@@ -38,14 +38,6 @@
-
- -
@@ -53,7 +45,7 @@
- + diff --git a/src/report_management.php b/src/report_management.php index dd263d4..f8feae5 100644 --- a/src/report_management.php +++ b/src/report_management.php @@ -1,6 +1,7 @@