]> Softwares of Agnibho - simpleipd.git/blob - www/death.php
Bugfix
[simpleipd.git] / www / death.php
1 <?php
2 require(dirname(__DIR__)."/require.php");
3 if(checkAccess("death")!="all"){
4 header("Location: error.php");
5 exit();
6 }
7 if(!empty($_GET["pid"])){
8 $pid=$_GET["pid"];
9 if(!empty($_POST["date"]) && !empty($_POST["time"]) && !empty($_POST["diagnosis"])){
10 $db->setDead($pid, $_POST);
11 header("Location: view.php?pid=".$_GET["pid"]);
12 exit();
13 }
14 $form=schema2form("forms/death.schema.json", $pid, null, null, (object)["diagnosis"=>$db->getDiagnosis($pid)->fetchArray()["diagnosis"]]);
15 }
16 ?>
17 <!DOCTYPE html>
18 <html>
19 <head>
20 <?php include(CONFIG_LIB."head.php");?>
21 <title>Death Note</title>
22 </head>
23 <body>
24 <div class="container">
25 <?php include(CONFIG_LIB."top.php");?>
26 <?php echo getInfo($pid);?>
27 <?php echo str_replace("Save", "Declare Death", $form);?>
28 </div>
29 <?php include(CONFIG_LIB."foot.php");?>
30 </body>
31 </html>