3 * Report to view the Direct Message log.
5 * Copyright (C) 2013 Brady Miller <brady.g.miller@gmail.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @author Brady Miller <brady.g.miller@gmail.com>
20 * @link http://www.open-emr.org
24 use OpenEMR\Core\Header
;
26 require_once("../globals.php");
33 $logstart = (isset($_POST['logstart'])) ?
$_POST['logstart'] : 0;
34 if (isset($_POST['lognext']) && $_POST['lognext']) {
35 $logtop = $logstart +
$_POST['lognext'];
41 <?php Header
::setupHeader(); ?
>
43 <title
><?php
echo xlt('Direct Message Log'); ?
></title
>
45 <style type
="text/css">
47 /* specifically include & exclude from printing */
53 #report_parameters_daterange {
57 #report_results table {
62 /* specifically exclude some from the screen */
64 #report_parameters_daterange {
73 <body
class="body_top">
75 <span
class='title'><?php
echo xlt('Direct Message Log'); ?
></span
>
77 <form method
='post' name
='theform' id
='theform' action
='direct_message_log.php' onsubmit
='return top.restoreSession()'>
78 <input type
='hidden' name
='lognext' id
='lognext' value
=''>
80 <div id
="report_parameters">
84 <div
class="btn-group pull-left" role
="group">
85 <a id
='refresh_button' href
='#' class='btn btn-default btn-refresh' onclick
='top.restoreSession(); $("#theform").submit()'>
86 <?php
echo xlt('Refresh'); ?
>
88 <a id
='prev_button' href
='#' class='btn btn-default btn-transmit' onclick
='top.restoreSession(); $("#lognext").val(-100); $("#theform").submit()'>
89 <?php
echo xlt('Older'); ?
>
91 <a id
='next_button' href
='#' class='btn btn-default btn-transmit' onclick
='top.restoreSession(); $("#lognext").val(100); $("#theform").submit()'>
92 <?php
echo xlt('Newer'); ?
>
98 </div
> <!-- end of search parameters
-->
104 <div id
="report_results">
110 <?php
echo xlt('ID'); ?
>
114 <?php
echo xlt('Type'); ?
>
118 <?php
echo xlt('Date Created'); ?
>
122 <?php
echo xlt('Sender'); ?
>
126 <?php
echo xlt('Recipient'); ?
>
130 <?php
echo xlt('Status'); ?
>
134 <?php
echo xlt('Date of Status Change'); ?
>
138 <tbody
> <!-- added
for better
print-ability
-->
142 $res = sqlStatement("SELECT * FROM `direct_message_log` ORDER BY `id` DESC LIMIT 100");
145 "SELECT * FROM `direct_message_log` WHERE `id` BETWEEN ? AND ? ORDER BY `id` DESC",
146 array($logtop-99,$logtop)
151 while ($row = sqlFetchArray($res)) {
153 $logstart = $row['id'];
157 <td align
='center'><?php
echo text($row['id']); ?
></td
>
159 <?php
if ($row['msg_type'] == "R") { ?
>
160 <td align
='center'><?php
echo xlt("Received") ?
></td
>
161 <?php
} else if ($row['msg_type'] == "S") { ?
>
162 <td align
='center'><?php
echo xlt("Sent") ?
></td
>
164 <td align
='center'> 
;</td
>
167 <td align
='center'><?php
echo text($row['create_ts']); ?
></td
>
168 <td align
='center'><?php
echo text($row['sender']); ?
></td
>
169 <td align
='center'><?php
echo text($row['recipient']); ?
></td
>
171 <?php
if ($row['status'] == "Q") { ?
>
172 <td align
='center'><?php
echo xlt("Queued") ?
></td
>
173 <?php
} else if ($row['status'] == "S") { ?
>
174 <td align
='center'><?php
echo xlt("Sent") ?
></td
>
175 <?php
} else if ($row['status'] == "D") { ?
>
176 <td align
='center'><?php
echo xlt("Sent - Confirmed") ?
></td
>
177 <?php
} else if ($row['status'] == "R") { ?
>
178 <td align
='center'><?php
echo xlt("Received") ?
></td
>
179 <?php
} else if ($row['status'] == "F") { ?
>
180 <td align
='center'><?php
echo xlt("Failed") ?
></td
>
182 <td align
='center'> 
;</td
>
185 <td align
='center'><?php
echo text($row['status_ts']); ?
></td
>
189 } // $row = sqlFetchArray($res) while
193 </div
> <!-- end of search results
-->
195 <input type
='hidden' name
='logstart' id
='logstart' value
='<?php echo text($logstart); ?>'>