Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Hospital Name instead of ID #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pages/dataOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include("../templates/db-connect.php");

$sql = "SELECT * FROM pd_pairs ORDER BY pair_id";
$sql = "SELECT pd_pairs.*, hospitals.name as hosp_name FROM pd_pairs LEFT JOIN hospitals on pd_pairs.hosp_id = hospitals.id ORDER BY pair_id";
$result = mysqli_query($conn, $sql);
$result_array = mysqli_fetch_all($result, MYSQLI_ASSOC);
mysqli_free_result($result);
Expand Down Expand Up @@ -33,7 +33,7 @@
<th>Pair ID</th>
<th>Patient ID</th>
<th>Donor ID</th>
<th>Hosp ID</th>
<th>Hospital Name</th>
<th>Status</th>
<th>Edit</th>
<th>Delete</th>
Expand All @@ -49,7 +49,7 @@
<td><?php echo $row['pair_id'] ?></td>
<td><?php echo $row['patient_id'] ?></td>
<td><?php echo $row['donor_id'] ?></td>
<td><?php echo $row['hosp_id'] ?></td>
<td><?php echo $row['hosp_name'] ?></td>
<td>
<a href="../include/toggleStatus.inc.php?pair_id=<?php echo $row['pair_id']?>&hosp_id=<?php echo $row['hosp_id']?>" class="checkDisable button success confirmStatus"><?php echo $row['status'] ?></a>
</td>
Expand Down
4 changes: 3 additions & 1 deletion pages/pairData.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
exit();
}

$hData = getHospitalById($conn, $pData['hospital']);

//calculate BMI and Date
$pBMI = bmiVal($pData['height'], $pData['weight']);
$pCreated = formatDate($pData['created_at']);
Expand Down Expand Up @@ -240,7 +242,7 @@
</tr>
<tr>
<th>Hospital</th>
<td><?php echo $pData['hospital']; ?></td>
<td><?php echo $hData['name']; ?></td>
</tr>
<tr>
<th>Provisional Clearance</th>
Expand Down