From: Agnibho Mondal Date: Mon, 21 Jun 2021 18:19:07 +0000 (+0530) Subject: Bugfix X-Git-Url: https://code.agnibho.com/repo?p=simpleipd.git;a=commitdiff_plain;h=HEAD Bugfix --- diff --git a/www/index.php b/www/index.php index 16844b2..a41f5c2 100644 --- a/www/index.php +++ b/www/index.php @@ -5,55 +5,59 @@ if(!empty($_POST["req"])){ } $list=$db->getAdmittedPatientList(); $showList=""; -while($arr=$list->fetchArray()){ - $pid=$arr["pid"]; - $showList=$showList."".$pid."".$arr["ward"]."-".$arr["bed"]."".$arr["name"]."".$arr["diagnosis"].""; +if($list){ + while($arr=$list->fetchArray()){ + $pid=$arr["pid"]; + $showList=$showList."".$pid."".$arr["ward"]."-".$arr["bed"]."".$arr["name"]."".$arr["diagnosis"].""; + } } $reqs=$db->getRequisitionList(); $showReqs=""; -while($arr=$reqs->fetchArray()){ - $pid=$arr["pid"]; - if(!empty($arr["form"])){ - if($arr["form"]=="report-cs"){ - $test="".$arr["test"].""; - if(checkAccess("report")=="all"){ - $toReport="Add Report"; +if($reqs){ + while($arr=$reqs->fetchArray()){ + $pid=$arr["pid"]; + if(!empty($arr["form"])){ + if($arr["form"]=="report-cs"){ + $test="".$arr["test"].""; + if(checkAccess("report")=="all"){ + $toReport="Add Report"; + } + else{ + $toReport=""; + } } else{ - $toReport=""; + $test="".$arr["test"].""; + if(checkAccess("report")=="all"){ + $toReport="Add Report"; + $toReport="Add Report"; + } + else{ + $toReport=""; + } } } else{ - $test="".$arr["test"].""; + $test="".$arr["test"].""; if(checkAccess("report")=="all"){ - $toReport="Add Report"; - $toReport="Add Report"; + $toReport="Add Report"; } else{ $toReport=""; } } - } - else{ - $test="".$arr["test"].""; - if(checkAccess("report")=="all"){ - $toReport="Add Report"; + if($arr["status"]=="received"){ + $received="Sample Received"; + } + elseif(checkAccess("report")=="all"){ + $received=""; } else{ - $toReport=""; + $received="Sample Not Received"; } + + $showReqs=$showReqs."".$test."".$arr["sample"]."".$arr["room"]."".date("M j", $arr["time"])."".$pid." (".$db->getWard($pid)->fetchArray()["ward"]."-".$db->getBed($pid)->fetchArray()["bed"].")".$arr["addl"]."".$received."".$toReport.""; } - if($arr["status"]=="received"){ - $received="Sample Received"; - } - elseif(checkAccess("report")=="all"){ - $received=""; - } - else{ - $received="Sample Not Received"; - } - - $showReqs=$showReqs."".$test."".$arr["sample"]."".$arr["room"]."".date("M j", $arr["time"])."".$pid." (".$db->getWard($pid)->fetchArray()["ward"]."-".$db->getBed($pid)->fetchArray()["bed"].")".$arr["addl"]."".$received."".$toReport.""; } ?>