-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.php
73 lines (52 loc) · 1.91 KB
/
report.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/*$bloodPressure = $_POST['bloodPressure'];
$bloodSugar = $_POST['bloodSugar'];
$heartRate = $_POST['heartRate'];
$other = $_POST['other'];
$summary = $_POST['summary'];
$prescription = $_POST['prescription'];*/
require 'E:\xampp\htdocs\genius_doctors_record\genius_doctors_record\fpdf.php';
include ("Utilities/JSUtil.php");
include_once ("Utilities/SessionManager.php");
if(isset($_POST['report']))
{
try
{
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial","B",12);
// Connect to database
$conn= mysqli_connect("localhost", "root", "", "doctors_db");
$idNum = $_SESSION['id'];
$query = mysqli_query($conn,"SELECT * from patient_medical_record WHERE idNum=$idNum");
while($data=mysqli_fetch_array($query))
{
$pdf->Cell(0,10,"Patient file",1,1,"C");
$pdf->Cell(50,10,"Blood Pressure ",1,0);
$pdf->Cell(0,10,$data['blood_pressure'],1,1);
$pdf->Cell(50,10,"Blood Sugar ",1,0);
$pdf->Cell(0,10,$data['blood_sugar'],1,1);
$pdf->Cell(50,10,"Heart Rate ",1,0);
$pdf->Cell(0,10, $data['ht_rate'] ,1,1);
$pdf->Cell(50,10,"Other ",1,0);
$pdf->Cell(0,10, $data['other'],1,1);
$pdf->Cell(50,10,"Summary ",1,0);
$pdf->Cell(0,10, $data['summary'] ,1,1);
$pdf->Cell(50,10,"Prescription ",1,0);
$pdf->Cell(0,10, $data['prescription'] ,1,1);
$pdf->Cell(50,10,"ID Number ",1,0);
$pdf->Cell(0,10, $data['idNum'] ,1,1);
$pdf->Output();
}
}
catch(Exception $ex)
{
alert($ex->getMessage());
}
finally
{
// Close database
mysqli_close($conn);
}
}
?>