]>
Softwares of Agnibho - simpleipd.git/blob - www/discharge.php
2 require(dirname(__DIR__
)."/require.php");
3 if(!empty($_GET["pid"])){
5 if(!empty($_POST["discharge"]) && $_POST["discharge"]=="discharge"){
6 $db->setDischarged($pid);
7 header("Location: view.php?pid=".$_GET["pid"]);
10 if(!empty($_POST["delete"])){
11 $db->deleteAdvice($_POST["delete"]);
13 elseif(!empty($_POST["drug"])){
14 $db->addAdvice($pid, $_POST["drug"], $_POST["dose"], $_POST["route"], $_POST["frequency"], $_POST["duration"], $_POST["extra_note"]);
16 $list=$db->getDischargeAdvice($pid);
17 $view="<form method='post' id='delete'></form>";
18 $view=$view."<table class='table'>";
19 $view=$view."<tr><th>Drug</th><th>Dose</th><th>Route</th><th>Frequency</th><th>Duration</th><th>Note</th></tr>";
20 while($drug=$list->fetchArray()){
21 $view=$view."<tr><td>".$drug["drug"]."</td><td>".$drug["dose"]."</td><td>".$drug["route"]."</td><td>".$drug["frequency"]."</td><td>".$drug["duration"]."</td><td>".$drug["addl"]."</td><td><button class='btn btn-warning' name='delete' value='".$drug["rowid"]."' form='delete'>Delete</button></td></tr>";
23 $view=$view."</table>";
24 $form=schema2form("forms/drugs.schema.json");
30 <?php
include(CONFIG_LIB
."head.php");?
>
31 <title
>Discharge Notes
</title
>
34 <div
class="container">
35 <?php
include(CONFIG_LIB
."top.php");?
>
36 <?php
echo getInfo($pid);?
>
37 <div
class="card mb-4">
38 <div
class="card-body">
39 <h4
class="card-title">Medicine
List</h4
>
43 <div
<?php
echo checkAccess("discharge", "form");?
>>
46 <form method
="post" class="mt-4" <?php
echo checkAccess("discharge", "form");?
>>
47 <input type
="hidden" name
="discharge" value
="discharge">
48 <button type
="submit" class="btn btn-danger confirm">Discharge Patient
</button
>
51 <?php
include(CONFIG_LIB
."foot.php");?
>