Revert "1. add edit event fails when save edited single provider recurring events...
[openemr.git] / interface / reports / background_services.php
blob7602c43991a8fe92a1247e6a3b8f988442b480c2
1 <?php
2 /**
3 * Report to view the background services.
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2013-2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 use OpenEMR\Core\Header;
18 <html>
20 <head>
22 <?php Header::setupHeader(); ?>
24 <title><?php echo xlt('Background Services'); ?></title>
26 <style type="text/css">
28 /* specifically include & exclude from printing */
29 @media print {
30 #report_parameters {
31 visibility: hidden;
32 display: none;
34 #report_parameters_daterange {
35 visibility: visible;
36 display: inline;
38 #report_results table {
39 margin-top: 0px;
43 /* specifically exclude some from the screen */
44 @media screen {
45 #report_parameters_daterange {
46 visibility: hidden;
47 display: none;
51 </style>
52 </head>
54 <body class="body_top">
56 <span class='title'><?php echo xlt('Background Services'); ?></span>
58 <form method='post' name='theform' id='theform' action='background_services.php' onsubmit='return top.restoreSession()'>
60 <div id="report_parameters">
61 <table>
62 <tr>
63 <td width='470px'>
64 <div class="btn-group pull-left" role="group">
65 <a id='refresh_button' href='#' class='btn btn-default btn-refresh' onclick='top.restoreSession(); $("#theform").submit()'>
66 <?php echo xlt('Refresh'); ?>
67 </a>
68 </div>
69 </td>
70 </tr>
71 </table>
72 </div> <!-- end of search parameters -->
74 <br>
78 <div id="report_results">
79 <table>
81 <thead>
82 <th align='center'>
83 <?php echo xlt('Service Name'); ?>
84 </th>
86 <th align='center'>
87 <?php echo xlt('Active'); ?>
88 </th>
90 <th align='center'>
91 <?php echo xlt('Automatic'); ?>
92 </th>
94 <th align='center'>
95 <?php echo xlt('Interval (minutes)'); ?>
96 </th>
98 <th align='center'>
99 <?php echo xlt('Currently Busy'); ?>
100 </th>
102 <th align='center'>
103 <?php echo xlt('Last Run Started At'); ?>
104 </th>
106 <th align='center'>
107 <?php echo xlt('Next Scheduled Run'); ?>
108 </th>
110 <th align='center'>
111 &nbsp;
112 </th>
114 </thead>
115 <tbody> <!-- added for better print-ability -->
116 <?php
118 $res = sqlStatement("SELECT *, (`next_run` - INTERVAL `execute_interval` MINUTE) as `last_run_start`" .
119 " FROM `background_services` ORDER BY `sort_order`");
120 while ($row = sqlFetchArray($res)) {
122 <tr>
123 <td align='center'><?php echo xlt($row['title']); ?></td>
125 <td align='center'><?php echo ($row['active']) ? xlt("Yes") : xlt("No"); ?></td>
127 <?php if ($row['active']) { ?>
128 <td align='center'><?php echo ($row['execute_interval'] > 0) ? xlt("Yes") : xlt("No"); ?></td>
129 <?php } else { ?>
130 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
131 <?php } ?>
133 <?php if ($row['active'] && ($row['execute_interval'] > 0)) { ?>
134 <td align='center'><?php echo text($row['execute_interval']); ?></td>
135 <?php } else { ?>
136 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
137 <?php } ?>
139 <td align='center'><?php echo ($row['running']>0) ? xlt("Yes") : xlt("No"); ?></td>
141 <?php if ($row['running'] > -1) { ?>
142 <td align='center'><?php echo text(oeFormatDateTime($row['last_run_start'], "global", true)); ?></td>
143 <?php } else { ?>
144 <td align='center'><?php echo xlt('Never'); ?></td>
145 <?php } ?>
147 <?php if ($row['active'] && ($row['execute_interval'] > 0)) { ?>
148 <td align='center'><?php echo text(oeFormatDateTime($row['next_run'], "global", true)); ?></td>
149 <?php } else { ?>
150 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
151 <?php } ?>
153 <?php if ($row['name'] == "phimail") { ?>
154 <td align='center'><a href='direct_message_log.php' onclick='top.restoreSession()'><?php echo xlt("View Log"); ?></a></td>
155 <?php } else { ?>
156 <td align='center'>&nbsp;</td>
157 <?php } ?>
159 </tr>
160 <?php
161 } // $row = sqlFetchArray($res) while
163 </tbody>
164 </table>
165 </div> <!-- end of search results -->
167 </form>
169 </body>
170 </html>