3 * Report to view the Direct Message log.
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2013-2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 use OpenEMR\Core\Header
;
22 $logstart = (isset($_POST['logstart'])) ?
$_POST['logstart'] : 0;
23 if (isset($_POST['lognext']) && $_POST['lognext']) {
24 $logtop = $logstart +
$_POST['lognext'];
30 <?php Header
::setupHeader(); ?
>
32 <title
><?php
echo xlt('Direct Message Log'); ?
></title
>
34 <style type
="text/css">
36 /* specifically include & exclude from printing */
42 #report_parameters_daterange {
46 #report_results table {
51 /* specifically exclude some from the screen */
53 #report_parameters_daterange {
62 <body
class="body_top">
64 <span
class='title'><?php
echo xlt('Direct Message Log'); ?
></span
>
66 <form method
='post' name
='theform' id
='theform' action
='direct_message_log.php' onsubmit
='return top.restoreSession()'>
67 <input type
='hidden' name
='lognext' id
='lognext' value
=''>
69 <div id
="report_parameters">
73 <div
class="btn-group pull-left" role
="group">
74 <a id
='refresh_button' href
='#' class='btn btn-default btn-refresh' onclick
='top.restoreSession(); $("#theform").submit()'>
75 <?php
echo xlt('Refresh'); ?
>
77 <a id
='prev_button' href
='#' class='btn btn-default btn-transmit' onclick
='top.restoreSession(); $("#lognext").val(-100); $("#theform").submit()'>
78 <?php
echo xlt('Older'); ?
>
80 <a id
='next_button' href
='#' class='btn btn-default btn-transmit' onclick
='top.restoreSession(); $("#lognext").val(100); $("#theform").submit()'>
81 <?php
echo xlt('Newer'); ?
>
87 </div
> <!-- end of search parameters
-->
93 <div id
="report_results">
99 <?php
echo xlt('ID'); ?
>
103 <?php
echo xlt('Type'); ?
>
107 <?php
echo xlt('Date Created'); ?
>
111 <?php
echo xlt('Sender'); ?
>
115 <?php
echo xlt('Recipient'); ?
>
119 <?php
echo xlt('Status'); ?
>
123 <?php
echo xlt('Date of Status Change'); ?
>
127 <tbody
> <!-- added
for better
print-ability
-->
131 $res = sqlStatement("SELECT * FROM `direct_message_log` ORDER BY `id` DESC LIMIT 100");
134 "SELECT * FROM `direct_message_log` WHERE `id` BETWEEN ? AND ? ORDER BY `id` DESC",
135 array($logtop-99,$logtop)
140 while ($row = sqlFetchArray($res)) {
142 $logstart = $row['id'];
146 <td align
='center'><?php
echo text($row['id']); ?
></td
>
148 <?php
if ($row['msg_type'] == "R") { ?
>
149 <td align
='center'><?php
echo xlt("Received") ?
></td
>
150 <?php
} else if ($row['msg_type'] == "S") { ?
>
151 <td align
='center'><?php
echo xlt("Sent") ?
></td
>
153 <td align
='center'> 
;</td
>
156 <td align
='center'><?php
echo text(oeFormatDateTime($row['create_ts'], "global", true)); ?
></td
>
157 <td align
='center'><?php
echo text($row['sender']); ?
></td
>
158 <td align
='center'><?php
echo text($row['recipient']); ?
></td
>
160 <?php
if ($row['status'] == "Q") { ?
>
161 <td align
='center'><?php
echo xlt("Queued") ?
></td
>
162 <?php
} else if ($row['status'] == "S") { ?
>
163 <td align
='center'><?php
echo xlt("Sent") ?
></td
>
164 <?php
} else if ($row['status'] == "D") { ?
>
165 <td align
='center'><?php
echo xlt("Sent - Confirmed") ?
></td
>
166 <?php
} else if ($row['status'] == "R") { ?
>
167 <td align
='center'><?php
echo xlt("Received") ?
></td
>
168 <?php
} else if ($row['status'] == "F") { ?
>
169 <td align
='center'><?php
echo xlt("Failed") ?
></td
>
171 <td align
='center'> 
;</td
>
174 <td align
='center'><?php
echo text($row['status_ts']); ?
></td
>
178 } // $row = sqlFetchArray($res) while
182 </div
> <!-- end of search results
-->
184 <input type
='hidden' name
='logstart' id
='logstart' value
='<?php echo text($logstart); ?>'>