<?php
/**
 * Created by PhpStorm.
 * User: sunusi
 * Date: 2019-01-25
 * Time: 03:07
 */


if (isset($URL[1])) {
    if (!empty($URL[1])) {
        $patientId = $URL[1];
        //detecting patient details
        $patient = $conn->query("
          SELECT udut_patients.*,
                 udut_patients_types.*
          FROM udut_patients 
          JOIN udut_patients_types
          ON udut_patients.patientTypeId = udut_patients_types.patientTypeId
          WHERE udut_patients.patientId = '${patientId}' 
        ")->fetch_assoc() or die("Problem fetching patient details. ".$conn->error);
    } else {
        require path() . "home";
    }
}


