Merge branch 'master' of git://github.com/openemr/openemr
[openemr.git] / interface / reports / players_report_ajax.php
blob2c3c8661b6829f54a46cb9036356402c73fdcd1c
1 <?php
2 // Copyright (C) 2009 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 require_once("../globals.php");
10 require_once("$srcdir/lists.inc");
12 $plid = $_GET['plid'] + 0; // pid
13 $s = '';
15 if (isset($_GET['date'])) {
16 $date = $_GET['date'];
17 $date = substr($date,0,4) . '-' . substr($date,4,2) . '-' . substr($date,6,2);
18 // get patient notes
19 $res = sqlStatement("SELECT title, body FROM pnotes WHERE " .
20 "pid = '$plid' AND LEFT(date,10) = '$date' AND " .
21 "title LIKE 'Roster' AND deleted = 0 ORDER BY date LIMIT 1");
22 while ($row = sqlFetchArray($res)) {
23 $s .= nl2br(htmlentities($row['body'],ENT_QUOTES)) . "<br />";
25 if ($s === '') $s = "No notes";
27 else {
28 // get issues
29 $res = sqlStatement("SELECT type, title FROM lists WHERE pid = '$plid' " .
30 "AND activity = 1 ORDER BY type, begdate");
31 while ($row = sqlFetchArray($res)) {
32 $s .= $ISSUE_TYPES[$row['type']][1] . ": " .
33 htmlentities($row['title'],ENT_QUOTES) . "<br />";
35 if ($s === '') $s = "No issues";
37 // echo "ttTitle = '$s';";
38 $s = str_replace("\r", "", $s);
39 echo "ttobject.innerHTML = '" . str_replace("\n", "", $s) . "';";