3 * interface/logview/erx_logview.php Display NewCrop errors.
7 * @link http://www.open-emr.org
8 * @author Eldho Chacko <eldho@zhservices.com>
9 * @author Vinish K <vinish@zhservices.com>
10 * @author Sam Likins <sam.likins@wsi-services.com>
11 * @author Brady Miller <brady.g.miller@gmail.com>
12 * @copyright Copyright (c) 2011 ZMG LLC <sam@zhservices.com>
13 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
17 require_once(__DIR__
.'/../globals.php');
18 require_once($srcdir.'/log.inc');
20 $error_log_path = $GLOBALS['OE_SITE_DIR'].'/documents/erx_error';
22 if (array_key_exists('filename', $_REQUEST)) {
23 $filename = $_REQUEST['filename'];
28 if (array_key_exists('start_date', $_REQUEST)) {
29 $start_date = $_REQUEST['start_date'];
37 preg_match('/erx_error-\d{4}-\d{1,2}-\d{1,2}\.log/', $filename, $matches);
40 if ($fd = fopen($error_log_path.'/'.$filename, 'r')) {
41 $bat_content = fread($fd, filesize($error_log_path.'/'.$filename));
44 header('Pragma: public');
46 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
47 header('Content-Type: application/force-download');
48 header('Content-Disposition: attachment; filename='.$filename);
49 header('Content-Description: File Transfer');
50 header('Content-Length: '.strlen($bat_content));
61 <?php
html_header_show(); ?
>
62 <link rel
="stylesheet" href
="<?php echo $css_header; ?>" type
="text/css">
63 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
65 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
66 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-7-2/index.js"></script
>
67 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
69 <script language
="JavaScript">
70 $
(document
).ready(function(){
71 $
('.datepicker').datetimepicker({
72 <?php
$datetimepicker_timepicker = false; ?
>
73 <?php
$datetimepicker_showseconds = false; ?
>
74 <?php
$datetimepicker_formatInput = false; ?
>
75 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
76 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
82 <body
class="body_top">
84 <font
class="title"><?php
echo xlt('eRx Logs'); ?
></font
><br
><br
>
88 <span
class="text"><?php
echo xlt('Date'); ?
>: </span
>
91 <input type
="text" size
="10" class='datepicker' name
="start_date" id
="start_date" value
="<?php echo $start_date ? substr($start_date, 0, 10) : date('Y-m-d'); ?>" title
="<?php echo xlt('yyyy-mm-dd Date of service'); ?>" />
94 <input type
="submit" name
="search_logs" value
="<?php echo xlt('Search'); ?>">
102 if (array_key_exists('search_logs', $_REQUEST)) {
103 if ($handle = opendir($error_log_path)) {
104 while (false !== ($file = readdir($handle))) {
105 $file_as_in_folder = 'erx_error-'.$start_date.'.log';
107 if ($file != '.' && $file != '..' && $file_as_in_folder == $file) {
109 $fd = fopen($error_log_path.'/'.$file, 'r');
110 $bat_content = fread($fd, filesize($error_log_path.'/'.$file));
112 <p
><?php
echo xlt('Download'); ?
>: <a href
="erx_logview.php?filename=<?php echo htmlspecialchars($file, ENT_QUOTES); ?>"><?php
echo htmlspecialchars($file, ENT_NOQUOTES
); ?
></a
></p
>
113 <textarea rows
="35" cols
="132"><?php
echo htmlspecialchars($bat_content, ENT_QUOTES
); ?
></textarea
>
119 if ($check_for_file == 0) {
120 echo xlt('No log file exist for the selected date').': '.$start_date;