From: Agnibho Mondal Date: Sun, 23 May 2021 10:50:45 +0000 (+0530) Subject: Add attached images to print data X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=b8c118a15b78000397bce129b9d86c97679be544;p=simpleipd.git Add attached images to print data --- diff --git a/www/printdata.php b/www/printdata.php index fb44123..f775e1c 100644 --- a/www/printdata.php +++ b/www/printdata.php @@ -52,6 +52,17 @@ if($_GET["pid"]){ while($d=$deathArray->fetchArray()){ $death=$death.viewData($d["data"]); } + $imgs=""; + $pdfs=""; + foreach(glob("data/attachments/".str_replace("/", "", $pid)."-*") as $attach){ + if(pathinfo($attach, PATHINFO_EXTENSION)=="pdf"){ + $pdfs=$pdfs."".pathinfo($attach, PATHINFO_BASENAME)."
"; + } + else{ + preg_match("/-([0-9]+)-/", pathinfo($attach, PATHINFO_FILENAME), $orig); + $imgs=$imgs."
Uploaded on: ".date("M d, Y h:i a", $orig[1])."
"; + } + } } $treatments=$treatments.""; $discharge=$discharge.""; @@ -76,8 +87,16 @@ $discharge=$discharge."";
+

+
+

Attached Images

+

- + +
+

Open Attached PDFs

+ +