Location: PHPKode > projects > Clinical Handover Database > output/Nursing_Handover_view.php
<?php 
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
set_magic_quotes_runtime(0);

include("include/dbcommon.php");
include("include/Nursing_Handover_variables.php");


//	check if logged in
if(!@$_SESSION["UserID"] || !CheckSecurity(@$_SESSION["OwnerID"],"Search"))
{ 
	$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
	header("Location: login.php?message=expired"); 
	return;
}

$filename="";	
$message="";

//connect database
$conn = db_connect();

$keys=array();
$keys["Primary"]=postvalue("editid1");

//	get current values and show edit controls

$strSQL=$gstrSQL;
$where = KeyWhere($keys);
$strSQL = AddWhere($strSQL,$where);



LogInfo($strSQL);
$rs=db_query($strSQL,$conn);
$data=db_fetch_array($rs);


include('libs/Smarty.class.php');
$smarty = new Smarty();

	$smarty->assign("show_key1", htmlspecialchars(GetData($data,"Primary", "")));

$keylink="";
$keylink.="&key1=".htmlspecialchars(urlencode($data["Primary"]));

////////////////////////////////////////////
//	Ward - 
	$value="";
		if(strlen($data["Ward"]))
	{
		$strdata = make_db_value("Ward",$data["Ward"]);
		$LookupSQL="SELECT ";
					$LookupSQL.="`Ward`";
		$LookupSQL.=" FROM `ward list` WHERE `Ward` = " . $strdata;
					LogInfo($LookupSQL);
		$rsLookup = db_query($LookupSQL,$conn);
		if($lookuprow=db_fetch_numarray($rsLookup))
			$value=ProcessLargeText($lookuprow[0],"","",MODE_VIEW);
		else
			$value=ProcessLargeText(GetData($data,"Ward", ""),"field=Ward".$keylink,MODE_VIEW);
	}
	else
		$value="";
	$smarty->assign("show_Ward",$value);
////////////////////////////////////////////
//	Bed - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Bed", ""));
	$smarty->assign("show_Bed",$value);
////////////////////////////////////////////
//	Patient Name - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Patient Name", ""));
	$smarty->assign("show_Patient_Name",$value);
////////////////////////////////////////////
//	Date of Birth - Short Date
	$value="";
		$value = htmlspecialchars(GetData($data,"Date of Birth", "Short Date"));
	$smarty->assign("show_Date_of_Birth",$value);
////////////////////////////////////////////
//	Unit Number - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Unit Number", ""));
	$smarty->assign("show_Unit_Number",$value);
////////////////////////////////////////////
//	Sex - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Sex", ""));
	$smarty->assign("show_Sex",$value);
////////////////////////////////////////////
//	Consultant - 
	$value="";
		if(strlen($data["Consultant"]))
	{
		$strdata = make_db_value("Consultant",$data["Consultant"]);
		$LookupSQL="SELECT ";
					$LookupSQL.="`Consultant`";
		$LookupSQL.=" FROM `consultants` WHERE `Consultant` = " . $strdata;
					LogInfo($LookupSQL);
		$rsLookup = db_query($LookupSQL,$conn);
		if($lookuprow=db_fetch_numarray($rsLookup))
			$value=ProcessLargeText($lookuprow[0],"","",MODE_VIEW);
		else
			$value=ProcessLargeText(GetData($data,"Consultant", ""),"field=Consultant".$keylink,MODE_VIEW);
	}
	else
		$value="";
	$smarty->assign("show_Consultant",$value);
////////////////////////////////////////////
//	Code - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Code", ""));
	$smarty->assign("show_Code",$value);
////////////////////////////////////////////
//	Diagnosis - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Diagnosis", ""));
	$smarty->assign("show_Diagnosis",$value);
////////////////////////////////////////////
//	Allergies - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Allergies", ""));
	$smarty->assign("show_Allergies",$value);
////////////////////////////////////////////
//	Nurses - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Nurses", ""));
	$smarty->assign("show_Nurses",$value);
////////////////////////////////////////////
//	Social Services - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Social Services", ""));
	$smarty->assign("show_Social_Services",$value);
////////////////////////////////////////////
//	Team - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Team", ""));
	$smarty->assign("show_Team",$value);
////////////////////////////////////////////
//	Notes - 
	$value="";
		$value = htmlspecialchars(GetData($data,"Notes", ""));
	$smarty->assign("show_Notes",$value);

$smarty->display("Nursing_Handover_view.htm");

?>
Return current item: Clinical Handover Database