Location: PHPKode > projects > Clinical Handover Database > output/include/patients_masterlist.php
<?php

function DisplayMasterTableInfo($detailtable, $keys)
{
	global $conn,$strTableName,$smarty;
	
	$oldTableName=$strTableName;
	$strTableName="patients";

$strSQL = "select `Primary`, 
`Patient Name`, 
`Date of Birth`, 
`Unit Number`, 
`Sex`, 
`Ward`, 
`Bed`, 
`Consultant`, 
`Code`, 
`Category`, 
`Admission Date`, 
`Diagnosis`, 
`Allergies`, 
`Notes`, 
`Nurses`, 
`Social Services`, 
`Team`, 
`Ward Round Notes` 
From `patients`";
$where="";

if($detailtable=="jobs")
{
		$where.= GetFullFieldName("Patient Name")."=".make_db_value("Patient Name",$keys[1-1]);
}
if(!$where)
{
	$strTableName=$oldTableName;
	return;
}

	$strSQL=AddWhere($strSQL,$where);
	LogInfo($strSQL);
	$rs=db_query($strSQL,$conn);
	$data=db_fetch_array($rs);
	$keylink="";
	$keylink.="&key1=".htmlspecialchars(urlencode($data["Primary"]));
	

//	Patient Name - 
			$value="";
				$value = ProcessLargeText(GetData($data,"Patient Name", ""),"field=Patient+Name".$keylink);
			$smarty->assign("showmaster_Patient_Name",$value);

//	Date of Birth - Short Date
			$value="";
				$value = ProcessLargeText(GetData($data,"Date of Birth", "Short Date"),"field=Date+of+Birth".$keylink);
			$smarty->assign("showmaster_Date_of_Birth",$value);

//	Unit Number - 
			$value="";
				$value = ProcessLargeText(GetData($data,"Unit Number", ""),"field=Unit+Number".$keylink);
			$smarty->assign("showmaster_Unit_Number",$value);

//	Sex - 
			$value="";
				$value = ProcessLargeText(GetData($data,"Sex", ""),"field=Sex".$keylink);
			$smarty->assign("showmaster_Sex",$value);

//	Ward - 
			$value="";
				$value = ProcessLargeText(GetData($data,"Ward", ""),"field=Ward".$keylink);
			$smarty->assign("showmaster_Ward",$value);

//	Bed - 
			$value="";
				$value = ProcessLargeText(GetData($data,"Bed", ""),"field=Bed".$keylink);
			$smarty->assign("showmaster_Bed",$value);

//	Consultant - 
			$value="";
				$value = ProcessLargeText(GetData($data,"Consultant", ""),"field=Consultant".$keylink);
			$smarty->assign("showmaster_Consultant",$value);
	$strTableName=$oldTableName;
}
?>
Return current item: Clinical Handover Database