]> Softwares of Agnibho - simpleipd.git/commitdiff
Time from requisition
authorAgnibho Mondal <mondal@agnibho.com>
Sun, 23 May 2021 15:10:43 +0000 (20:40 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Sun, 23 May 2021 15:10:43 +0000 (20:40 +0530)
lib/functions.php
www/antibiogram.php
www/index.php
www/report.php
www/vitek.php

index 782a5d6fef73aa0dae851211049b7272fe9b70f7..24bcef9cf3170bf7209fe1234e8606a113fabc72 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-function schema2form($file, $pid=null, $id=null, $cat=null, $data=null){
+function schema2form($file, $pid=null, $id=null, $cat=null, $data=null, $time=null){
   global $db;
   $schema=json_decode(file_get_contents($file));
 
@@ -26,6 +26,14 @@ function schema2form($file, $pid=null, $id=null, $cat=null, $data=null){
       $value="value='".$data->$field."'";
       $value2=$data->$field;
     }
+    elseif(!empty($time) && $field=="date"){
+      $value="value='".date("Y-m-d", $time)."'";
+      $value2=date("Y-m-d", $time);
+    }
+    elseif(!empty($time) && $field=="time"){
+      $value="value='".date("H:i", $time)."'";
+      $value2=date("H:i", $time);
+    }
     else{
       $value="";
       $value2="";
index 09c84f6ace7ef2ceafbcc2ca9ba4b12d03b866e3..a56f92e799f1e536827514cf2871b0b38c0ae32a 100644 (file)
@@ -47,9 +47,13 @@ if(!empty($_GET["pid"]) && !empty($_GET["form"])){
     $sample="value='".$data->sample."'";
     $organism="value='".$data->organism."'";
   }
-  elseif(!empty($_GET["sample"])){
-    $date="";
-    $sample="value='".$_GET["sample"]."'";
+  elseif(!empty($_GET["time"]) || !empty($_GET["sample"])){
+    if(!empty($_GET["time"])){
+      $date="value='".date("Y-m-d", $_GET["time"])."'";
+    }
+    if(!empty($_GET["sample"])){
+      $sample="value='".$_GET["sample"]."'";
+    }
     $organism="";
   }
   else{
index 05d46f2aa4ff25399367545ccb90fdc7b338d8e1..9900dbbd51dd40f95ac3493a2565d8287a1840b7 100644 (file)
@@ -12,10 +12,10 @@ while($arr=$reqs->fetchArray()){
   $pid=$arr["pid"];
   if(!empty($arr["form"])){
     if($arr["form"]=="report-cs"){
-      $test="<a href='vitek.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&sample=".$arr["sample"]."&src=index'>".$arr["test"]."</a>";
+      $test="<a href='vitek.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&sample=".$arr["sample"]."&time=".$arr["time"]."&src=index'>".$arr["test"]."</a>";
     }
     else{
-      $test="<a href='report.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&sample=".$arr["sample"]."&src=index'>".$arr["test"]."</a>";
+      $test="<a href='report.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&sample=".$arr["sample"]."&time=".$arr["time"]."&src=index'>".$arr["test"]."</a>";
     }
   }
   else{
index 8f1309417443726aaeac8692ff350efc3bb2d693..bb969ae599587590b20f71230e034e498cad03f1 100644 (file)
@@ -25,11 +25,17 @@ if(!empty($_GET["pid"]) && !empty($_GET["form"])){
       exit();
     }
   }
+  if(!empty($_GET["time"])){
+    $time=$_GET["time"];
+  }
+  else{
+    $time=null;
+  }
   if(isSet($_GET["id"])){
-    $form=schema2form("forms/".$_GET["form"].".schema.json", $pid, $_GET["id"], "reports");
+    $form=schema2form("forms/".$_GET["form"].".schema.json", $pid, $_GET["id"], "reports", null, $time);
   }
   else{
-    $form=schema2form("forms/".$_GET["form"].".schema.json");
+    $form=schema2form("forms/".$_GET["form"].".schema.json", null, null, null, null, $time);
   }
 }
 ?>
index 127a43c807c20b3501db9ca8f8517a6eae5e5207..a72ee205d934ddc0244b2497928e5e103d4de9fd 100644 (file)
@@ -13,6 +13,12 @@ if(!empty($_GET["sample"])){
 else{
   $sample="";
 }
+if(!empty($_GET["time"])){
+  $time="&time=".$_GET["time"];
+}
+else{
+  $time="";
+}
 if(!empty($_GET["src"]) && $_GET["src"]=="index"){
   $src="&src=index";
 }
@@ -33,10 +39,10 @@ else{
         <div class="card-body">
           <h4 class="card-title">Type of Organism</h4>
           <ul class="list-group">
-            <li class="list-group-item"><a href="report.php?pid=<?php echo $pid;?>&form=report-cs<?php echo $req;?><?php echo $sample;?><?php echo $src;?>">No growth</a></li>
-            <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-grampos<?php echo $req;?><?php echo $sample;?><?php echo $src;?>">Vitek Report (Gram Positive)</a></li>
-            <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-gramneg<?php echo $req;?><?php echo $sample;?><?php echo $src;?>">Vitek Report (Gram Negative)</a></li>
-            <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-fungal<?php echo $req;?><?php echo $sample;?><?php echo $src;?>">Vitek Report (Fungal)</a></li>
+            <li class="list-group-item"><a href="report.php?pid=<?php echo $pid;?>&form=report-cs<?php echo $req;?><?php echo $sample;?><?php echo $time;?><?php echo $src;?>">No growth</a></li>
+            <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-grampos<?php echo $req;?><?php echo $sample;?><?php echo $time;?><?php echo $src;?>">Vitek Report (Gram Positive)</a></li>
+            <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-gramneg<?php echo $req;?><?php echo $sample;?><?php echo $time;?><?php echo $src;?>">Vitek Report (Gram Negative)</a></li>
+            <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-fungal<?php echo $req;?><?php echo $sample;?><?php echo $time;?><?php echo $src;?>">Vitek Report (Fungal)</a></li>
           </ul>
         </div>
       </div>