chore(deps): bump twig/twig from 3.17.1 to 3.19.0 (#7951)
[openemr.git] / interface / reports / background_services.php
bloba5996128c8b8c6016fa76b6afa28399c742a7b12
1 <?php
3 /**
4 * Report to view the background services.
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2013-2018 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 use OpenEMR\Common\Acl\AclMain;
16 use OpenEMR\Common\Twig\TwigContainer;
17 use OpenEMR\Core\Header;
19 if (!AclMain::aclCheckCore('admin', 'super')) {
20 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Background Services")]);
21 exit;
25 <html>
27 <head>
29 <?php Header::setupHeader(); ?>
31 <title><?php echo xlt('Background Services'); ?></title>
33 <style>
35 /* specifically include & exclude from printing */
36 @media print {
37 #report_parameters {
38 visibility: hidden;
39 display: none;
41 #report_parameters_daterange {
42 visibility: visible;
43 display: inline;
45 #report_results table {
46 margin-top: 0px;
50 /* specifically exclude some from the screen */
51 @media screen {
52 #report_parameters_daterange {
53 visibility: hidden;
54 display: none;
58 </style>
59 </head>
61 <body class="body_top">
63 <span class='title'><?php echo xlt('Background Services'); ?></span>
65 <form method='post' name='theform' id='theform' action='background_services.php' onsubmit='return top.restoreSession()'>
67 <div id="report_parameters">
68 <table>
69 <tr>
70 <td width='470px'>
71 <div class="btn-group float-left" role="group">
72 <a id='refresh_button' href='#' class='btn btn-secondary btn-refresh' onclick='top.restoreSession(); $("#theform").submit()'>
73 <?php echo xlt('Refresh'); ?>
74 </a>
75 </div>
76 </td>
77 </tr>
78 </table>
79 </div> <!-- end of search parameters -->
81 <br />
85 <div id="report_results">
86 <table class='table'>
88 <thead class='thead-light'>
89 <th align='center'>
90 <?php echo xlt('Service Name'); ?>
91 </th>
93 <th align='center'>
94 <?php echo xlt('Active{{Service}}'); ?>
95 </th>
97 <th align='center'>
98 <?php echo xlt('Automatic'); ?>
99 </th>
101 <th align='center'>
102 <?php echo xlt('Interval (minutes)'); ?>
103 </th>
105 <th align='center'>
106 <?php echo xlt('Currently Busy{{Service}}'); ?>
107 </th>
109 <th align='center'>
110 <?php echo xlt('Last Run Started At'); ?>
111 </th>
113 <th align='center'>
114 <?php echo xlt('Next Scheduled Run'); ?>
115 </th>
117 <th align='center'>
118 &nbsp;
119 </th>
121 </thead>
122 <tbody> <!-- added for better print-ability -->
123 <?php
125 $res = sqlStatement("SELECT *, (`next_run` - INTERVAL `execute_interval` MINUTE) as `last_run_start`" .
126 " FROM `background_services` ORDER BY `sort_order`");
127 while ($row = sqlFetchArray($res)) {
129 <tr>
130 <td align='center'><?php echo xlt($row['title']); ?></td>
132 <td align='center'><?php echo ($row['active']) ? xlt("Yes") : xlt("No"); ?></td>
134 <?php if ($row['active']) { ?>
135 <td align='center'><?php echo ($row['execute_interval'] > 0) ? xlt("Yes") : xlt("No"); ?></td>
136 <?php } else { ?>
137 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
138 <?php } ?>
140 <?php if ($row['active'] && ($row['execute_interval'] > 0)) { ?>
141 <td align='center'><?php echo text($row['execute_interval']); ?></td>
142 <?php } else { ?>
143 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
144 <?php } ?>
146 <td align='center'><?php echo ($row['running'] > 0) ? xlt("Yes") : xlt("No"); ?></td>
148 <?php if ($row['running'] > -1) { ?>
149 <td align='center'><?php echo text(oeFormatDateTime($row['last_run_start'], "global", true)); ?></td>
150 <?php } else { ?>
151 <td align='center'><?php echo xlt('Never'); ?></td>
152 <?php } ?>
154 <?php if ($row['active'] && ($row['execute_interval'] > 0)) { ?>
155 <td align='center'><?php echo text(oeFormatDateTime($row['next_run'], "global", true)); ?></td>
156 <?php } else { ?>
157 <td align='center'><?php echo xlt('Not Applicable'); ?></td>
158 <?php } ?>
160 <?php if ($row['name'] == "phimail") { ?>
161 <td align='center'><a href='direct_message_log.php' onclick='top.restoreSession()'><?php echo xlt("View Log"); ?></a></td>
162 <?php } else { ?>
163 <td align='center'>&nbsp;</td>
164 <?php } ?>
166 </tr>
167 <?php
168 } // $row = sqlFetchArray($res) while
170 </tbody>
171 </table>
172 </div> <!-- end of search results -->
174 </form>
176 </body>
177 </html>