Some sizing tweaks for patient PDF report, and cosmetic cleanup of vitals report...
[openemr.git] / contrib / forms / scanned_notes / report.php
blob5c59d38c0a6fc175b71030423a74c6b7d341628c
1 <?php
2 // Copyright (C) 2006-2012 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 include_once("../../globals.php");
10 include_once($GLOBALS["srcdir"] . "/api.inc");
12 function scanned_notes_report($pid, $useless_encounter, $cols, $id) {
13 global $webserver_root, $web_root, $encounter;
15 // In the case of a patient report, the passed encounter is vital.
16 $thisenc = $useless_encounter ? $useless_encounter : $encounter;
18 $count = 0;
20 $data = sqlQuery("SELECT * " .
21 "FROM form_scanned_notes WHERE " .
22 "id = '$id' AND activity = '1'");
24 if ($data) {
25 if ($data['notes']) {
26 echo " <span class='bold'>Comments: </span><span class='text'>";
27 echo nl2br($data['notes']) . "</span><br />\n";
30 for ($i = -1; true; ++$i) {
31 $suffix = ($i < 0) ? "" : "-$i";
32 $imagepath = $GLOBALS['OE_SITE_DIR'] .
33 "/documents/$pid/encounters/${thisenc}_$id$suffix.jpg";
34 $imageurl = "$web_root/sites/" . $_SESSION['site_id'] .
35 "/documents/$pid/encounters/${thisenc}_$id$suffix.jpg";
36 if (is_file($imagepath)) {
37 echo " <img src='$imageurl'";
38 // Flag images with excessive width for possible stylesheet action.
39 $asize = getimagesize($imagepath);
40 if ($asize[0] > 750) {
41 echo " class='bigimage'";
43 echo " />\n";
44 echo " <br />\n";
46 else {
47 if ($i >= 0) break;