3 * Report to view the Direct Message log.
5 * Copyright (C) 2013 Brady Miller <brady@sparmy.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@sparmy.com>
20 * @link http://www.open-emr.org
23 //SANITIZE ALL ESCAPES
24 $sanitize_all_escapes=true;
27 //STOP FAKE REGISTER GLOBALS
28 $fake_register_globals=false;
31 require_once("../globals.php");
37 <?php
html_header_show();
38 $logstart = (isset($_POST['logstart'])) ?
$_POST['logstart'] : 0;
39 if (isset($_POST['lognext']) && $_POST['lognext']) $logtop = $logstart +
$_POST['lognext'];
43 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
45 <title
><?php
echo xlt('Direct Message Log'); ?
></title
>
47 <script type
="text/javascript" src
="../../library/js/jquery-1.7.2.min.js"></script
>
49 <style type
="text/css">
51 /* specifically include & exclude from printing */
57 #report_parameters_daterange {
61 #report_results table {
66 /* specifically exclude some from the screen */
68 #report_parameters_daterange {
77 <body
class="body_top">
79 <span
class='title'><?php
echo xlt('Direct Message Log'); ?
></span
>
81 <form method
='post' name
='theform' id
='theform' action
='direct_message_log.php' onsubmit
='return top.restoreSession()'>
82 <input type
='hidden' name
='lognext' id
='lognext' value
=''>
84 <div id
="report_parameters">
88 <div style
='float:left'>
91 <div style
='margin-left:15px'>
92 <a id
='refresh_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#theform").submit()'>
94 <?php
echo xlt('Refresh'); ?
>
97 <a id
='prev_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#lognext").val(-100); $("#theform").submit()'>
99 <?php
echo xlt('Older'); ?
>
102 <a id
='next_button' href
='#' class='css_button' onclick
='top.restoreSession(); $("#lognext").val(100); $("#theform").submit()'>
104 <?php
echo xlt('Newer'); ?
>
112 </div
> <!-- end of search parameters
-->
118 <div id
="report_results">
124 <?php
echo xlt('ID'); ?
>
128 <?php
echo xlt('Type'); ?
>
132 <?php
echo xlt('Date Created'); ?
>
136 <?php
echo xlt('Sender'); ?
>
140 <?php
echo xlt('Recipient'); ?
>
144 <?php
echo xlt('Status'); ?
>
148 <?php
echo xlt('Date of Status Change'); ?
>
152 <tbody
> <!-- added
for better
print-ability
-->
156 $res = sqlStatement("SELECT * FROM `direct_message_log` ORDER BY `id` DESC LIMIT 100");
158 $res = sqlStatement("SELECT * FROM `direct_message_log` WHERE `id` BETWEEN ? AND ? ORDER BY `id` DESC",
159 array($logtop-99,$logtop));
162 while ($row = sqlFetchArray($res)) {
163 if (!$logstart) $logstart = $row['id'];
166 <td align
='center'><?php
echo text($row['id']); ?
></td
>
168 <?php
if ($row['msg_type'] == "R") { ?
>
169 <td align
='center'><?php
echo xlt("Received") ?
></td
>
170 <?php
} else if ($row['msg_type'] == "S") { ?
>
171 <td align
='center'><?php
echo xlt("Sent") ?
></td
>
173 <td align
='center'> 
;</td
>
176 <td align
='center'><?php
echo text($row['create_ts']); ?
></td
>
177 <td align
='center'><?php
echo text($row['sender']); ?
></td
>
178 <td align
='center'><?php
echo text($row['recipient']); ?
></td
>
180 <?php
if ($row['status'] == "Q") { ?
>
181 <td align
='center'><?php
echo xlt("Queued") ?
></td
>
182 <?php
} else if ($row['status'] == "S") { ?
>
183 <td align
='center'><?php
echo xlt("Sent") ?
></td
>
184 <?php
} else if ($row['status'] == "D") { ?
>
185 <td align
='center'><?php
echo xlt("Sent - Confirmed") ?
></td
>
186 <?php
} else if ($row['status'] == "R") { ?
>
187 <td align
='center'><?php
echo xlt("Received") ?
></td
>
188 <?php
} else if ($row['status'] == "F") { ?
>
189 <td align
='center'><?php
echo xlt("Failed") ?
></td
>
191 <td align
='center'> 
;</td
>
194 <td align
='center'><?php
echo text($row['status_ts']); ?
></td
>
198 } // $row = sqlFetchArray($res) while
202 </div
> <!-- end of search results
-->
204 <input type
='hidden' name
='logstart' id
='logstart' value
='<?php echo text($logstart); ?>'>