From b1ee604f821ff6a58454e09353544a11df5d512b Mon Sep 17 00:00:00 2001 From: Joseph Date: Wed, 17 Feb 2021 21:00:46 +0300 Subject: [PATCH] Show Hospital Name instead of ID --- pages/dataOverview.php | 6 +++--- pages/pairData.php | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/dataOverview.php b/pages/dataOverview.php index 095ca67..b8033bd 100644 --- a/pages/dataOverview.php +++ b/pages/dataOverview.php @@ -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); @@ -33,7 +33,7 @@ Pair ID Patient ID Donor ID - Hosp ID + Hospital Name Status Edit Delete @@ -49,7 +49,7 @@ - + diff --git a/pages/pairData.php b/pages/pairData.php index cc2ba1b..38b57aa 100644 --- a/pages/pairData.php +++ b/pages/pairData.php @@ -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']); @@ -240,7 +242,7 @@ Hospital - + Provisional Clearance