ongoing internationalization of date widget
[openemr.git] / interface / reports / direct_message_log.php
blobf66ee5a0fa346b0ac7b21dfa8e673364b084c474
1 <?php
2 /**
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>;.
18 * @package OpenEMR
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");
29 <html>
31 <head>
32 <?php
33 $logstart = (isset($_POST['logstart'])) ? $_POST['logstart'] : 0;
34 if (isset($_POST['lognext']) && $_POST['lognext']) {
35 $logtop = $logstart + $_POST['lognext'];
36 } else {
37 $logtop = 0;
41 <?php Header::setupHeader(); ?>
43 <title><?php echo xlt('Direct Message Log'); ?></title>
45 <style type="text/css">
47 /* specifically include & exclude from printing */
48 @media print {
49 #report_parameters {
50 visibility: hidden;
51 display: none;
53 #report_parameters_daterange {
54 visibility: visible;
55 display: inline;
57 #report_results table {
58 margin-top: 0px;
62 /* specifically exclude some from the screen */
63 @media screen {
64 #report_parameters_daterange {
65 visibility: hidden;
66 display: none;
70 </style>
71 </head>
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">
81 <table>
82 <tr>
83 <td width='470px'>
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'); ?>
87 </a>
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'); ?>
90 </a>
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'); ?>
93 </a>
94 </div>
95 </td>
96 </tr>
97 </table>
98 </div> <!-- end of search parameters -->
100 <br>
104 <div id="report_results">
105 <table>
107 <thead>
109 <th align='center'>
110 <?php echo xlt('ID'); ?>
111 </th>
113 <th align='center'>
114 <?php echo xlt('Type'); ?>
115 </th>
117 <th align='center'>
118 <?php echo xlt('Date Created'); ?>
119 </th>
121 <th align='center'>
122 <?php echo xlt('Sender'); ?>
123 </th>
125 <th align='center'>
126 <?php echo xlt('Recipient'); ?>
127 </th>
129 <th align='center'>
130 <?php echo xlt('Status'); ?>
131 </th>
133 <th align='center'>
134 <?php echo xlt('Date of Status Change'); ?>
135 </th>
137 </thead>
138 <tbody> <!-- added for better print-ability -->
139 <?php
141 if (!$logtop) {
142 $res = sqlStatement("SELECT * FROM `direct_message_log` ORDER BY `id` DESC LIMIT 100");
143 } else {
144 $res = sqlStatement(
145 "SELECT * FROM `direct_message_log` WHERE `id` BETWEEN ? AND ? ORDER BY `id` DESC",
146 array($logtop-99,$logtop)
150 $logstart = 0;
151 while ($row = sqlFetchArray($res)) {
152 if (!$logstart) {
153 $logstart = $row['id'];
156 <tr>
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>
163 <?php } else {?>
164 <td align='center'>&nbsp;</td>
165 <?php } ?>
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>
181 <?php } else {?>
182 <td align='center'>&nbsp;</td>
183 <?php } ?>
185 <td align='center'><?php echo text($row['status_ts']); ?></td>
187 </tr>
188 <?php
189 } // $row = sqlFetchArray($res) while
191 </tbody>
192 </table>
193 </div> <!-- end of search results -->
195 <input type='hidden' name='logstart' id='logstart' value='<?php echo text($logstart); ?>'>
196 </form>
198 </body>
199 </html>