$msg = '<div class="error">There are one or more fields empty.</div>';
            break;
        case 'missdate':
            $msg = '<div class="error">Please provide a date of the leave.</div>';
            break;
        case 'success':
            $msg = '<div class="success">You have successfully updated the duty.</div>';
            break;
        case 'somethingwrong':
            $msg = '<div class="success">There is something wrong. Please try again.</div>';
            break;
        default:
            break;
    }
}
$drProf = getDocProf($did);
foreach ($drProf as $dp) {
    $firstname = $dp["firstname"];
    $middlename = $dp["middlename"];
    $lastname = $dp["lastname"];
    $title = $dp["title"];
    $specialty = $dp["specialization"];
    $contact = $dp["contact"];
    $address = $dp["address"];
    $duty = $dp["duty"];
    $professionalfee = $dp["professionalfee"];
}
?>
<!DOCTYPE HTML>
<head>
	<title>Dr. <?php 
        echo $cf["servicedept"];
        ?>
					</div>
					<div class="contentCell clinical-cont-ward">
						<?php 
        echo $cf["ward"];
        ?>
					</div>
					<div class="contentCell clinical-cont-serdeptatt">
						<?php 
        echo $cf["servicedept2"];
        ?>
					</div>
					<div class="contentCell clinical-cont-attphys">
						<?php 
        $doctor = getDocProf($cf["did"]);
        foreach ($doctor as $d) {
            $docname = $docname = "Dr. " . $d["firstname"] . " " . $d["lastname"] . ", " . $d["title"];
        }
        echo $docname;
        ?>
					</div>
				</div>
			</div>
			<div class="sheet-holder">
				<div class="clinical-row">
					<div class="titleCell clinical-header-addiagnosis">Admitting Diagnosis</div>
					<div class="titleCell clinical-header-disposition">Disposition:</div>
				</div>
				<div class="clinical-row">
					<div class="contentCell clinical-cont-addiagnosis">
                ?>
</div>
				<div class="roomHolder">
					<?php 
                $bed = getBedPt($pt["rid"], $pt["pid"]);
                if (empty($bed)) {
                    echo 'The patient still waiting for a bed to occupy.';
                } else {
                    foreach ($bed as $bd) {
                        echo $bd["bednumber"];
                    }
                }
                ?>
				</div>
		<?php 
                $drName = getDocProf($did);
                if (empty($drName)) {
                    ?>
				<div class="drHolder">Still waiting for a doctor</div>
		<?php 
                } else {
                    foreach ($drName as $dr) {
                        ?>
				<div class="drHolder">Dr. <?php 
                        echo $dr["firstname"];
                        ?>
 <?php 
                        echo $dr["lastname"];
                        ?>
, <?php 
                        echo $dr["title"];
				<div class="hxRowLong">
					<div class="titleCell hx-title-rec">16. Admitting Impression</div>
				</div>
				<div class="hxRowLong">
					<div class="contentCell hx-cont-rec"><?php 
        echo $hx["impression"];
        ?>
</div>
				</div>
				<div class="hxRowLong">
					<div class="titleCell hx-title-rec">Doctor Observed:</div>
				</div>
				<div class="hxRowLong">
					<div class="contentCell hx-cont-rec">
					<?php 
        $drName = getDocProf($hx["doctor"]);
        if (empty($drName)) {
            echo 'Still waiting for a doctor';
        } else {
            foreach ($drName as $dr) {
                echo 'Dr.' . $dr["firstname"] . ' ' . $dr["lastname"] . ', ' . $dr["title"];
            }
        }
        ?>
					</div>
				</div>
				<div class="hxRowLong">
					<div class="contentCell hx-cont-rec" style="text-align: right;">
						<input type="button" id="showHxPhy" name="showHxPhy" class="bluebutton" value="Update Patient's History and Physical Examination"/>
					</div>
				</div>