ongoing internationalization of date widget
[openemr.git] / interface / reports / background_services.php
blob0e464a447230629c12415432dc9a1d36dcfe32c2
1 <?php
2 /**
3 * Report to view the background services.
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>
33 <?php Header::setupHeader(); ?>
35 <title><?php echo xlt('Background Services'); ?></title>
37 <style type="text/css">
39 /* specifically include & exclude from printing */
40 @media print {
41 #report_parameters {
42 visibility: hidden;
43 display: none;
45 #report_parameters_daterange {
46 visibility: visible;
47 display: inline;
49 #report_results table {
50 margin-top: 0px;
54 /* specifically exclude some from the screen */
55 @media screen {
56 #report_parameters_daterange {
57 visibility: hidden;
58 display: none;
62 </style>
63 </head>
65 <body class="body_top">
67 <span class='title'><?php echo xlt('Background Services'); ?></span>
69 <form method='post' name='theform' id='theform' action='background_services.php' onsubmit='return top.restoreSession()'>
71 <div id="report_parameters">
72 <table>
73 <tr>
74 <td width='470px'>
75 <div class="btn-group pull-left" role="group">
76 <a id='refresh_button' href='#' class='btn btn-default btn-refresh' onclick='top.restoreSession(); $("#theform").submit()'>
77 <?php echo xlt('Refresh'); ?>
78 </a>
79 </div>
80 </td>
81 </tr>
82 </table>
83 </div> <!-- end of search parameters -->
85 <br>
89 <div id="report_results">
90 <table>
92 <thead>
93 <th align='center'>
94 <?php echo xlt('Service Name'); ?>
95 </th>
97 <th align='center'>
98 <?php echo xlt('Active'); ?>
99 </th>
101 <th align='center'>
102 <?php echo xlt('Automatic'); ?>
103 </th>
105 <th align='center'>
106 <?php echo xlt('Interval (minutes)'); ?>
107 </th>
109 <th align='center'>
110 <?php echo xlt('Currently Busy'); ?>
111 </th>
113 <th align='center'>
114 <?php echo xlt('Last Run Started At'); ?>
115 </th>
117 <th align='center'>
118 <?php echo xlt('Next Scheduled Run'); ?>
119 </th>
121 <th align='center'>
122 &nbsp;
123 </th>
125 </thead>
126 <tbody> <!-- added for better print-ability -->
127 <?php
129 $res = sqlStatement("SELECT *, (`next_run` - INTERVAL `execute_interval` MINUTE) as `last_run_start`" .
130 " FROM `background_services` ORDER BY `sort_order`");
131 while ($row = sqlFetchArray($res)) {
133 <tr>
134 <td align='center'><?php echo xlt($row['title']); ?></td>
136 <td align='center'><?php echo ($row['active']) ? xlt("Yes") : xlt("No"); ?></td>
138 <?php if ($row['active']) { ?>
139 <td align='center'><?php echo ($row['execute_interval'] > 0) ? xlt("Yes") : xlt("No"); ?></td>
140 <?php } else { ?>
141 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
142 <?php } ?>
144 <?php if ($row['active'] && ($row['execute_interval'] > 0)) { ?>
145 <td align='center'><?php echo text($row['execute_interval']); ?></td>
146 <?php } else { ?>
147 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
148 <?php } ?>
150 <td align='center'><?php echo ($row['running']>0) ? xlt("Yes") : xlt("No"); ?></td>
152 <?php if ($row['running'] > -1) { ?>
153 <td align='center'><?php echo text($row['last_run_start']); ?></td>
154 <?php } else { ?>
155 <td align='center'><?php echo xlt('Never'); ?></td>
156 <?php } ?>
158 <?php if ($row['active'] && ($row['execute_interval'] > 0)) { ?>
159 <td align='center'><?php echo text($row['next_run']); ?></td>
160 <?php } else { ?>
161 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
162 <?php } ?>
164 <?php if ($row['name'] == "phimail") { ?>
165 <td align='center'><a href='direct_message_log.php' onclick='top.restoreSession()'><?php echo xlt("View Log"); ?></a></td>
166 <?php } else { ?>
167 <td align='center'>&nbsp;</td>
168 <?php } ?>
170 </tr>
171 <?php
172 } // $row = sqlFetchArray($res) while
174 </tbody>
175 </table>
176 </div> <!-- end of search results -->
178 </form>
180 </body>
181 </html>