added new datepicker to amendments gui
[openemr.git] / interface / batchcom / batch_reminders.php
blob841b8214338cd5f035850f66d32fa17dbdbe1701
1 <?php
2 // Copyright (C) 2010 OpenEMR Support LLC
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 //SANITIZE ALL ESCAPES
9 $sanitize_all_escapes=true;
11 //STOP FAKE REGISTER GLOBALS
12 $fake_register_globals=false;
14 require_once(dirname(__FILE__)."/../../interface/globals.php");
15 require_once ($GLOBALS['srcdir'] . "/maviq_phone_api.php");
16 require_once($GLOBALS['srcdir'] . "/reminders.php");
17 require_once($GLOBALS['srcdir'] . "/report_database.inc");
19 //To improve performance and not freeze the session when running this
20 // report, turn off session writing. Note that php session variables
21 // can not be modified after the line below. So, if need to do any php
22 // session work in the future, then will need to remove this line.
23 session_write_close();
25 //Remove time limit, since script can take many minutes
26 set_time_limit(0);
28 // If report_id, then just going to show the report log
29 $report_id = ($_GET['report_id']) ? $_GET['report_id'] : "";
31 // Set the "nice" level of the process for this script when. When the "nice" level
32 // is increased, this cpu intensive script will have less affect on the performance
33 // of other server activities, albeit it may negatively impact the performance
34 // of this script (note this is only applicable for linux).
35 if (empty($report_id) && !empty($GLOBALS['pat_rem_clin_nice'])) {
36 proc_nice($GLOBALS['pat_rem_clin_nice']);
40 <html>
41 <head>
42 <?php html_header_show();?>
43 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
44 <link rel="stylesheet" href="batchcom.css" type="text/css">
45 </head>
46 <body class="body_top">
47 <span class="title"><?php echo htmlspecialchars(xl('Patient Reminder Batch Job'), ENT_NOQUOTES)?></span>
49 <?php
50 // Collect the sender information
51 // TODO
52 // $sender_name
53 // $email_address
57 <table>
58 <tr>
59 <td class='text' align='left' colspan="3"><br>
61 <?php if ($report_id) {
62 // collect log from a previous run to show
63 $results_log = collectReportDatabase($report_id);
64 $data_log = json_decode($results_log['data'],TRUE);
65 $update_rem_log = $data_log[0];
66 if ($results_log['type'] == "process_send_reminders") {
67 $send_rem_log = $data_log[1];
69 echo "<span class='text'>" . xlt("Date of Report") . ": " . text($results_log['date_report']) . "</span><br><br>";
71 else {
72 $update_rem_log = update_reminders_batch_method();
73 $send_rem_log = send_reminders();
77 <span class="text"><?php echo htmlspecialchars(xl('The patient reminders have been updated'), ENT_NOQUOTES) . ":"?></span><br>
78 <span class="text"><?php echo htmlspecialchars(xl('Total active actions'), ENT_NOQUOTES) . ": " . $update_rem_log['total_active_actions'];?></span><br>
79 <span class="text"><?php echo htmlspecialchars(xl('Total active reminders before update'), ENT_NOQUOTES) . ": " . $update_rem_log['total_pre_active_reminders'];?></span><br>
80 <span class="text"><?php echo htmlspecialchars(xl('Total unsent reminders before update'), ENT_NOQUOTES) . ": " . $update_rem_log['total_pre_unsent_reminders'];?></span><br>
81 <span class="text"><?php echo htmlspecialchars(xl('Total active reminders after update'), ENT_NOQUOTES) . ": " . $update_rem_log['total_post_active_reminders'];?></span><br>
82 <span class="text"><?php echo htmlspecialchars(xl('Total unsent reminders after update'), ENT_NOQUOTES) . ": " . $update_rem_log['total_post_unsent_reminders'];?></span><br>
83 <span class="text"><?php echo htmlspecialchars(xl('Total new reminders'), ENT_NOQUOTES) . ": " . $update_rem_log['number_new_reminders'];?></span><br>
84 <span class="text"><?php echo htmlspecialchars(xl('Total updated reminders'), ENT_NOQUOTES) . ": " . $update_rem_log['number_updated_reminders'];?></span><br>
85 <span class="text"><?php echo htmlspecialchars(xl('Total inactivated reminders'), ENT_NOQUOTES) . ": " . $update_rem_log['number_inactivated_reminders'];?></span><br>
86 <span class="text"><?php echo htmlspecialchars(xl('Total unchanged reminders'), ENT_NOQUOTES) . ": " . $update_rem_log['number_unchanged_reminders'];?></span><br>
88 <?php if ($results_log['type'] != "process_reminders") { ?>
89 <br><span class="text"><?php echo htmlspecialchars(xl('The patient reminders have been sent'), ENT_NOQUOTES) . ":"?></span><br>
90 <span class="text"><?php echo htmlspecialchars(xl('Total unsent reminders before sending process'), ENT_NOQUOTES) . ": " . $send_rem_log['total_pre_unsent_reminders'];?></span><br>
91 <span class="text"><?php echo htmlspecialchars(xl('Total unsent reminders after sending process'), ENT_NOQUOTES) . ": " . $send_rem_log['total_post_unsent_reminders'];?></span><br>
92 <span class="text"><?php echo htmlspecialchars(xl('Total successful reminders sent via email'), ENT_NOQUOTES) . ": " . $send_rem_log['number_success_emails'];?></span><br>
93 <span class="text"><?php echo htmlspecialchars(xl('Total failed reminders sent via email'), ENT_NOQUOTES) . ": " . $send_rem_log['number_failed_emails'];?></span><br>
94 <span class="text"><?php echo htmlspecialchars(xl('Total successful reminders sent via phone'), ENT_NOQUOTES) . ": " . $send_rem_log['number_success_calls'];?></span><br>
95 <span class="text"><?php echo htmlspecialchars(xl('Total failed reminders sent via phone'), ENT_NOQUOTES) . ": " . $send_rem_log['number_unchanged_reminders'];?></span><br>
97 <br><span class="text"><?php echo htmlspecialchars(xl('(Email delivery is immediate, while automated VOIP is sent to the service provider for further processing.)'), ENT_NOQUOTES)?></span><br>
98 <?php } // end of ($results_log['type'] != "process_reminders") ?>
100 <?php if (report_id) { ?>
101 <br><input type="button" value="<?php echo htmlspecialchars(xl('Back'), ENT_QUOTES); ?>" onClick="top.restoreSession(); window.open('../reports/report_results.php','_self',false)"><br><br><br>
102 <?php } else { ?>
103 <br><input type="button" value="<?php echo htmlspecialchars(xl('Close'), ENT_QUOTES); ?>" onClick="window.close()"><br><br><br>
104 <?php } ?>
106 </td>
107 </tr>
108 </table>
109 <br><br>
110 </body>
111 </html>