c4df0f13ec71ae73cbe7b9b87ce997aa004096cd
[openemr.git] / interface / reports / direct_message_log.php
blobc4df0f13ec71ae73cbe7b9b87ce997aa004096cd
1 <?php
2 /**
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>;.
18 * @package OpenEMR
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");
34 <html>
36 <head>
37 <?php html_header_show();?>
39 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
41 <title><?php echo xlt('Direct Message Log'); ?></title>
43 <script type="text/javascript" src="../../library/js/jquery-1.7.2.min.js"></script>
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()'>
79 <div id="report_parameters">
80 <table>
81 <tr>
82 <td width='470px'>
83 <div style='float:left'>
85 <table class='text'>
86 <div style='margin-left:15px'>
87 <a id='refresh_button' href='#' class='css_button' onclick='top.restoreSession(); $("#theform").submit()'>
88 <span>
89 <?php echo xlt('Refresh'); ?>
90 </span>
91 </a>
92 </div>
93 </table>
94 </td>
95 </tr>
96 </table>
97 </div> <!-- end of search parameters -->
99 <br>
103 <div id="report_results">
104 <table>
106 <thead>
108 <th align='center'>
109 <?php echo xlt('ID'); ?>
110 </th>
112 <th align='center'>
113 <?php echo xlt('Type'); ?>
114 </th>
116 <th align='center'>
117 <?php echo xlt('Date Created'); ?>
118 </th>
120 <th align='center'>
121 <?php echo xlt('Sender'); ?>
122 </th>
124 <th align='center'>
125 <?php echo xlt('Recipient'); ?>
126 </th>
128 <th align='center'>
129 <?php echo xlt('Status'); ?>
130 </th>
132 <th align='center'>
133 <?php echo xlt('Date of Status Change'); ?>
134 </th>
136 </thead>
137 <tbody> <!-- added for better print-ability -->
138 <?php
140 $res = sqlStatement("SELECT * FROM `direct_message_log` ORDER BY `create_ts` DESC");
141 while ($row = sqlFetchArray($res)) {
143 <tr>
144 <td align='center'><?php echo text($row['id']); ?></td>
146 <?php if ($row['msg_type'] == "R") { ?>
147 <td align='center'><?php echo xlt("Received") ?></td>
148 <?php } else if ($row['msg_type'] == "S") { ?>
149 <td align='center'><?php echo xlt("Sent") ?></td>
150 <?php } else {?>
151 <td align='center'>&nbsp;</td>
152 <?php } ?>
154 <td align='center'><?php echo text($row['create_ts']); ?></td>
155 <td align='center'><?php echo text($row['sender']); ?></td>
156 <td align='center'><?php echo text($row['recipient']); ?></td>
158 <?php if ($row['status'] == "Q") { ?>
159 <td align='center'><?php echo xlt("Queued") ?></td>
160 <?php } else if ($row['status'] == "D") { ?>
161 <td align='center'><?php echo xlt("Dispatched") ?></td>
162 <?php } else if ($row['status'] == "R") { ?>
163 <td align='center'><?php echo xlt("Received") ?></td>
164 <?php } else if ($row['status'] == "F") { ?>
165 <td align='center'><?php echo xlt("Failed") ?></td>
166 <?php } else {?>
167 <td align='center'>&nbsp;</td>
168 <?php } ?>
170 <td align='center'><?php echo text($row['status_ts']); ?></td>
172 </tr>
173 <?php
174 } // $row = sqlFetchArray($res) while
176 </tbody>
177 </table>
178 </div> <!-- end of search results -->
180 </form>
182 </body>
183 </html>