editNursing($_POST, $pid, $_GET["id"]); } else{ $db->addNursing($_POST, $pid); } header("Location: view.php?pid=".$_GET["pid"]); exit(); } $all=$db->getAllData($pid, "nursing"); $io=""; $lastIO=""; while($io=="" && $a=$all->fetchArray()){ $d=json_decode($a["data"]); $io=$d->intake.$d->output; $lastIO=$d->io_to; } if($lastIO==""){ $d=$db->getAdmission($pid)->fetchArray(); $dt=new DateTime(); $dt->setTimestamp($d["admission"]); $lastIO=$dt->format("H:i"); } if(isSet($_GET["id"])){ $form=schema2form("forms/nursing.schema.json", $pid, $_GET["id"], "nursing"); } else{ $form=schema2form("forms/nursing.schema.json"); } } ?> Nursing Notes
>