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>;.
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");
33 <?php Header
::setupHeader(); ?
>
35 <title
><?php
echo xlt('Background Services'); ?
></title
>
37 <style type
="text/css">
39 /* specifically include & exclude from printing */
45 #report_parameters_daterange {
49 #report_results table {
54 /* specifically exclude some from the screen */
56 #report_parameters_daterange {
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">
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'); ?
>
83 </div
> <!-- end of search parameters
-->
89 <div id
="report_results">
94 <?php
echo xlt('Service Name'); ?
>
98 <?php
echo xlt('Active'); ?
>
102 <?php
echo xlt('Automatic'); ?
>
106 <?php
echo xlt('Interval (minutes)'); ?
>
110 <?php
echo xlt('Currently Busy'); ?
>
114 <?php
echo xlt('Last Run Started At'); ?
>
118 <?php
echo xlt('Next Scheduled Run'); ?
>
126 <tbody
> <!-- added
for better
print-ability
-->
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)) {
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
>
141 <td align
='center'><?php
echo xlt('Not Applicable'); ?
></td
>
144 <?php
if ($row['active'] && ($row['execute_interval'] > 0)) { ?
>
145 <td align
='center'><?php
echo text($row['execute_interval']); ?
></td
>
147 <td align
='center'><?php
echo xlt('Not Applicable'); ?
></td
>
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
>
155 <td align
='center'><?php
echo xlt('Never'); ?
></td
>
158 <?php
if ($row['active'] && ($row['execute_interval'] > 0)) { ?
>
159 <td align
='center'><?php
echo text($row['next_run']); ?
></td
>
161 <td align
='center'><?php
echo xlt('Not Applicable'); ?
></td
>
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
>
167 <td align
='center'> 
;</td
>
172 } // $row = sqlFetchArray($res) while
176 </div
> <!-- end of search results
-->