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